Commit Graph

67 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
77262ff699 sweep: rename Estimator to FeeEstimator 2019-01-09 15:55:01 -08:00
Joost Jager
347d1545de
utxonursery: use mocked sweeper in tests
This commit fixes a test flake caused by a race condition. Using the
real sweeper in the nursery test created too complex concurrent
behaviour to reliably assert on and made the tests difficult to
comprehend.
2018-12-19 14:14:53 +01:00
Joost Jager
eec2efdd6b
sweep: add sweeper test 2018-12-18 10:50:19 +01:00
Joost Jager
01e64afd56
sweep: add time-based sweeper
In this commit, the sweep package is extended from just tx generation to
an active sweeper that collects sweep inputs and autonomously proceeds
to publish the sweep tx after the batch window time interval has passed
without new inputs being added.
2018-12-18 10:50:17 +01:00
Joost Jager
1f0656559e
sweep: add sweeper store
This commit adds a store for the sweeper. The sweeper needs minimal
persistent data to be able to recognize its own sweeps.
2018-12-18 10:50:16 +01:00
Joost Jager
a2dcca2b08
sweep: add input partitionings generator
This commit adds a function that takes a set of inputs and splits them
in sensible sets to be used for generating transactions.
2018-12-18 10:50:14 +01:00
Joost Jager
067817f6d2
sweep: move tx generation to separate file 2018-12-18 10:50:13 +01:00
Joost Jager
e43e89514f
sweep+utxonursery+cnct+breacharbiter: add height hint to input
This commit is a preparation for the implementation of remote spend
detection. Remote spends may happen before we broadcast our own sweep
tx. This calls for accurate height hints.
2018-12-18 10:50:11 +01:00
Joost Jager
26cfc505ee
sweep: refactor weight estimation 2018-12-18 10:50:10 +01:00
Olaoluwa Osuntokun
fc21bf091a
multi: modify sweeper.CreateSweepTx to accept conf target, style changes
In this commit, we modify the newly introduced UtxoSweeper.CreateSweepTx
to accept the confirmation target as a param of the method rather than a
struct level variable. We do this as this allows each caller to decide
at sweep time, what the fee rate should be, rather than using a global
value that is meant to work in all scenarios. For example, anytime
we're sweeping an output with a CLTV lock that's has a dependant
transaction we need to sweep/cancel, we may require a higher fee rate
than a regular force close with a CSV output.
2018-10-18 18:08:27 -07:00
Conner Fromknecht
cae4f43c19
sweep/sweeper: ignore unknown witness types
This commit restores the sweep behavior of
filtering inputs with unknown witness types
from the final sweep transaction. Currently,
such inputs will be included without adding
anything to the weight estimate, possibly
creating a transaction with insufficient fees.
2018-10-17 16:21:06 -07:00
Joost Jager
95bf858ac3
sweep: refactor functions and unify tx info logging 2018-10-17 12:44:34 +02:00
Joost Jager
6977d59e35
cnct: reuse sweep tx logic for success resolver 2018-10-17 12:44:34 +02:00
Joost Jager
c1d845aa0d
cnct: reuse sweep tx logic for commit resolver
Removes duplicate sweep tx code from commit resolver
and delegates generation to UtxoSweeper in the sweep
package.
2018-10-17 12:44:34 +02:00
Joost Jager
7d69df77ed
sweep: create new Input interface
This commit introduces a common interface for sweep
inputs. It eliminates the type checking from UtxoSweeper.

Also the formerly present Amount() getter is removed. It was redundant
because this value is present in SignDesc().Output.Value as well.
2018-10-17 12:44:33 +02:00
Joost Jager
4dab405623
sweep: move sweep tx generation into sweep package
Sweep txes are currently generated in multiple locations. Moving
the sweep tx generation into a shared package will allow us to
reuse that logic.
2018-10-17 12:44:33 +02:00
Joost Jager
9fcc7ee390
utxonursery: move spendable output structs to sweep package
This commit moves the output structs to a new package as a
preparation for moving more logic into that package.
2018-10-17 12:44:33 +02:00