Fix fuzz warnings.

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.
This commit is contained in:
Arik Sosman 2024-08-14 23:57:14 -07:00
parent 9914fd4f8d
commit 36b484a720
No known key found for this signature in database
GPG key ID: CFF795E7811C0093
2 changed files with 4 additions and 4 deletions

View 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,

View 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());