From 71802457b184dfd69852f46bbf5a2d37895b5b0f Mon Sep 17 00:00:00 2001 From: Michael Mallan Date: Wed, 11 Sep 2024 16:26:43 +0100 Subject: [PATCH] electrum: fix update of spend_txid for spending coins --- src/bitcoin/mod.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/bitcoin/mod.rs b/src/bitcoin/mod.rs index 104d80d6f..cba198299 100644 --- a/src/bitcoin/mod.rs +++ b/src/bitcoin/mod.rs @@ -502,7 +502,18 @@ impl BitcoinInterface for electrum::Electrum { expired_spending.push(*op); } if let Some(block) = w_c.spend_block { - spent.push((*op, *spend_txid, block.height, block.time)); + if let Some(w_spend_txid) = w_c.spend_txid { + spent.push((*op, w_spend_txid, block.height, block.time)); + } else { + log::error!( + "Coin at {} has spend_block {:?} \ + without any spend_txid. It previously \ + had spend_txid {}", + op, + block, + spend_txid, + ); + } } } }