mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-03-15 15:39:09 +01:00
Fix lightning-transaction 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.
This commit is contained in:
parent
92aac2a2ae
commit
9914fd4f8d
4 changed files with 6 additions and 5 deletions
|
@ -74,11 +74,12 @@ impl SyncState {
|
|||
);
|
||||
}
|
||||
|
||||
self.watched_transactions.remove(&ctx.tx.txid());
|
||||
self.watched_transactions.remove(&ctx.tx.compute_txid());
|
||||
|
||||
for input in &ctx.tx.input {
|
||||
if let Some(output) = self.watched_outputs.remove(&input.previous_output) {
|
||||
let spent = (ctx.tx.txid(), ctx.block_height, input.previous_output, output);
|
||||
let spent =
|
||||
(ctx.tx.compute_txid(), ctx.block_height, input.previous_output, output);
|
||||
self.outputs_spends_pending_threshold_conf.push(spent);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -432,7 +432,7 @@ where
|
|||
fn get_confirmed_tx(
|
||||
&self, tx: &Transaction, prob_conf_height: u32,
|
||||
) -> Result<ConfirmedTx, InternalError> {
|
||||
let txid = tx.txid();
|
||||
let txid = tx.compute_txid();
|
||||
match self.client.transaction_get_merkle(&txid, prob_conf_height as usize) {
|
||||
Ok(merkle_res) => {
|
||||
debug_assert_eq!(prob_conf_height, merkle_res.block_height as u32);
|
||||
|
|
|
@ -367,7 +367,7 @@ where
|
|||
// unwrap() safety: len() > 0 is checked above
|
||||
let pos = *indexes.first().unwrap() as usize;
|
||||
if let Some(tx) = maybe_await!(self.client.get_tx(&txid))? {
|
||||
if tx.txid() != txid {
|
||||
if tx.compute_txid() != txid {
|
||||
log_error!(self.logger, "Retrieved transaction for txid {} doesn't match expectations. This should not happen. Please verify server integrity.", txid);
|
||||
return Err(InternalError::Failed);
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ impl TestConfirmable {
|
|||
impl Confirm for TestConfirmable {
|
||||
fn transactions_confirmed(&self, header: &Header, txdata: &TransactionData<'_>, height: u32) {
|
||||
for (_, tx) in txdata {
|
||||
let txid = tx.txid();
|
||||
let txid = tx.compute_txid();
|
||||
let block_hash = header.block_hash();
|
||||
self.confirmed_txs.lock().unwrap().insert(txid, (block_hash, height));
|
||||
self.unconfirmed_txs.lock().unwrap().remove(&txid);
|
||||
|
|
Loading…
Add table
Reference in a new issue