Move NetworkGraph inner structs to TLV storage
[rust-lightning] / lightning / src / ln / msgs.rs
index 94136a9ee65cb16fb66d292ea0f5e4bcf714b9b8..6f4795c75e8a7413d6ce18fbd1021dfbf5b99fec 100644 (file)
@@ -482,6 +482,17 @@ impl Readable for Result<NetAddress, u8> {
        }
 }
 
+impl Readable for NetAddress {
+       fn read<R: Read>(reader: &mut R) -> Result<NetAddress, DecodeError> {
+               match Readable::read(reader) {
+                       Ok(Ok(res)) => Ok(res),
+                       Ok(Err(_)) => Err(DecodeError::UnknownVersion),
+                       Err(e) => Err(e),
+               }
+       }
+}
+
+
 /// The unsigned part of a node_announcement
 #[derive(Clone, Debug, PartialEq)]
 pub struct UnsignedNodeAnnouncement {