From 83317614edd21477c54a294dcb6cc677fa584969 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Wed, 15 May 2019 09:32:45 +0100 Subject: [PATCH] Add extra lock check for OSX build Apparently my upstream checkpoint was in the middle of a series of commits by ianofsky separating wallet from the main code. This means that I have to add this main lock which will be replaced by the locked_chain interface in a subsequence catchup. --- src/wallet/rpcwallet.cpp | 1 + src/wallet/wallet.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 5d431d10fe..4a21be8ce4 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5493,6 +5493,7 @@ UniValue claimpegin(const JSONRPCRequest& request) // To check if it's not double spending an existing pegin UTXO, we check mempool acceptance. CValidationState acceptState; + LockAnnotation lock(::cs_main); //TODO(stevenroose) replace with locked_chain later bool accepted = ::AcceptToMemoryPool(mempool, acceptState, MakeTransactionRef(mtx), nullptr /* pfMissingInputs */, nullptr /* plTxnReplaced */, false /* bypass_limits */, maxTxFee, true /* test_accept */); if (!accepted) { diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 265e39afa6..1b4d13d54b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2510,6 +2510,7 @@ bool CWallet::SelectCoinsMinConf(const CAmountMap& mapTargetValue, const CoinEli bool CWallet::SelectCoins(const std::vector& vAvailableCoins, const CAmountMap& mapTargetValue, std::set& setCoinsRet, CAmountMap& mapValueRet, const CCoinControl& coin_control, CoinSelectionParams& coin_selection_params, bool& bnb_used) const { + AssertLockHeld(cs_wallet); // mapWallet std::vector vCoins(vAvailableCoins); // coin control -> return all selected outputs (we want all selected to go into the transaction for sure)