aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-06-19 13:29:05 -0400
committerJohn Newbery <john@johnnewbery.com>2020-12-20 10:01:48 +0000
commit53b7ac1b7d3394aeaad1e4a6e3b323d17cdf5994 (patch)
tree9bcabdd4081079e069133d84897c8f3593bfb384 /src/net_processing.h
parent78040f91687e7f1986e466d448c9b9530830e9b8 (diff)
[net processing] Move block inventory data to Peer
Diffstat (limited to 'src/net_processing.h')
-rw-r--r--src/net_processing.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/net_processing.h b/src/net_processing.h
index 5b5d96c03e..44c85a55ba 100644
--- a/src/net_processing.h
+++ b/src/net_processing.h
@@ -63,6 +63,17 @@ 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};
+ /** Protects block inventory data members */
+ Mutex m_block_inv_mutex;
+ /** List of blocks that we'll anounce via an `inv` message.
+ * There is no final sorting before sending, as they are always sent
+ * immediately and in the order requested. */
+ std::vector<uint256> vInventoryBlockToSend GUARDED_BY(m_block_inv_mutex);
+ /** Unfiltered list of blocks that we'd like to announce via a `headers`
+ * message. If we can't announce via a `headers` message, we'll fall back to
+ * announcing via `inv`. */
+ std::vector<uint256> vBlockHashesToAnnounce GUARDED_BY(m_block_inv_mutex);
+
/** This peer's reported block height when we connected */
std::atomic<int> m_starting_height{-1};