Skip to content

Commit ad3193c

Browse files
committed
Fix lightning-block-sync 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.
1 parent 1c44d7e commit ad3193c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lightning-block-sync/src/gossip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ where
198198
return Err(UtxoLookupError::UnknownTx);
199199
}
200200

201-
outpoint = OutPoint::new(transaction.txid(), output_index.into());
201+
outpoint = OutPoint::new(transaction.compute_txid(), output_index.into());
202202
output = transaction.output[output_index as usize].clone();
203203
}};
204204
}

lightning-block-sync/src/poll.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ impl ValidatedBlockHeader {
144144
if self.height % 2016 == 0 {
145145
let target = self.header.target();
146146
let previous_target = previous_header.header.target();
147-
let min_target = previous_target.min_difficulty_transition_threshold();
148-
let max_target = previous_target.max_difficulty_transition_threshold();
147+
let min_target = previous_target.min_transition_threshold();
148+
let max_target = previous_target.max_transition_threshold_unchecked();
149149
if target > max_target || target < min_target {
150150
return Err(BlockSourceError::persistent("invalid difficulty transition"));
151151
}

lightning-block-sync/src/test_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl Blockchain {
5353
input: vec![],
5454
output: vec![],
5555
};
56-
let merkle_root = TxMerkleNode::from_raw_hash(coinbase.txid().to_raw_hash());
56+
let merkle_root = TxMerkleNode::from_raw_hash(coinbase.compute_txid().to_raw_hash());
5757
self.blocks.push(Block {
5858
header: Header {
5959
version: Version::NO_SOFT_FORK_SIGNALLING,

0 commit comments

Comments
 (0)