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>
Wed, 26 Jan 2022 18:20:26 +0000 (18:20 +0000)
commit0243f2116099d7be9e9f3bdeee670273cd27082c
tree76fa23ec818a147fbd9d4e70e27a316a67215d08
parenta6ddb973ea8ac173c700435e57a897bafc420fbb
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