mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
multi: store loop out htlc confirmations on disk
To allow users to specify differing confirmation targets, we store the swap conf target per-swap. This makes us restart safe, so we do not forget confirmation values for swaps that are in flight when we restart.
This commit is contained in:
parent
e15549e9af
commit
1877b7f08b
7 changed files with 70 additions and 12 deletions
|
|
@ -116,7 +116,7 @@ func TestLoopOutPaymentParameters(t *testing.T) {
|
|||
|
||||
// Swap is expected to register for confirmation of the htlc. Assert
|
||||
// this to prevent a blocked channel in the mock.
|
||||
ctx.AssertRegisterConf(false)
|
||||
ctx.AssertRegisterConf(false, defaultConfirmations)
|
||||
|
||||
// Cancel the swap. There is nothing else we need to assert. The payment
|
||||
// parameters don't play a role in the remainder of the swap process.
|
||||
|
|
@ -191,7 +191,7 @@ func TestLateHtlcPublish(t *testing.T) {
|
|||
signalPrepaymentResult := ctx.AssertPaid(prepayInvoiceDesc)
|
||||
|
||||
// Expect client to register for conf
|
||||
ctx.AssertRegisterConf(false)
|
||||
ctx.AssertRegisterConf(false, defaultConfirmations)
|
||||
|
||||
// // Wait too long before publishing htlc.
|
||||
blockEpochChan <- int32(swap.CltvExpiry - 10)
|
||||
|
|
@ -290,7 +290,7 @@ func TestCustomSweepConfTarget(t *testing.T) {
|
|||
signalPrepaymentResult(nil)
|
||||
|
||||
// Notify the confirmation notification for the HTLC.
|
||||
ctx.AssertRegisterConf(false)
|
||||
ctx.AssertRegisterConf(false, defaultConfirmations)
|
||||
|
||||
blockEpochChan <- ctx.Lnd.Height + 1
|
||||
|
||||
|
|
@ -494,7 +494,7 @@ func TestPreimagePush(t *testing.T) {
|
|||
signalPrepaymentResult(nil)
|
||||
|
||||
// Notify the confirmation notification for the HTLC.
|
||||
ctx.AssertRegisterConf(false)
|
||||
ctx.AssertRegisterConf(false, defaultConfirmations)
|
||||
|
||||
blockEpochChan <- ctx.Lnd.Height + 1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue