@@ -1329,7 +1329,7 @@ static void RelayAddress(const CAddress& addr, bool fReachable, CConnman* connma
13291329 assert (nRelayNodes <= best.size ());
13301330
13311331 auto sortfunc = [&best, &hasher, nRelayNodes](CNode* pnode) {
1332- if (pnode->nVersion >= CADDR_TIME_VERSION) {
1332+ if (pnode->nVersion >= CADDR_TIME_VERSION && pnode-> IsAddrRelayPeer () ) {
13331333 uint64_t hashKey = CSipHasher (hasher).Write (pnode->GetId ()).Finalize ();
13341334 for (unsigned int i = 0 ; i < nRelayNodes; i++) {
13351335 if (hashKey > best[i].first ) {
@@ -2018,7 +2018,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
20182018 UpdatePreferredDownload (pfrom, State (pfrom->GetId ()));
20192019 }
20202020
2021- if (!pfrom->fInbound )
2021+ if (!pfrom->fInbound && pfrom-> IsAddrRelayPeer () )
20222022 {
20232023 // Advertise our address
20242024 if (fListen && !::ChainstateActive ().IsInitialBlockDownload ())
@@ -2134,6 +2134,9 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
21342134 // Don't want addr from older versions unless seeding
21352135 if (pfrom->nVersion < CADDR_TIME_VERSION && connman->GetAddressCount () > 1000 )
21362136 return true ;
2137+ if (!pfrom->IsAddrRelayPeer ()) {
2138+ return true ;
2139+ }
21372140 if (vAddr.size () > 1000 )
21382141 {
21392142 LOCK (cs_main);
@@ -2994,6 +2997,10 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
29942997 LogPrint (BCLog::NET, " Ignoring \" getaddr\" from outbound connection. peer=%d\n " , pfrom->GetId ());
29952998 return true ;
29962999 }
3000+ if (!pfrom->IsAddrRelayPeer ()) {
3001+ LogPrint (BCLog::NET, " Ignoring \" getaddr\" from block-relay-only connection. peer=%d\n " , pfrom->GetId ());
3002+ return true ;
3003+ }
29973004
29983005 // Only send one GetAddr response per connection to reduce resource waste
29993006 // and discourage addr stamping of INV announcements.
@@ -3587,15 +3594,15 @@ bool PeerLogicValidation::SendMessages(CNode* pto)
35873594
35883595 // Address refresh broadcast
35893596 int64_t nNow = GetTimeMicros ();
3590- if (!::ChainstateActive ().IsInitialBlockDownload () && pto->nNextLocalAddrSend < nNow) {
3597+ if (pto-> IsAddrRelayPeer () && !::ChainstateActive ().IsInitialBlockDownload () && pto->nNextLocalAddrSend < nNow) {
35913598 AdvertiseLocal (pto);
35923599 pto->nNextLocalAddrSend = PoissonNextSend (nNow, AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL);
35933600 }
35943601
35953602 //
35963603 // Message: addr
35973604 //
3598- if (pto->nNextAddrSend < nNow) {
3605+ if (pto->IsAddrRelayPeer () && pto-> nNextAddrSend < nNow) {
35993606 pto->nNextAddrSend = PoissonNextSend (nNow, AVG_ADDRESS_BROADCAST_INTERVAL);
36003607 std::vector<CAddress> vAddr;
36013608 vAddr.reserve (pto->vAddrToSend .size ());
0 commit comments