Skip to content

Commit

Permalink
swap: add a recovery process for AwaitFeeInvoice
Browse files Browse the repository at this point in the history
`AwaitFeeInvoice`state to hang in case of state mismatch with peer.
ElementsProject#290

To eliminate the persistence of uncompleted swaps,
execute "cancel" if recovery by restart
is executed in `AwaitFeeInvoice` state.
  • Loading branch information
YusukeShimizu committed Apr 2, 2024
1 parent fb7d5f7 commit 6498d34
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions swap/swap_out_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ func getSwapOutReceiverStates() States {
Events: Events{
Event_OnFeeInvoicePaid: State_SwapOutReceiver_BroadcastOpeningTx,
Event_OnCancelReceived: State_SwapCanceled,
Event_ActionFailed: State_SendCancel,
},
FailOnrecover: true,
},
State_SwapOutReceiver_BroadcastOpeningTx: {
Action: &CreateAndBroadcastOpeningTransaction{},
Expand Down

0 comments on commit 6498d34

Please sign in to comment.