@@ -2407,14 +2407,8 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
2407
2407
// empty and no one will know who we are, so these mechanisms are
2408
2408
// important to help us connect to the network.
2409
2409
//
2410
- // We also update the addrman to record connection success for
2411
- // these peers (which include OUTBOUND_FULL_RELAY and FEELER
2412
- // connections) so that addrman will have an up-to-date notion of
2413
- // which peers are online and available.
2414
- //
2415
- // We skip these operations for BLOCK_RELAY peers to avoid
2416
- // potentially leaking information about our BLOCK_RELAY
2417
- // connections via the addrman or address relay.
2410
+ // We skip this for BLOCK_RELAY peers to avoid potentially leaking
2411
+ // information about our BLOCK_RELAY connections via address relay.
2418
2412
if (fListen && !::ChainstateActive ().IsInitialBlockDownload ())
2419
2413
{
2420
2414
CAddress addr = GetLocalAddress (&pfrom.addr , pfrom.GetLocalServices ());
@@ -2433,9 +2427,23 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
2433
2427
// Get recent addresses
2434
2428
m_connman.PushMessage (&pfrom, CNetMsgMaker (greatest_common_version).Make (NetMsgType::GETADDR));
2435
2429
pfrom.fGetAddr = true ;
2430
+ }
2436
2431
2437
- // Moves address from New to Tried table in Addrman, resolves
2438
- // tried-table collisions, etc.
2432
+ if (!pfrom.IsInboundConn ()) {
2433
+ // For non-inbound connections, we update the addrman to record
2434
+ // connection success so that addrman will have an up-to-date
2435
+ // notion of which peers are online and available.
2436
+ //
2437
+ // While we strive to not leak information about block-relay-only
2438
+ // connections via the addrman, not moving an address to the tried
2439
+ // table is also potentially detrimental because new-table entries
2440
+ // are subject to eviction in the event of addrman collisions. We
2441
+ // mitigate the information-leak by never calling
2442
+ // CAddrMan::Connected() on block-relay-only peers; see
2443
+ // FinalizeNode().
2444
+ //
2445
+ // This moves an address from New to Tried table in Addrman,
2446
+ // resolves tried-table collisions, etc.
2439
2447
m_connman.MarkAddressGood (pfrom.addr );
2440
2448
}
2441
2449
0 commit comments