Remove redundant LOCK(…) and AssertLockHeld(…):
- Remove
LOCK(cs_args)fromArgsManager::SoftSetArg(...) - Remove
AssertLockHeld(cs_wallet)fromCWallet::RescanFromTime(...)
Remove redundant LOCK(…) and AssertLockHeld(…):
LOCK(cs_args) from ArgsManager::SoftSetArg(...)AssertLockHeld(cs_wallet) from CWallet::RescanFromTime(...)
cs_wallet not needed. ScanForWalletTransactions(...) takes it itself.
See https://github.com/bitcoin/bitcoin/pull/11226#issuecomment-329863375
cs_args not needed. IsArgSet(...) and ForceSetArg(...) take it themselves.
1529 | @@ -1530,7 +1530,6 @@ void CWalletTx::GetAmounts(std::list<COutputEntry>& listReceived, 1530 | int64_t CWallet::RescanFromTime(int64_t startTime, bool update) 1531 | { 1532 | AssertLockHeld(cs_main); 1533 | - AssertLockHeld(cs_wallet);
Yes, #11281 resolves this. Thanks for pointing that out!
NACK, see comments.
458 | @@ -459,7 +459,6 @@ bool ArgsManager::GetBoolArg(const std::string& strArg, bool fDefault) const 459 | 460 | bool ArgsManager::SoftSetArg(const std::string& strArg, const std::string& strValue) 461 | { 462 | - LOCK(cs_args);
Without this, theoretically there is race to ForceSetArg below:
false from IsArgSet("foo");Ah, good point. Thanks for reviewing!
Ops, missed this comment.
Closing since no longer needed. Thanks for @promag for reviewing :-)