Fix serialization rt bug in Channel and test in functional_tests
authorMatt Corallo <git@bluematt.me>
Mon, 17 Feb 2020 18:50:46 +0000 (13:50 -0500)
committerMatt Corallo <git@bluematt.me>
Tue, 18 Feb 2020 23:22:05 +0000 (18:22 -0500)
commited2a5fdab91a03e7fca38101a4f235564580912d
treec01bbcf03bdda9fe2b3d3d7a60890b1656718a00
parent5fceb0ff4f5088abfc90b08ff143cfc1a9a27bb4
Fix serialization rt bug in Channel and test in functional_tests

Previously, when attempting to write out a channel with some
RemoteAnnounced pending inbound HTLCs, we'd write out the count
without them, but write out some of their fields. We should drop
them as intended as they will need to be reannounced upon
reconnection.

This was found while attempting to simply reproduce a different
bug by adding tests for ChannelManager serialization rount-trip at
the end of each functional_test (in Node::drop). That test is
included here to prevent some classes of similar bugs in the future.
lightning/src/ln/channel.rs
lightning/src/ln/functional_test_utils.rs