]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Stop writing EcdsaChannelSigner
authorJeffrey Czyz <jkczyz@gmail.com>
Fri, 10 May 2024 18:58:41 +0000 (13:58 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Fri, 10 May 2024 22:17:34 +0000 (17:17 -0500)
EcdsaChannelSigner is no longer deserialized as of version 0.0.113 and
downgrades before version 0.0.113 are no longer supported as of version
0.0.119.

lightning/src/chain/onchaintx.rs

index 4b4a4dcd1e28ca5d211baa28edfae4fb2e0ba7ce..780375d68c89eca85477576246502401d59b6b8e 100644 (file)
@@ -33,7 +33,7 @@ use crate::chain::channelmonitor::{ANTI_REORG_DELAY, CLTV_SHARED_CLAIM_BUFFER};
 use crate::chain::package::{PackageSolvingData, PackageTemplate};
 use crate::chain::transaction::MaybeSignedTransaction;
 use crate::util::logger::Logger;
-use crate::util::ser::{Readable, ReadableArgs, MaybeReadable, UpgradableRequired, Writer, Writeable, VecWriter};
+use crate::util::ser::{Readable, ReadableArgs, MaybeReadable, UpgradableRequired, Writer, Writeable};
 
 use crate::io;
 use crate::prelude::*;
@@ -312,12 +312,9 @@ impl<ChannelSigner: WriteableEcdsaChannelSigner> OnchainTxHandler<ChannelSigner>
 
                self.channel_transaction_parameters.write(writer)?;
 
-               let mut key_data = VecWriter(Vec::new());
-               self.signer.write(&mut key_data)?;
-               assert!(key_data.0.len() < core::usize::MAX);
-               assert!(key_data.0.len() < core::u32::MAX as usize);
-               (key_data.0.len() as u32).write(writer)?;
-               writer.write_all(&key_data.0[..])?;
+               // Write a zero-length signer. The data is no longer deserialized as of version 0.0.113 and
+               // downgrades before version 0.0.113 are no longer supported as of version 0.0.119.
+               0u32.write(writer)?;
 
                writer.write_all(&(self.pending_claim_requests.len() as u64).to_be_bytes())?;
                for (ref ancestor_claim_txid, request) in self.pending_claim_requests.iter() {