Fix bogus `Event::PaymentSent` serialization 2021-06-fix-broken-event-ser
authorMatt Corallo <git@bluematt.me>
Mon, 28 Jun 2021 23:31:29 +0000 (23:31 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 28 Jun 2021 23:38:09 +0000 (23:38 +0000)
commitdec7ec191ed6f5eda3be8a9f634678c6e72dbc94
tree94b489b0c069aec77d84638ff208f942e6cd975b
parentecddfe1766f454f1609509a4756201523129235b
Fix bogus `Event::PaymentSent` serialization

`Event::PaymentSent` serialization has a bug where we
double-serialize the payment_preimage field but do not attempt to
read it twice. This results in a failure to read `ChannelManager`s
from disk if we have a pending `Event::PaymentSent` pending
awaiting handling when we serialize.

Instead of attempting to read both versions, we opt to simply fix
the serialization, assuming it is exceedingly rare for such a
scenario to appear (and if it does, we can assist in manual
recovery).

The release notes have been updated to note this inconsistency.

Found by the chanmon_consistency fuzz target.
CHANGELOG.md
lightning/src/util/events.rs