mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
wallet: IsEquivalentTo should strip witness data in addition to scriptsigs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user