aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-01-16 13:29:17 -0500
committerAva Chow <github@achow101.com>2024-01-16 13:35:45 -0500
commit5711da65885c85ca0dbad2a01e1ef7d6f55e4261 (patch)
tree4bdaf93ac0a464dbde1aa0c819584d0c5ff31278 /src/net_processing.cpp
parent27d935f58b9ef5560ddd5914547a6de7884c41e6 (diff)
parent74ebd4d1359edce82a134dfcd3da9840f8d206e2 (diff)
downloadbitcoin-5711da65885c85ca0dbad2a01e1ef7d6f55e4261.tar.xz
Merge bitcoin/bitcoin#29213: doc, test: test and explain service flag handling
74ebd4d1359edce82a134dfcd3da9840f8d206e2 doc, test: Test and explain service flag handling (Martin Zumsande) Pull request description: Service flags received from the peer-to-peer network are handled differently, depending on how we receive them. If received directly from an outbound peer the flags belong to, they replace existing flags. If received via gossip relay (so that anyone could send them), new flags are added, but existing ones but cannot be overwritten. Document that and add test coverage for it. ACKs for top commit: achow101: ACK 74ebd4d1359edce82a134dfcd3da9840f8d206e2 furszy: ACK 74ebd4d1359edce82a134dfcd3da9840f8d206e2 brunoerg: utACK 74ebd4d1359edce82a134dfcd3da9840f8d206e2 Tree-SHA512: 604adc3304b8e3cb1a10dfd017025c10b029bebd3ef533f96bcb5856fee5d4396a9aed4949908b8e7ef267ad21320d1814dd80f88426330c5c9c2c529c497591
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 683a7aa10f..80cf610a0d 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -3376,6 +3376,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
vRecv >> CNetAddr::V1(addrMe);
if (!pfrom.IsInboundConn())
{
+ // Overwrites potentially existing services. In contrast to this,
+ // unvalidated services received via gossip relay in ADDR/ADDRV2
+ // messages are only ever added but cannot replace existing ones.
m_addrman.SetServices(pfrom.addr, nServices);
}
if (pfrom.ExpectServicesFromConn() && !HasAllDesirableServiceFlags(nServices))