Skip to content

Commit e9331cd

Browse files
committed
wallet: IsEquivalentTo should strip witness data in addition to scriptsigs
1 parent 157bbd0 commit e9331cd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/wallet/transaction.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ bool CWalletTx::IsEquivalentTo(const CWalletTx& _tx) const
1313
{
1414
CMutableTransaction tx1 {*this->tx};
1515
CMutableTransaction tx2 {*_tx.tx};
16-
for (auto& txin : tx1.vin) txin.scriptSig = CScript();
17-
for (auto& txin : tx2.vin) txin.scriptSig = CScript();
16+
for (auto& txin : tx1.vin) {
17+
txin.scriptSig = CScript();
18+
txin.scriptWitness.SetNull();
19+
}
20+
for (auto& txin : tx2.vin) {
21+
txin.scriptSig = CScript();
22+
txin.scriptWitness.SetNull();
23+
}
1824
return CTransaction(tx1) == CTransaction(tx2);
1925
}
2026

0 commit comments

Comments
 (0)