projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix functional_test_utils::reconnect_nodes
[rust-lightning]
/
lightning
/
src
/
offers
/
offer.rs
diff --git
a/lightning/src/offers/offer.rs
b/lightning/src/offers/offer.rs
index 762bc1f3306555947f8a44aff9799547965753f5..db910b5e1bba361d977448bd6bd53a706cd92cab 100644
(file)
--- a/
lightning/src/offers/offer.rs
+++ b/
lightning/src/offers/offer.rs
@@
-966,6
+966,13
@@
impl OfferContents {
}
}
}
}
+impl Readable for Offer {
+ fn read<R: io::Read>(reader: &mut R) -> Result<Self, DecodeError> {
+ let bytes: WithoutLength<Vec<u8>> = Readable::read(reader)?;
+ Self::try_from(bytes.0).map_err(|_| DecodeError::InvalidValue)
+ }
+}
+
impl Writeable for Offer {
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
WithoutLength(&self.bytes).write(writer)
impl Writeable for Offer {
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
WithoutLength(&self.bytes).write(writer)