aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-07-20 14:01:05 +0100
committerdergoegge <n.goeggi@gmail.com>2022-07-14 14:44:44 +0200
commit1f52c47d5c09b59fd3153700751c74e63edc7d7e (patch)
tree1daebbb2837b9764a348f280e7afd9ea0128644b /src/net.h
parent31c6309cc60ae3fee2d3ecc2aff9576596fb98ac (diff)
downloadbitcoin-1f52c47d5c09b59fd3153700751c74e63edc7d7e.tar.xz
[net processing] Add m_our_services and m_their_services to Peer
Track services offered by us and the peer in the Peer object.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/net.h b/src/net.h
index 6453ad1dc7..00e8a78020 100644
--- a/src/net.h
+++ b/src/net.h
@@ -592,20 +592,6 @@ private:
std::atomic<int> m_greatest_common_version{INIT_PROTO_VERSION};
//! Services offered to this peer.
- //!
- //! This is supplied by the parent CConnman during peer connection
- //! (CConnman::ConnectNode()) from its attribute of the same name.
- //!
- //! This is const because there is no protocol defined for renegotiating
- //! services initially offered to a peer. The set of local services we
- //! offer should not change after initialization.
- //!
- //! An interesting example of this is NODE_NETWORK and initial block
- //! download: a node which starts up from scratch doesn't have any blocks
- //! to serve, but still advertises NODE_NETWORK because it will eventually
- //! fulfill this role after IBD completes. P2P code is written in such a
- //! way that it can gracefully handle peers who don't make good on their
- //! service advertisements.
const ServiceFlags nLocalServices;
std::list<CNetMessage> vRecvMsg; // Used only by SocketHandler thread
@@ -625,7 +611,7 @@ class NetEventsInterface
{
public:
/** Initialize a peer (setup state, queue any initial messages) */
- virtual void InitializeNode(CNode* pnode) = 0;
+ virtual void InitializeNode(CNode& node, ServiceFlags our_services) = 0;
/** Handle removal of a peer (clear state) */
virtual void FinalizeNode(const CNode& node) = 0;