]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix ChannelMonitor round-trip introduced by 3d640da5c343111f538f006 2020-03-fix-mon-ser
authorMatt Corallo <git@bluematt.me>
Mon, 16 Mar 2020 23:01:17 +0000 (19:01 -0400)
committerMatt Corallo <git@bluematt.me>
Tue, 17 Mar 2020 00:02:48 +0000 (20:02 -0400)
3d640da5c343111f538f006996c13c9a98e0d9e6 changed the indexes for
some enums in ChannelMonitor deserialization but not serialization.
Thus, the chanmon_deser_target fuzz target failed on travis on at
least one PR.

lightning/src/ln/channelmonitor.rs

index 205f4b011ac0fb32d62304f5bf1e3ceadbbf2ca1..c1452457202305cdee05d2cad2825a7ecb2df36c 100644 (file)
@@ -1024,7 +1024,7 @@ impl<ChanSigner: ChannelKeys + Writeable> ChannelMonitor<ChanSigner> {
                        for ev in events.iter() {
                                match *ev {
                                        OnchainEvent::HTLCUpdate { ref htlc_update } => {
-                                               writer.write_all(&[1; 1])?;
+                                               0u8.write(writer)?;
                                                htlc_update.0.write(writer)?;
                                                htlc_update.1.write(writer)?;
                                        },