mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Merge #14772: refactor: Convert comments to thread safety annotations
fa71eb5196
Convert comments to thread safety annotations (MarcoFalke)
Pull request description:
Convert human-only-readable annotations to human-and-machine-readable annotations.
Tree-SHA512: 98a97b32b50e8ec816626ed853d56c9afb31065eb14f058cda8f22a16ddd2b0c02911f9e30478aa347f466891f972496d89a828eb6e4662fb712d7d9e7643d49
This commit is contained in:
commit
d491030076
3 changed files with 8 additions and 10 deletions
|
@ -1011,6 +1011,7 @@ bool CConnman::AttemptToEvictConnection()
|
||||||
continue;
|
continue;
|
||||||
if (node->fDisconnect)
|
if (node->fDisconnect)
|
||||||
continue;
|
continue;
|
||||||
|
LOCK(node->cs_filter);
|
||||||
NodeEvictionCandidate candidate = {node->GetId(), node->nTimeConnected, node->nMinPingUsecTime,
|
NodeEvictionCandidate candidate = {node->GetId(), node->nTimeConnected, node->nMinPingUsecTime,
|
||||||
node->nLastBlockTime, node->nLastTXTime,
|
node->nLastBlockTime, node->nLastTXTime,
|
||||||
HasAllDesirableServiceFlags(node->nServices),
|
HasAllDesirableServiceFlags(node->nServices),
|
||||||
|
|
11
src/net.h
11
src/net.h
|
@ -677,10 +677,10 @@ public:
|
||||||
// a) it allows us to not relay tx invs before receiving the peer's version message
|
// a) it allows us to not relay tx invs before receiving the peer's version message
|
||||||
// b) the peer may tell us in its version message that we should not relay tx invs
|
// b) the peer may tell us in its version message that we should not relay tx invs
|
||||||
// unless it loads a bloom filter.
|
// unless it loads a bloom filter.
|
||||||
bool fRelayTxes; //protected by cs_filter
|
bool fRelayTxes GUARDED_BY(cs_filter);
|
||||||
bool fSentAddr;
|
bool fSentAddr;
|
||||||
CSemaphoreGrant grantOutbound;
|
CSemaphoreGrant grantOutbound;
|
||||||
CCriticalSection cs_filter;
|
mutable CCriticalSection cs_filter;
|
||||||
std::unique_ptr<CBloomFilter> pfilter;
|
std::unique_ptr<CBloomFilter> pfilter;
|
||||||
std::atomic<int> nRefCount;
|
std::atomic<int> nRefCount;
|
||||||
|
|
||||||
|
@ -718,10 +718,9 @@ public:
|
||||||
std::multimap<int64_t, CInv> mapAskFor;
|
std::multimap<int64_t, CInv> mapAskFor;
|
||||||
int64_t nNextInvSend;
|
int64_t nNextInvSend;
|
||||||
// Used for headers announcements - unfiltered blocks to relay
|
// Used for headers announcements - unfiltered blocks to relay
|
||||||
// Also protected by cs_inventory
|
std::vector<uint256> vBlockHashesToAnnounce GUARDED_BY(cs_inventory);
|
||||||
std::vector<uint256> vBlockHashesToAnnounce;
|
// Used for BIP35 mempool sending
|
||||||
// Used for BIP35 mempool sending, also protected by cs_inventory
|
bool fSendMempool GUARDED_BY(cs_inventory);
|
||||||
bool fSendMempool;
|
|
||||||
|
|
||||||
// Last time a "MEMPOOL" request was serviced.
|
// Last time a "MEMPOOL" request was serviced.
|
||||||
std::atomic<int64_t> timeLastMempoolReq;
|
std::atomic<int64_t> timeLastMempoolReq;
|
||||||
|
|
|
@ -1680,8 +1680,7 @@ void ThreadScriptCheck() {
|
||||||
scriptcheckqueue.Thread();
|
scriptcheckqueue.Thread();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Protected by cs_main
|
VersionBitsCache versionbitscache GUARDED_BY(cs_main);
|
||||||
VersionBitsCache versionbitscache;
|
|
||||||
|
|
||||||
int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params)
|
int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params)
|
||||||
{
|
{
|
||||||
|
@ -1722,8 +1721,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Protected by cs_main
|
static ThresholdConditionCache warningcache[VERSIONBITS_NUM_BITS] GUARDED_BY(cs_main);
|
||||||
static ThresholdConditionCache warningcache[VERSIONBITS_NUM_BITS];
|
|
||||||
|
|
||||||
// 0.13.0 was shipped with a segwit deployment defined for testnet, but not for
|
// 0.13.0 was shipped with a segwit deployment defined for testnet, but not for
|
||||||
// mainnet. We no longer need to support disabling the segwit deployment
|
// mainnet. We no longer need to support disabling the segwit deployment
|
||||||
|
|
Loading…
Add table
Reference in a new issue