X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Fser.rs;h=e276e72719e4853d7094af615caed56e1415fd8d;hb=b0d37edb300edaa8d1f639aaf86c304407276695;hp=77ee33c4fa099de78ef6bac9f7c1cfd210586f73;hpb=8f4bd19c04de9b0cb67e0f607d49213a7d71a1f6;p=rust-lightning diff --git a/lightning/src/util/ser.rs b/lightning/src/util/ser.rs index 77ee33c4..e276e727 100644 --- a/lightning/src/util/ser.rs +++ b/lightning/src/util/ser.rs @@ -29,7 +29,7 @@ use bitcoin::secp256k1::constants::{PUBLIC_KEY_SIZE, SECRET_KEY_SIZE, COMPACT_SI use bitcoin::secp256k1::ecdsa; use bitcoin::secp256k1::schnorr; use bitcoin::blockdata::constants::ChainHash; -use bitcoin::blockdata::script::Script; +use bitcoin::blockdata::script::{self, Script}; use bitcoin::blockdata::transaction::{OutPoint, Transaction, TxOut}; use bitcoin::consensus; use bitcoin::consensus::Encodable; @@ -657,6 +657,21 @@ impl<'a, T> From<&'a Vec> for WithoutLength<&'a Vec> { fn from(v: &'a Vec) -> Self { Self(v) } } +impl Writeable for WithoutLength<&Script> { + #[inline] + fn write(&self, writer: &mut W) -> Result<(), io::Error> { + writer.write_all(self.0.as_bytes()) + } +} + +impl Readable for WithoutLength