Skip to content

Commit 45540a2

Browse files
committed
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.
1 parent 872d39f commit 45540a2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5493,6 +5493,7 @@ UniValue claimpegin(const JSONRPCRequest& request)
54935493

54945494
// To check if it's not double spending an existing pegin UTXO, we check mempool acceptance.
54955495
CValidationState acceptState;
5496+
LockAnnotation lock(::cs_main); //TODO(stevenroose) replace with locked_chain later
54965497
bool accepted = ::AcceptToMemoryPool(mempool, acceptState, MakeTransactionRef(mtx), nullptr /* pfMissingInputs */,
54975498
nullptr /* plTxnReplaced */, false /* bypass_limits */, maxTxFee, true /* test_accept */);
54985499
if (!accepted) {

src/wallet/wallet.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,6 +2510,7 @@ bool CWallet::SelectCoinsMinConf(const CAmountMap& mapTargetValue, const CoinEli
25102510

25112511
bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAmountMap& mapTargetValue, std::set<CInputCoin>& setCoinsRet, CAmountMap& mapValueRet, const CCoinControl& coin_control, CoinSelectionParams& coin_selection_params, bool& bnb_used) const
25122512
{
2513+
AssertLockHeld(cs_wallet); // mapWallet
25132514
std::vector<COutput> vCoins(vAvailableCoins);
25142515

25152516
// coin control -> return all selected outputs (we want all selected to go into the transaction for sure)
@@ -2652,6 +2653,8 @@ bool CWallet::SignTransaction(CMutableTransaction &tx)
26522653

26532654
bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nChangePosInOut, std::string& strFailReason, bool lockUnspents, const std::set<int>& setSubtractFeeFromOutputs, CCoinControl coinControl)
26542655
{
2656+
AssertLockHeld(cs_wallet); // mapWallet
2657+
26552658
std::vector<CRecipient> vecSend;
26562659
std::set<CAsset> setAssets;
26572660
std::vector<std::unique_ptr<CReserveKey>> vChangeKey;

0 commit comments

Comments
 (0)