X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fmsgs.rs;h=ec2c98cb93cdd0b6733937a176868624ee05c162;hb=a166eca0155a507cfcf1387a70be34c0a15184cb;hp=b48819972969cb0af09f90ea6d445b1afe1af603;hpb=b3dd229711bc095645ebbc6b291005e7f8c43895;p=rust-lightning diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index b48819972..ec2c98cb9 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -612,11 +612,6 @@ mod fuzzy_internal_msgs { pub(crate) enum OnionHopDataFormat { Legacy, // aka Realm-0 - // Some tests expect to be able to generate bogus non-deserializable OnionHopDatas. In the - // future we can use bogus TLV attributes, but for now we have to expose a "bogus realm" - // option. - #[cfg(test)] - BogusRealm(u8), } pub struct OnionHopData { @@ -625,7 +620,6 @@ mod fuzzy_internal_msgs { pub(crate) amt_to_forward: u64, pub(crate) outgoing_cltv_value: u32, // 12 bytes of 0-padding - pub(crate) hmac: [u8; 32], } pub struct DecodedOnionErrorPacket { @@ -964,17 +958,14 @@ impl_writeable!(UpdateAddHTLC, 32+8+8+32+4+1366, { impl Writeable for OnionHopData { fn write(&self, w: &mut W) -> Result<(), ::std::io::Error> { - w.size_hint(65); + w.size_hint(33); match self.format { OnionHopDataFormat::Legacy => 0u8.write(w)?, - #[cfg(test)] - OnionHopDataFormat::BogusRealm(v) => v.write(w)?, } self.short_channel_id.write(w)?; self.amt_to_forward.write(w)?; self.outgoing_cltv_value.write(w)?; w.write_all(&[0;12])?; - self.hmac.write(w)?; Ok(()) } } @@ -996,7 +987,6 @@ impl Readable for OnionHopData { r.read_exact(&mut [0; 12])?; v }, - hmac: Readable::read(r)?, }) } }