CWallet::GetConflictS: Handle conflicting Orchard spends.

Co-authored by: Kris Nuttycombe <kris@nutty.land>
This commit is contained in:
therealyingtong 2022-03-10 00:20:37 +08:00 committed by Kris Nuttycombe
parent b21ca34d44
commit 3c0e1d9aa8
1 changed files with 12 additions and 1 deletions

View File

@ -1476,7 +1476,18 @@ set<uint256> CWallet::GetConflicts(const uint256& txid) const
}
}
// TODO ORCHARD; see #5593
for (uint32_t i = 0; i < wtx.GetOrchardBundle().GetNumActions(); i++) {
OrchardOutPoint op(wtx.GetHash(), i);
auto potential_spends = pwalletMain->orchardWallet.GetPotentialSpends(op);
if (potential_spends.size() <= 1) {
continue; // No conflict if zero or one spends
}
for (const uint256 txid : potential_spends) {
// TODO: Take into account transaction expiry; see #5585
result.insert(txid);
}
}
return result;
}