From 82e53f37e1bfa6e34eac16b33329d70c3c0127da Mon Sep 17 00:00:00 2001 From: James O'Beirne Date: Tue, 10 Sep 2019 13:09:12 -0400 Subject: doc: add comments clarifying how local services are advertised Recent questions have come up regarding dynamic service registration (see https://github.com/bitcoin/bitcoin/pull/16442#discussion_r308702676 and the assumeutxo project, which needs to dynamically flip NODE_NETWORK). While investigating how dynamic service registration might work, I was confused about how we convey local services to peers. This adds some documentation that hopefully clarifies this process. --- src/net_processing.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/net_processing.cpp') diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 7f2fea5584..93a98974eb 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -415,6 +415,9 @@ static void UpdatePreferredDownload(CNode* node, CNodeState* state) EXCLUSIVE_LO static void PushNodeVersion(CNode *pnode, CConnman* connman, int64_t nTime) { + // Note that pnode->GetLocalServices() is a reflection of the local + // services we were offering when the CNode object was created for this + // peer. ServiceFlags nLocalNodeServices = pnode->GetLocalServices(); uint64_t nonce = pnode->GetLocalNonce(); int nNodeStartingHeight = pnode->GetMyStartingHeight(); -- cgit v1.2.3