@@ -33,61 +33,6 @@ struct CNodeStateStats {
33
33
std::vector<int > vHeightInFlight;
34
34
};
35
35
36
- /* *
37
- * Data structure for an individual peer. This struct is not protected by
38
- * cs_main since it does not contain validation-critical data.
39
- *
40
- * Memory is owned by shared pointers and this object is destructed when
41
- * the refcount drops to zero.
42
- *
43
- * Mutexes inside this struct must not be held when locking m_peer_mutex.
44
- *
45
- * TODO: move most members from CNodeState to this structure.
46
- * TODO: move remaining application-layer data members from CNode to this structure.
47
- */
48
- struct Peer {
49
- /* * Same id as the CNode object for this peer */
50
- const NodeId m_id{0 };
51
-
52
- /* * Protects misbehavior data members */
53
- Mutex m_misbehavior_mutex;
54
- /* * Accumulated misbehavior score for this peer */
55
- int m_misbehavior_score GUARDED_BY (m_misbehavior_mutex){0 };
56
- /* * Whether this peer should be disconnected and marked as discouraged (unless it has the noban permission). */
57
- bool m_should_discourage GUARDED_BY (m_misbehavior_mutex){false };
58
-
59
- /* * Protects block inventory data members */
60
- Mutex m_block_inv_mutex;
61
- /* * List of blocks that we'll announce via an `inv` message.
62
- * There is no final sorting before sending, as they are always sent
63
- * immediately and in the order requested. */
64
- std::vector<uint256> m_blocks_for_inv_relay GUARDED_BY (m_block_inv_mutex);
65
- /* * Unfiltered list of blocks that we'd like to announce via a `headers`
66
- * message. If we can't announce via a `headers` message, we'll fall back to
67
- * announcing via `inv`. */
68
- std::vector<uint256> m_blocks_for_headers_relay GUARDED_BY (m_block_inv_mutex);
69
- /* * The final block hash that we sent in an `inv` message to this peer.
70
- * When the peer requests this block, we send an `inv` message to trigger
71
- * the peer to request the next sequence of block hashes.
72
- * Most peers use headers-first syncing, which doesn't use this mechanism */
73
- uint256 m_continuation_block GUARDED_BY (m_block_inv_mutex) {};
74
-
75
- /* * This peer's reported block height when we connected */
76
- std::atomic<int > m_starting_height{-1 };
77
-
78
- /* * Set of txids to reconsider once their parent transactions have been accepted **/
79
- std::set<uint256> m_orphan_work_set GUARDED_BY (g_cs_orphans);
80
-
81
- /* * Protects m_getdata_requests **/
82
- Mutex m_getdata_requests_mutex;
83
- /* * Work queue of items requested by this peer **/
84
- std::deque<CInv> m_getdata_requests GUARDED_BY (m_getdata_requests_mutex);
85
-
86
- explicit Peer (NodeId id) : m_id(id) {}
87
- };
88
-
89
- using PeerRef = std::shared_ptr<Peer>;
90
-
91
36
class PeerManager : public CValidationInterface , public NetEventsInterface
92
37
{
93
38
public:
0 commit comments