[wallet] Make CWallet::ListCoins atomic
zcash: Not an actual locking fix; just eliminates unnecessary recursive zcash: locking (which is a long-term goal). zcash: cherry picked from commit 1beea7af92994dca83facb11bbef82b24b538400 zcash: https://github.com/bitcoin/bitcoin/pull/12333
This commit is contained in:
parent
829e801fd9
commit
5b2f7a6ea7
|
@ -3227,10 +3227,12 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins,
|
||||||
std::set<CTxDestination>* onlyFilterByDests) const
|
std::set<CTxDestination>* onlyFilterByDests) const
|
||||||
{
|
{
|
||||||
assert(nMinDepth >= 0);
|
assert(nMinDepth >= 0);
|
||||||
|
AssertLockHeld(cs_main);
|
||||||
|
AssertLockHeld(cs_wallet);
|
||||||
|
|
||||||
vCoins.clear();
|
vCoins.clear();
|
||||||
|
|
||||||
{
|
{
|
||||||
LOCK2(cs_main, cs_wallet);
|
|
||||||
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
||||||
{
|
{
|
||||||
const uint256& wtxid = it->first;
|
const uint256& wtxid = it->first;
|
||||||
|
|
Loading…
Reference in New Issue