Commit Graph

12 Commits (master)

Author SHA1 Message Date
Boris Nagaev 87fb185a9b
sweepbatcher: remove const defaultBatchConfTarget
It is always overwritten with primary sweep's confTarget.

Print a warning if batchConfTarget is 0 in updateRbfRate.

See https://github.com/lightninglabs/loop/pull/754#discussion_r1613514363
19 hours ago
Boris Nagaev 40ad1ce609
sweepbatcher: load from DB preserves confTarget
It used to be set to default (defaultBatchConfTarget = 12) which
could in theory affect fee rate if updateRbfRate() and publish()
were not called before the batch was saved. (Unlikely scenario.)
19 hours ago
Boris Nagaev 4258b95dd2
sweepbatcher: fix too long lines 2 days ago
Boris Nagaev 0b2c177445
sweepbatcher: exit early in handleSweep
If the sweep was successfully updated in the batch, no need to
try to add it to all other batches.

Added a test reproducing adding a sweep to both batches without this change.
2 days ago
Boris Nagaev dc5d0fe30c
sweepbatcher: narrow down interface of swapStore
Only one method of loopdb.SwapStore is used (FetchLoopOutSwap).
Local interface LoopOutFetcher was defined to reflect this.
4 days ago
Andras Banki-Horvath 14de8f1f5d
sweepbatcher: test that empty batches won't prevent startup 7 days ago
Andras Banki-Horvath e5ade6a0b1
sweepbatcher: close the quit channel when the batcher is shutting down 7 days ago
Andras Banki-Horvath c01e8014e1
sweepbatcher: do not fail on restoring empty batches
Previously storing an empty batch would make the batcher fail to start
as spinning up a restored batch assumes that there's a primary sweep
added already. As there's no point in spinning up such batch we can just
skip over it.
Furthermore we'll ensure that we won't try to ever publish an empty
batch to avoid setting the fee rate too early.
7 days ago
Andras Banki-Horvath e1ddb50dfe
loopout+sweepbatcher: calculate the per sweep onchain fees correctly
Previously we'd report the fees per sweep as the total sweep cost of a
batch. With this change the reported cost will be the proportional fee
which should be equal for all sweeps except if there's any rounding
difference in which case that is paid by the sweep belonging to the
first input of the batch tx.
3 months ago
Andras Banki-Horvath b4ebb19a77
loopdb+sweepbatcher: add GetParentBatch and TotalSwept calls 3 months ago
Andras Banki-Horvath c094ad4a85
sweepbatcher: refactor monitorSpendAndNotify to return an error 3 months ago
George Tsagkarelis 7081fb7aae
sweepbatcher: add sweep batcher 4 months ago