From: Wilmer Paulino Date: Thu, 28 Sep 2023 19:12:19 +0000 (-0700) Subject: Fix incorrect anchors `counterparty_payment_script` upon deserialization X-Git-Tag: v0.0.117-rc1~4^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=9f3bb7d7a54ca24e42d358a9f0f78cf8944d3f98;p=rust-lightning Fix incorrect anchors `counterparty_payment_script` upon deserialization --- diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index 95f68ba22..53ac85c29 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -1696,6 +1696,16 @@ impl ChannelMonitor { Vec::new() } } + + #[cfg(test)] + pub fn get_counterparty_payment_script(&self) -> Script{ + self.inner.lock().unwrap().counterparty_payment_script.clone() + } + + #[cfg(test)] + pub fn set_counterparty_payment_script(&self, script: Script) { + self.inner.lock().unwrap().counterparty_payment_script = script; + } } impl ChannelMonitorImpl { @@ -4146,7 +4156,7 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP 1 => { None }, _ => return Err(DecodeError::InvalidValue), }; - let counterparty_payment_script = Readable::read(reader)?; + let mut counterparty_payment_script: Script = Readable::read(reader)?; let shutdown_script = { let script =