From 3afc6ce21909ef892182d2720b003ce8e3a43f9e Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 7 Aug 2018 10:55:40 -0700 Subject: [PATCH] Update CWallet::GetConflicts for Sapling. --- src/wallet/wallet.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 0d127ccbd..7d0b7c9a3 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -593,6 +593,19 @@ set CWallet::GetConflicts(const uint256& txid) const } } } + + std::pair range_o; + + for (const SpendDescription &spend : wtx.vShieldedSpend) { + uint256 nullifier = spend.nullifier; + if (mapTxSaplingNullifiers.count(nullifier) <= 1) { + continue; // No conflict if zero or one spends + } + range_o = mapTxSaplingNullifiers.equal_range(nullifier); + for (TxNullifiers::const_iterator it = range_o.first; it != range_o.second; ++it) { + result.insert(it->second); + } + } return result; }