Do not Send FundingLocked messages while disconnected
authorMatt Corallo <git@bluematt.me>
Mon, 15 Nov 2021 01:09:27 +0000 (01:09 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 21 Dec 2021 00:16:55 +0000 (00:16 +0000)
commit20cb2a423d55a0740f0f479e38bf3f762d4e3fbe
tree0196b60a5bd563fb0a297590c90a0fd1fe803dc5
parentf4e1e586fb6dab4e1a38628b7650640066d47a7d
Do not Send FundingLocked messages while disconnected

While its generally harmless to do so (the messages will simply be
dropped in `PeerManager`) there is a potential race condition where
the FundingLocked message enters the outbound message queue, then
the peer reconnects, and then the FundingLocked message is
delivered prior to the normal ChannelReestablish flow.

We also take this opportunity to rewrite
`test_funding_peer_disconnect` to be explicit instead of using
`reconnect_peers`. This allows it to check each message being sent
carefully, whereas `reconnect_peers` is rather lazy and accepts
that sometimes signatures will be exchanged, and sometimes not.
lightning/src/ln/channel.rs
lightning/src/ln/functional_tests.rs