Skip to content

Commit

Permalink
Unlock utxos on reconnect when signatures haven't been sent (#2827)
Browse files Browse the repository at this point in the history
In the case where we have not sent our `TxSignatures`, and our peer replies with an error at reconnection, we can safely unlock our local inputs.
  • Loading branch information
pm47 authored Feb 20, 2024
1 parent 86c4837 commit e32044f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ trait ChannelOpenDualFunded extends DualFundingHandlers with ErrorHandlers {
handleFastClose(c, d.channelId) sending Error(d.channelId, DualFundingAborted(d.channelId).getMessage)

case Event(e: Error, d: DATA_WAIT_FOR_DUAL_FUNDING_SIGNED) =>
rollbackFundingAttempt(d.signingSession.fundingTx.tx, Nil)
// handleRemoteError takes care of rolling back the funding tx
handleRemoteError(e, d)

case Event(INPUT_DISCONNECTED, d: DATA_WAIT_FOR_DUAL_FUNDING_SIGNED) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ trait ErrorHandlers extends CommonHandlers {
spendLocalCurrent(hasCommitments)
}
// When there is no commitment yet, we just go to CLOSED state in case an error occurs.
case _: ChannelDataWithoutCommitments => goto(CLOSED)
case waitForDualFundingSigned: DATA_WAIT_FOR_DUAL_FUNDING_SIGNED =>
rollbackFundingAttempt(waitForDualFundingSigned.signingSession.fundingTx.tx, Nil)
goto(CLOSED)
case _: TransientChannelData => goto(CLOSED)
}
}
Expand Down

0 comments on commit e32044f

Please sign in to comment.