mirror of
https://github.com/ACINQ/eclair.git
synced 2025-02-23 22:46:44 +01:00
Handle shutdown retransmit when negotiating (#1902)
We didn't handle shutdown messages in the negotiating state, whereas they may be received upon reconnection. This created some unnecessary warnings in the logs.
This commit is contained in:
parent
9f2b0368c7
commit
4cde8c555f
1 changed files with 8 additions and 0 deletions
|
@ -1251,6 +1251,14 @@ class Channel(val nodeParams: NodeParams, val wallet: EclairWallet, remoteNodeId
|
|||
})
|
||||
|
||||
when(NEGOTIATING)(handleExceptions {
|
||||
// Upon reconnection, nodes must re-transmit their shutdown message, so we may receive it now.
|
||||
case Event(remoteShutdown: Shutdown, d: DATA_NEGOTIATING) =>
|
||||
if (remoteShutdown != d.remoteShutdown) {
|
||||
// This is a spec violation: it will likely lead to a disagreement when exchanging closing_signed and a force-close.
|
||||
log.warning("received unexpected shutdown={} (previous={})", remoteShutdown, d.remoteShutdown)
|
||||
}
|
||||
stay()
|
||||
|
||||
case Event(c@ClosingSigned(_, remoteClosingFee, remoteSig), d: DATA_NEGOTIATING) =>
|
||||
log.info("received closingFeeSatoshis={}", remoteClosingFee)
|
||||
Closing.checkClosingSignature(keyManager, d.commitments, d.localShutdown.scriptPubKey, d.remoteShutdown.scriptPubKey, remoteClosingFee, remoteSig) match {
|
||||
|
|
Loading…
Add table
Reference in a new issue