diff options
author | John Newbery <john@johnnewbery.com> | 2020-06-19 13:17:41 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2020-12-20 10:01:26 +0000 |
commit | 77a2c2f8f91a5c5a140fd970f9a3a142b43902bf (patch) | |
tree | 6cf55149b0e1ecc23ee978b2ca7464c98af9dbe9 /src/net_processing.h | |
parent | 717a374e74b64b7b90bc1b2995e8900212bd0bfe (diff) | |
download | bitcoin-77a2c2f8f91a5c5a140fd970f9a3a142b43902bf.tar.xz |
[net processing] Move nStartingHeight to Peer
Diffstat (limited to 'src/net_processing.h')
-rw-r--r-- | src/net_processing.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/net_processing.h b/src/net_processing.h index 3600fe7d63..5af2689f18 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -36,6 +36,7 @@ struct CNodeStateStats { int m_misbehavior_score = 0; int nSyncHeight = -1; int nCommonHeight = -1; + int nStartingHeight = -1; std::vector<int> vHeightInFlight; }; @@ -62,6 +63,9 @@ struct Peer { /** Whether this peer should be disconnected and marked as discouraged (unless it has the noban permission). */ bool m_should_discourage GUARDED_BY(m_misbehavior_mutex){false}; + /** This peer's reported block height when we connected */ + std::atomic<int> nStartingHeight{-1}; + /** Set of txids to reconsider once their parent transactions have been accepted **/ std::set<uint256> m_orphan_work_set GUARDED_BY(g_cs_orphans); @@ -182,7 +186,9 @@ private: void ProcessOrphanTx(std::set<uint256>& orphan_work_set) EXCLUSIVE_LOCKS_REQUIRED(cs_main, g_cs_orphans); /** Process a single headers message from a peer. */ - void ProcessHeadersMessage(CNode& pfrom, const std::vector<CBlockHeader>& headers, bool via_compact_block); + void ProcessHeadersMessage(CNode& pfrom, const Peer& peer, + const std::vector<CBlockHeader>& headers, + bool via_compact_block); void SendBlockTransactions(CNode& pfrom, const CBlock& block, const BlockTransactionsRequest& req); |