]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix fuzz warnings.
authorArik Sosman <git@arik.io>
Thu, 15 Aug 2024 06:57:14 +0000 (23:57 -0700)
committerArik Sosman <git@arik.io>
Fri, 16 Aug 2024 17:31:45 +0000 (10:31 -0700)
Version 0.32.2 of `rust-bitcoin` deprecates a number of methods that
are commonly used in this project, most visibly `txid()`, which is
now called `compute_txid()`. This resulted in a lot of warnings, and
this commit is part of a series that seeks to address that.

fuzz/src/chanmon_consistency.rs
fuzz/src/full_stack.rs

index 1cdd3ff1251b93770c3ef3d559a8a2afef0b1507..361dae2b17e70e1e125c6a0776a6db87d932b442 100644 (file)
@@ -880,7 +880,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
                                                        script_pubkey: output_script,
                                                }],
                                        };
-                                       funding_output = OutPoint { txid: tx.txid(), index: 0 };
+                                       funding_output = OutPoint { txid: tx.compute_txid(), index: 0 };
                                        $source
                                                .funding_transaction_generated(
                                                        temporary_channel_id,
index 97cfe631d8d98b97274fb903959ab662c16aa052..580df1b058cd33af6104db93d5692a347794720f 100644 (file)
@@ -306,7 +306,7 @@ impl<'a> MoneyLossDetector<'a> {
        fn connect_block(&mut self, all_txn: &[Transaction]) {
                let mut txdata = Vec::with_capacity(all_txn.len());
                for (idx, tx) in all_txn.iter().enumerate() {
-                       let txid = tx.txid();
+                       let txid = tx.compute_txid();
                        self.txids_confirmed.entry(txid).or_insert_with(|| {
                                txdata.push((idx + 1, tx));
                                self.height
@@ -898,7 +898,7 @@ pub fn do_test(mut data: &[u8], logger: &Arc<dyn Logger>) {
                                        if tx.version.0 > 0xff {
                                                break;
                                        }
-                                       let funding_txid = tx.txid();
+                                       let funding_txid = tx.compute_txid();
                                        if loss_detector.txids_confirmed.get(&funding_txid).is_none() {
                                                let outpoint = OutPoint { txid: funding_txid, index: 0 };
                                                for chan in channelmanager.list_channels() {
@@ -923,7 +923,7 @@ pub fn do_test(mut data: &[u8], logger: &Arc<dyn Logger>) {
                                                        panic!();
                                                }
                                        }
-                                       let funding_txid = tx.txid();
+                                       let funding_txid = tx.compute_txid();
                                        for idx in 0..tx.output.len() {
                                                let outpoint = OutPoint { txid: funding_txid, index: idx as u16 };
                                                pending_funding_signatures.insert(outpoint, tx.clone());