Skip to content

Commit 085bc02

Browse files
authored
Merge pull request #3 from starius/reregister-fixes
staticaddr reregister: fixed two bugs and added test coverage
2 parents 079fadc + 44c2d04 commit 085bc02

File tree

2 files changed

+387
-0
lines changed

2 files changed

+387
-0
lines changed

staticaddr/loopin/actions.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,10 @@ func (f *FSM) MonitorInvoiceAndHtlcTxAction(ctx context.Context,
575575
f.Errorf("htlc tx conf chan error, re-registering: "+
576576
"%v", err)
577577

578+
// A previous confirmation may no longer be valid if the
579+
// subscription failed, so reset and wait for a fresh one.
580+
htlcConfirmed = false
581+
578582
// Re-register for htlc confirmation.
579583
htlcConfChan, htlcErrConfChan, err = registerHtlcConf()
580584
if err != nil {
@@ -695,6 +699,8 @@ func (f *FSM) MonitorInvoiceAndHtlcTxAction(ctx context.Context,
695699
case err = <-invoiceErrChan:
696700
f.Errorf("invoice subscription error: %v", err)
697701

702+
return f.HandleError(err)
703+
698704
case <-ctx.Done():
699705
return f.HandleError(ctx.Err())
700706
}

0 commit comments

Comments
 (0)