@@ -2459,6 +2459,22 @@ void PeerLogicValidation::ProcessMessage(CNode& pfrom, const std::string& msg_ty
2459
2459
}
2460
2460
2461
2461
if (!pfrom.IsInboundConn () && !pfrom.IsBlockOnlyConn ()) {
2462
+ // For outbound peers, we try to relay our address (so that other
2463
+ // nodes can try to find us more quickly, as we have no guarantee
2464
+ // that an outbound peer is even aware of how to reach us) and do a
2465
+ // one-time address fetch (to help populate/update our addrman). If
2466
+ // we're starting up for the first time, our addrman may be pretty
2467
+ // empty and no one will know who we are, so these mechanisms are
2468
+ // important to help us connect to the network.
2469
+ //
2470
+ // We also update the addrman to record connection success for
2471
+ // these peers (which include OUTBOUND_FULL_RELAY and FEELER
2472
+ // connections) so that addrman will have an up-to-date notion of
2473
+ // which peers are online and available.
2474
+ //
2475
+ // We skip these operations for BLOCK_RELAY peers to avoid
2476
+ // potentially leaking information about our BLOCK_RELAY
2477
+ // connections via the addrman or address relay.
2462
2478
if (fListen && !::ChainstateActive ().IsInitialBlockDownload ())
2463
2479
{
2464
2480
CAddress addr = GetLocalAddress (&pfrom.addr , pfrom.GetLocalServices ());
@@ -2478,6 +2494,8 @@ void PeerLogicValidation::ProcessMessage(CNode& pfrom, const std::string& msg_ty
2478
2494
m_connman.PushMessage (&pfrom, CNetMsgMaker (nSendVersion).Make (NetMsgType::GETADDR));
2479
2495
pfrom.fGetAddr = true ;
2480
2496
2497
+ // Moves address from New to Tried table in Addrman, resolves
2498
+ // tried-table collisions, etc.
2481
2499
m_connman.MarkAddressGood (pfrom.addr );
2482
2500
}
2483
2501
0 commit comments