2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-09 19:10:47 +00:00
Commit Graph

12 Commits

Author SHA1 Message Date
Boris Nagaev
be69653bf0
sweepbatcher/store: remove unused field clock 2024-08-13 09:20:31 -03:00
yingshanghuangqiao
57ebc3ff16 chore: fix some comments
Signed-off-by: yingshanghuangqiao <yingshanghuangqiao@foxmail.com>
2024-07-22 16:11:16 +08:00
Andras Banki-Horvath
6a4ef3683a
sweepbatcher: fix spawning condition "unattached" spend notifiers
Previously, when handling a sweep we assumed that if a sweep status
was completed, the parent batch was also finished. However, since the
batch confirmation status depends on three on-chain confirmations, it
is possible that a spend notifier was started for a sweep of an active
batch. The notifier would fetch the parent batch from the database, but
because we incorrectly assumed that  the parent was confirmed (when it
was not), the DB call would fail with a 'no rows returned' error.
This failure would cause the sweep to fail and the sweep batcher to
stop, resulting in a permanent failure state.
2024-07-11 13:15:39 +02:00
Boris Nagaev
1947b90842
multi: typed callback in ExecTx
Provide a wrapped store type, exposing ExecTx method with a subset
interface in the callback argument. BaseDB interfaces in instantout,
reservation and sweepbatcher use ExecTx with their subset Querier
instead of whole sqlc.Querier (*sqlc.Queries).

This is needed to make the packages more reusable, so they don't
depend on methods of *sqlc.Queries they don't use.
2024-06-19 10:38:55 -03:00
Boris Nagaev
2847e83fcf
multi: separate Querier from BaseDB interfaces
A Querier holds the methods of sqlc.Querier interface relevant for a package.
BaseDB has Querier + ExecTx method.

This change is needed to simplify further rework of ExecTx.
2024-06-19 10:38:55 -03:00
Boris Nagaev
b311649ce4
sweepbatcher: use write tx in DropBatch 2024-06-17 12:26:37 -03:00
Boris Nagaev
7a7ea05e52
sweepbatcher/Store: do not provide LoopOut field
This data is not used by Batcher since commit
"sweepbatcher: load swap from loopdb, not own store".

Now sweepbatcher.Store depends only on tables sweeps and sweep_batches
and does not depend on swaps, loopout_swaps and htlc_keys, making it
easier to reuse.
2024-05-31 12:28:02 -03:00
Boris Nagaev
4258b95dd2
sweepbatcher: fix too long lines 2024-05-29 12:17:18 -03:00
Boris Nagaev
6def712dfe
sweepbatcher: fix typos in annotations of methods 2024-05-27 10:03:19 -03:00
Andras Banki-Horvath
939c9b4ccf
loopdb+sweepbatcher: add the DropBatch call 2024-05-24 18:44:04 +02:00
Andras Banki-Horvath
b4ebb19a77
loopdb+sweepbatcher: add GetParentBatch and TotalSwept calls 2024-03-04 16:15:21 +01:00
George Tsagkarelis
99608ad515
loopdb+sweepbatcher: add sweepbatcher store 2024-01-23 20:38:06 +02:00