@@ -277,7 +277,7 @@ CNodeState *State(NodeId pnode) {
277
277
return &it->second ;
278
278
}
279
279
280
- void UpdatePreferredDownload (CNode* node, CNodeState* state)
280
+ static void UpdatePreferredDownload (CNode* node, CNodeState* state)
281
281
{
282
282
nPreferredDownload -= state->fPreferredDownload ;
283
283
@@ -287,7 +287,7 @@ void UpdatePreferredDownload(CNode* node, CNodeState* state)
287
287
nPreferredDownload += state->fPreferredDownload ;
288
288
}
289
289
290
- void PushNodeVersion (CNode *pnode, CConnman* connman, int64_t nTime)
290
+ static void PushNodeVersion (CNode *pnode, CConnman* connman, int64_t nTime)
291
291
{
292
292
ServiceFlags nLocalNodeServices = pnode->GetLocalServices ();
293
293
uint64_t nonce = pnode->GetLocalNonce ();
@@ -311,7 +311,7 @@ void PushNodeVersion(CNode *pnode, CConnman* connman, int64_t nTime)
311
311
// Requires cs_main.
312
312
// Returns a bool indicating whether we requested this block.
313
313
// Also used if a block was /not/ received and timed out or started with another peer
314
- bool MarkBlockAsReceived (const uint256& hash) {
314
+ static bool MarkBlockAsReceived (const uint256& hash) {
315
315
std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> >::iterator itInFlight = mapBlocksInFlight.find (hash);
316
316
if (itInFlight != mapBlocksInFlight.end ()) {
317
317
CNodeState *state = State (itInFlight->second .first );
@@ -337,7 +337,7 @@ bool MarkBlockAsReceived(const uint256& hash) {
337
337
// Requires cs_main.
338
338
// returns false, still setting pit, if the block was already in flight from the same peer
339
339
// pit will only be valid as long as the same cs_main lock is being held
340
- bool MarkBlockAsInFlight (NodeId nodeid, const uint256& hash, const CBlockIndex* pindex = nullptr , std::list<QueuedBlock>::iterator** pit = nullptr ) {
340
+ static bool MarkBlockAsInFlight (NodeId nodeid, const uint256& hash, const CBlockIndex* pindex = nullptr , std::list<QueuedBlock>::iterator** pit = nullptr ) {
341
341
CNodeState *state = State (nodeid);
342
342
assert (state != nullptr );
343
343
@@ -371,7 +371,7 @@ bool MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, const CBlockIndex*
371
371
}
372
372
373
373
/* * Check whether the last unknown block a peer advertised is not yet known. */
374
- void ProcessBlockAvailability (NodeId nodeid) {
374
+ static void ProcessBlockAvailability (NodeId nodeid) {
375
375
CNodeState *state = State (nodeid);
376
376
assert (state != nullptr );
377
377
@@ -387,7 +387,7 @@ void ProcessBlockAvailability(NodeId nodeid) {
387
387
}
388
388
389
389
/* * Update tracking information about which blocks a peer is assumed to have. */
390
- void UpdateBlockAvailability (NodeId nodeid, const uint256 &hash) {
390
+ static void UpdateBlockAvailability (NodeId nodeid, const uint256 &hash) {
391
391
CNodeState *state = State (nodeid);
392
392
assert (state != nullptr );
393
393
@@ -411,7 +411,7 @@ void UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) {
411
411
* lNodesAnnouncingHeaderAndIDs, and keeping that list under a certain size by
412
412
* removing the first element if necessary.
413
413
*/
414
- void MaybeSetPeerAsAnnouncingHeaderAndIDs (NodeId nodeid, CConnman* connman) {
414
+ static void MaybeSetPeerAsAnnouncingHeaderAndIDs (NodeId nodeid, CConnman* connman) {
415
415
AssertLockHeld (cs_main);
416
416
CNodeState* nodestate = State (nodeid);
417
417
if (!nodestate || !nodestate->fSupportsDesiredCmpctVersion ) {
@@ -444,7 +444,7 @@ void MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid, CConnman* connman) {
444
444
}
445
445
}
446
446
447
- bool TipMayBeStale (const Consensus::Params &consensusParams)
447
+ static bool TipMayBeStale (const Consensus::Params &consensusParams)
448
448
{
449
449
AssertLockHeld (cs_main);
450
450
if (g_last_tip_update == 0 ) {
@@ -454,13 +454,13 @@ bool TipMayBeStale(const Consensus::Params &consensusParams)
454
454
}
455
455
456
456
// Requires cs_main
457
- bool CanDirectFetch (const Consensus::Params &consensusParams)
457
+ static bool CanDirectFetch (const Consensus::Params &consensusParams)
458
458
{
459
459
return chainActive.Tip ()->GetBlockTime () > GetAdjustedTime () - consensusParams.nPowTargetSpacing * 20 ;
460
460
}
461
461
462
462
// Requires cs_main
463
- bool PeerHasHeader (CNodeState *state, const CBlockIndex *pindex)
463
+ static bool PeerHasHeader (CNodeState *state, const CBlockIndex *pindex)
464
464
{
465
465
if (state->pindexBestKnownBlock && pindex == state->pindexBestKnownBlock ->GetAncestor (pindex->nHeight ))
466
466
return true ;
@@ -471,7 +471,7 @@ bool PeerHasHeader(CNodeState *state, const CBlockIndex *pindex)
471
471
472
472
/* * Update pindexLastCommonBlock and add not-in-flight missing successors to vBlocks, until it has
473
473
* at most count entries. */
474
- void FindNextBlocksToDownload (NodeId nodeid, unsigned int count, std::vector<const CBlockIndex*>& vBlocks, NodeId& nodeStaller, const Consensus::Params& consensusParams) {
474
+ static void FindNextBlocksToDownload (NodeId nodeid, unsigned int count, std::vector<const CBlockIndex*>& vBlocks, NodeId& nodeStaller, const Consensus::Params& consensusParams) {
475
475
if (count == 0 )
476
476
return ;
477
477
@@ -570,7 +570,7 @@ void UpdateLastBlockAnnounceTime(NodeId node, int64_t time_in_seconds)
570
570
571
571
// Returns true for outbound peers, excluding manual connections, feelers, and
572
572
// one-shots
573
- bool IsOutboundDisconnectionCandidate (const CNode *node)
573
+ static bool IsOutboundDisconnectionCandidate (const CNode *node)
574
574
{
575
575
return !(node->fInbound || node->m_manual_connection || node->fFeeler || node->fOneShot );
576
576
}
@@ -642,7 +642,7 @@ bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) {
642
642
// mapOrphanTransactions
643
643
//
644
644
645
- void AddToCompactExtraTransactions (const CTransactionRef& tx) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans)
645
+ static void AddToCompactExtraTransactions (const CTransactionRef& tx) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans)
646
646
{
647
647
size_t max_extra_txn = gArgs .GetArg (" -blockreconstructionextratxn" , DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN);
648
648
if (max_extra_txn <= 0 )
@@ -1280,7 +1280,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
1280
1280
}
1281
1281
}
1282
1282
1283
- uint32_t GetFetchFlags (CNode* pfrom) {
1283
+ static uint32_t GetFetchFlags (CNode* pfrom) {
1284
1284
uint32_t nFetchFlags = 0 ;
1285
1285
if ((pfrom->GetLocalServices () & NODE_WITNESS) && State (pfrom->GetId ())->fHaveWitness ) {
1286
1286
nFetchFlags |= MSG_WITNESS_FLAG;
0 commit comments