Update CWallet::IsSpent() to check Sapling nullifiers.
This commit is contained in:
@@ -717,6 +717,16 @@ bool CWallet::IsSpent(const uint256& nullifier) const
|
||||
pair<TxNullifiers::const_iterator, TxNullifiers::const_iterator> range;
|
||||
range = mapTxSproutNullifiers.equal_range(nullifier);
|
||||
|
||||
for (TxNullifiers::const_iterator it = range.first; it != range.second; ++it) {
|
||||
const uint256& wtxid = it->second;
|
||||
std::map<uint256, CWalletTx>::const_iterator mit = mapWallet.find(wtxid);
|
||||
if (mit != mapWallet.end() && mit->second.GetDepthInMainChain() >= 0) {
|
||||
return true; // Spent
|
||||
}
|
||||
}
|
||||
|
||||
range = mapTxSaplingNullifiers.equal_range(nullifier);
|
||||
|
||||
for (TxNullifiers::const_iterator it = range.first; it != range.second; ++it) {
|
||||
const uint256& wtxid = it->second;
|
||||
std::map<uint256, CWalletTx>::const_iterator mit = mapWallet.find(wtxid);
|
||||
|
||||
Reference in New Issue
Block a user