From e9331cd6ab2c756c56e8b27a2de2a6d4884c0c06 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 10 Jun 2025 19:58:48 +0000 Subject: [PATCH] wallet: IsEquivalentTo should strip witness data in addition to scriptsigs --- src/wallet/transaction.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/wallet/transaction.cpp b/src/wallet/transaction.cpp index 561880482f8..a611a034d9e 100644 --- a/src/wallet/transaction.cpp +++ b/src/wallet/transaction.cpp @@ -13,8 +13,14 @@ bool CWalletTx::IsEquivalentTo(const CWalletTx& _tx) const { CMutableTransaction tx1 {*this->tx}; CMutableTransaction tx2 {*_tx.tx}; - for (auto& txin : tx1.vin) txin.scriptSig = CScript(); - for (auto& txin : tx2.vin) txin.scriptSig = CScript(); + for (auto& txin : tx1.vin) { + txin.scriptSig = CScript(); + txin.scriptWitness.SetNull(); + } + for (auto& txin : tx2.vin) { + txin.scriptSig = CScript(); + txin.scriptWitness.SetNull(); + } return CTransaction(tx1) == CTransaction(tx2); }