From 60e5a3e5910e215fa2d069aa1ec0e92118b1b922 Mon Sep 17 00:00:00 2001 From: bruwbird Date: Wed, 3 Apr 2024 06:55:43 +0900 Subject: [PATCH] swap: add a recovery process for AwaitFeeInvoice `AwaitFeeInvoice`state to hang in case of state mismatch with peer. https://github.com/ElementsProject/peerswap/issues/290 To eliminate the persistence of uncompleted swaps, execute "cancel" if recovery by restart is executed in `AwaitFeeInvoice` state. --- swap/swap_out_receiver.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swap/swap_out_receiver.go b/swap/swap_out_receiver.go index e3f6bd69..bc620def 100644 --- a/swap/swap_out_receiver.go +++ b/swap/swap_out_receiver.go @@ -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{},