aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 014b722ea3..9b9b44cb48 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -679,6 +679,14 @@ private:
std::chrono::microseconds NextInvToInbounds(std::chrono::microseconds now,
std::chrono::seconds average_interval);
+
+ // All of the following cache a recent block, and are protected by cs_most_recent_block
+ RecursiveMutex cs_most_recent_block;
+ std::shared_ptr<const CBlock> most_recent_block GUARDED_BY(cs_most_recent_block);
+ std::shared_ptr<const CBlockHeaderAndShortTxIDs> most_recent_compact_block GUARDED_BY(cs_most_recent_block);
+ uint256 most_recent_block_hash GUARDED_BY(cs_most_recent_block);
+ bool fWitnessesPresentInMostRecentCompactBlock GUARDED_BY(cs_most_recent_block){false};
+
/** Have we requested this block from a peer */
bool IsBlockRequested(const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
@@ -1613,13 +1621,6 @@ void PeerManagerImpl::BlockDisconnected(const std::shared_ptr<const CBlock> &blo
m_recent_confirmed_transactions.reset();
}
-// All of the following cache a recent block, and are protected by cs_most_recent_block
-static RecursiveMutex cs_most_recent_block;
-static std::shared_ptr<const CBlock> most_recent_block GUARDED_BY(cs_most_recent_block);
-static std::shared_ptr<const CBlockHeaderAndShortTxIDs> most_recent_compact_block GUARDED_BY(cs_most_recent_block);
-static uint256 most_recent_block_hash GUARDED_BY(cs_most_recent_block);
-static bool fWitnessesPresentInMostRecentCompactBlock GUARDED_BY(cs_most_recent_block);
-
/**
* Maintain state about the best-seen block and fast-announce a compact block
* to compatible peers.