From 6df9c3999323b27def3201f93d270153de173209 Mon Sep 17 00:00:00 2001 From: Arik Sosman Date: Thu, 1 Aug 2024 18:21:16 -0700 Subject: [PATCH] Use custom consensus read method. --- lightning/src/util/ser.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightning/src/util/ser.rs b/lightning/src/util/ser.rs index 3978823b1..738d58bc0 100644 --- a/lightning/src/util/ser.rs +++ b/lightning/src/util/ser.rs @@ -14,7 +14,7 @@ //! [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor use crate::prelude::*; -use crate::io::{self, Read, Seek, Take, Write, BufRead}; +use crate::io::{self, Read, Seek, Write}; use crate::io_extras::{copy, sink}; use core::hash::Hash; use crate::sync::{Mutex, RwLock}; @@ -280,7 +280,7 @@ pub trait Readable where Self: Sized { /// Reads a `Self` in from the given [`Read`]. - fn read(reader: &mut R) -> Result; + fn read(reader: &mut R) -> Result; } /// A trait that various LDK types implement allowing them to be read in from a @@ -1271,8 +1271,8 @@ macro_rules! impl_consensus_ser { } impl Readable for $bitcoin_type { - fn read(r: &mut R) -> Result { - match consensus::encode::Decodable::consensus_decode(r) { + fn read(r: &mut R) -> Result { + match consensus::encode::Decodable::consensus_decode_read(r) { Ok(t) => Ok(t), Err(consensus::encode::Error::Io(ref e)) if e.kind() == io::ErrorKind::UnexpectedEof => Err(DecodeError::ShortRead), Err(consensus::encode::Error::Io(e)) => Err(DecodeError::Io(e.kind().into())), -- 2.39.5