loop/sweepbatcher
Boris Nagaev 6d58965930
sweepbatcher: persist confirmed batches atomically
Fixes a crash window where handleConf updated the batch row to confirmed but
failed before marking sweeps complete, so re-added sweeps spawned a duplicate
batch or kept retrying. Batch confirmation and sweep completion are now
persisted inside a single DB transaction ConfirmBatchWithSweeps, and handleConf
uses the helper to atomically store the batch and the set of confirmed sweeps.

Added TestSweepBatcherConfirmedBatchIncompleteSweeps that runs against the real
loopdb backend, injects a failure mid-transaction, and verifies the database
never ends up with confirmed=true batches paired with completed=false sweeps.
2025-12-04 00:37:01 -03:00
..
greedy_batch_selection.go sweepbatcher: fast-flag enables zero delay publishing 2025-10-07 08:53:39 +02:00
greedy_batch_selection_test.go sweepbatcher: consolidate identical change pkscripts 2025-07-29 21:22:17 +02:00
log.go sweepbatcher: add mode with presigned transactions 2025-05-08 17:24:10 -03:00
presigned.go sweepbatcher: presign transactions in parallel 2025-10-14 22:37:18 -03:00
presigned_test.go sweepbatcher: presign transactions in parallel 2025-10-14 22:37:18 -03:00
store.go sweepbatcher: persist confirmed batches atomically 2025-12-04 00:37:01 -03:00
store_mock.go sweepbatcher: persist confirmed batches atomically 2025-12-04 00:37:01 -03:00
sweep_batch.go sweepbatcher: persist confirmed batches atomically 2025-12-04 00:37:01 -03:00
sweep_batch_test.go sweepbatcher: consolidate identical change pkscripts 2025-07-29 21:22:17 +02:00
sweep_batcher.go sweepbatcher: persist confirmed batches atomically 2025-12-04 00:37:01 -03:00
sweep_batcher_presigned_test.go sweepbatcher: fix fee rate calculation (publish) 2025-10-11 22:15:56 -03:00
sweep_batcher_test.go sweepbatcher: persist confirmed batches atomically 2025-12-04 00:37:01 -03:00