diff options
author | merge-script <fanquake@gmail.com> | 2024-06-21 11:20:46 +0100 |
---|---|---|
committer | merge-script <fanquake@gmail.com> | 2024-06-21 11:20:46 +0100 |
commit | a19563ac86de04f3da18fd50bfb8b69ab4dc1e61 (patch) | |
tree | 1f5ebfd42ae9a41548615412c470f4329b2be4ed | |
parent | a961ad1bebc54912b88d072abf22ab7d3cf46bf1 (diff) | |
parent | 5729dbbb7424d02c5e5bc4f2eb340fdc1c0100b4 (diff) |
Merge bitcoin/bitcoin#30316: refactor: remove extraneous lock annotations from function definitions
5729dbbb7424d02c5e5bc4f2eb340fdc1c0100b4 refactor: remove extraneous lock annotations from function definitions (Cory Fields)
Pull request description:
These annotations belong in the declarations rather than the definitions. While harmless now, future versions of clang may warn about these.
Discovered these using the upstream WIP: https://github.com/llvm/llvm-project/pull/67520
ACKs for top commit:
instagibbs:
ACK 5729dbbb7424d02c5e5bc4f2eb340fdc1c0100b4
maflcko:
ACK 5729dbbb7424d02c5e5bc4f2eb340fdc1c0100b4 🦋
Tree-SHA512: c82c6b269dd353b140cbb36b5519ab2637e54034f159d6ad3eb78c6f4019aa053a5973c626395f0ed3366b9f4117ecc4fe7926b83e9714b1e21c97d5e4bed8d7
-rw-r--r-- | src/net_processing.cpp | 4 | ||||
-rw-r--r-- | src/validation.cpp | 1 | ||||
-rw-r--r-- | src/wallet/rpc/util.cpp | 2 | ||||
-rw-r--r-- | src/wallet/spend.cpp | 2 | ||||
-rw-r--r-- | src/wallet/wallet.cpp | 4 |
5 files changed, 6 insertions, 7 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 40135a2cd3..89b9488584 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1164,7 +1164,7 @@ private: void PushAddress(Peer& peer, const CAddress& addr) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex); }; -const CNodeState* PeerManagerImpl::State(NodeId pnode) const EXCLUSIVE_LOCKS_REQUIRED(cs_main) +const CNodeState* PeerManagerImpl::State(NodeId pnode) const { std::map<NodeId, CNodeState>::const_iterator it = m_node_states.find(pnode); if (it == m_node_states.end()) @@ -1172,7 +1172,7 @@ const CNodeState* PeerManagerImpl::State(NodeId pnode) const EXCLUSIVE_LOCKS_REQ return &it->second; } -CNodeState* PeerManagerImpl::State(NodeId pnode) EXCLUSIVE_LOCKS_REQUIRED(cs_main) +CNodeState* PeerManagerImpl::State(NodeId pnode) { return const_cast<CNodeState*>(std::as_const(*this).State(pnode)); } diff --git a/src/validation.cpp b/src/validation.cpp index c34d60f137..3e9ba08bb1 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1849,7 +1849,6 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptPackage(const Package& package, MempoolAcceptResult AcceptToMemoryPool(Chainstate& active_chainstate, const CTransactionRef& tx, int64_t accept_time, bool bypass_limits, bool test_accept) - EXCLUSIVE_LOCKS_REQUIRED(::cs_main) { AssertLockHeld(::cs_main); const CChainParams& chainparams{active_chainstate.m_chainman.GetParams()}; diff --git a/src/wallet/rpc/util.cpp b/src/wallet/rpc/util.cpp index eb23c4555b..67b5ae0fe2 100644 --- a/src/wallet/rpc/util.cpp +++ b/src/wallet/rpc/util.cpp @@ -179,7 +179,7 @@ void HandleWalletError(const std::shared_ptr<CWallet> wallet, DatabaseStatus& st } } -void AppendLastProcessedBlock(UniValue& entry, const CWallet& wallet) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) +void AppendLastProcessedBlock(UniValue& entry, const CWallet& wallet) { AssertLockHeld(wallet.cs_wallet); UniValue lastprocessedblock{UniValue::VOBJ}; diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index 4cbcfdb60f..b9b4666208 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -260,7 +260,7 @@ static OutputType GetOutputType(TxoutType type, bool is_from_p2sh) // Fetch and validate the coin control selected inputs. // Coins could be internal (from the wallet) or external. util::Result<PreSelectedInputs> FetchSelectedInputs(const CWallet& wallet, const CCoinControl& coin_control, - const CoinSelectionParams& coin_selection_params) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) + const CoinSelectionParams& coin_selection_params) { PreSelectedInputs result; const bool can_grind_r = wallet.CanGrindR(); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 85cd67dab9..d569c64b43 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1366,13 +1366,13 @@ void CWallet::MarkConflicted(const uint256& hashBlock, int conflicting_height, c } -void CWallet::RecursiveUpdateTxState(const uint256& tx_hash, const TryUpdatingStateFn& try_updating_state) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { +void CWallet::RecursiveUpdateTxState(const uint256& tx_hash, const TryUpdatingStateFn& try_updating_state) { // Do not flush the wallet here for performance reasons WalletBatch batch(GetDatabase(), false); RecursiveUpdateTxState(&batch, tx_hash, try_updating_state); } -void CWallet::RecursiveUpdateTxState(WalletBatch* batch, const uint256& tx_hash, const TryUpdatingStateFn& try_updating_state) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { +void CWallet::RecursiveUpdateTxState(WalletBatch* batch, const uint256& tx_hash, const TryUpdatingStateFn& try_updating_state) { std::set<uint256> todo; std::set<uint256> done; |