1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-23 06:35:11 +01:00

Unlock utxos on reconnect when signatures haven't been sent (#2827)

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.
This commit is contained in:
Pierre-Marie Padiou 2024-02-20 15:00:23 +01:00 committed by GitHub
parent 86c483708a
commit e32044f05f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -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) =>

View file

@ -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)
}
}