aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2019-09-10 13:09:12 -0400
committerJames O'Beirne <james.obeirne@gmail.com>2019-09-11 10:24:44 -0400
commit82e53f37e1bfa6e34eac16b33329d70c3c0127da (patch)
treef65e290eca64080b3e33370f37b26eebcff4c031 /src/net_processing.cpp
parent1985c4efda56b48f6f9c04f39d69268ee8f0b40a (diff)
downloadbitcoin-82e53f37e1bfa6e34eac16b33329d70c3c0127da.tar.xz
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.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp3
1 files changed, 3 insertions, 0 deletions
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();