@@ -1531,7 +1531,7 @@ static void RelayAddress(const CAddress& addr, bool fReachable, const CConnman&
1531
1531
assert (nRelayNodes <= best.size ());
1532
1532
1533
1533
auto sortfunc = [&best, &hasher, nRelayNodes](CNode* pnode) {
1534
- if (pnode->IsAddrRelayPeer ()) {
1534
+ if (pnode->RelayAddrsWithConn ()) {
1535
1535
uint64_t hashKey = CSipHasher (hasher).Write (pnode->GetId ()).Finalize ();
1536
1536
for (unsigned int i = 0 ; i < nRelayNodes; i++) {
1537
1537
if (hashKey > best[i].first ) {
@@ -2458,9 +2458,7 @@ void PeerLogicValidation::ProcessMessage(CNode& pfrom, const std::string& msg_ty
2458
2458
UpdatePreferredDownload (pfrom, State (pfrom.GetId ()));
2459
2459
}
2460
2460
2461
- if (!pfrom.IsInboundConn () && pfrom.IsAddrRelayPeer ())
2462
- {
2463
- // Advertise our address
2461
+ if (!pfrom.IsInboundConn () && !pfrom.IsBlockOnlyConn ()) {
2464
2462
if (fListen && !::ChainstateActive ().IsInitialBlockDownload ())
2465
2463
{
2466
2464
CAddress addr = GetLocalAddress (&pfrom.addr , pfrom.GetLocalServices ());
@@ -2479,6 +2477,7 @@ void PeerLogicValidation::ProcessMessage(CNode& pfrom, const std::string& msg_ty
2479
2477
// Get recent addresses
2480
2478
m_connman.PushMessage (&pfrom, CNetMsgMaker (nSendVersion).Make (NetMsgType::GETADDR));
2481
2479
pfrom.fGetAddr = true ;
2480
+
2482
2481
m_connman.MarkAddressGood (pfrom.addr );
2483
2482
}
2484
2483
@@ -2584,7 +2583,7 @@ void PeerLogicValidation::ProcessMessage(CNode& pfrom, const std::string& msg_ty
2584
2583
std::vector<CAddress> vAddr;
2585
2584
vRecv >> vAddr;
2586
2585
2587
- if (!pfrom.IsAddrRelayPeer ()) {
2586
+ if (!pfrom.RelayAddrsWithConn ()) {
2588
2587
return ;
2589
2588
}
2590
2589
if (vAddr.size () > MAX_ADDR_TO_SEND)
@@ -3522,7 +3521,7 @@ void PeerLogicValidation::ProcessMessage(CNode& pfrom, const std::string& msg_ty
3522
3521
LogPrint (BCLog::NET, " Ignoring \" getaddr\" from outbound connection. peer=%d\n " , pfrom.GetId ());
3523
3522
return ;
3524
3523
}
3525
- if (!pfrom.IsAddrRelayPeer ()) {
3524
+ if (!pfrom.RelayAddrsWithConn ()) {
3526
3525
LogPrint (BCLog::NET, " Ignoring \" getaddr\" from block-relay-only connection. peer=%d\n " , pfrom.GetId ());
3527
3526
return ;
3528
3527
}
@@ -4122,15 +4121,15 @@ bool PeerLogicValidation::SendMessages(CNode* pto)
4122
4121
int64_t nNow = GetTimeMicros ();
4123
4122
auto current_time = GetTime<std::chrono::microseconds>();
4124
4123
4125
- if (pto->IsAddrRelayPeer () && !::ChainstateActive ().IsInitialBlockDownload () && pto->m_next_local_addr_send < current_time) {
4124
+ if (pto->RelayAddrsWithConn () && !::ChainstateActive ().IsInitialBlockDownload () && pto->m_next_local_addr_send < current_time) {
4126
4125
AdvertiseLocal (pto);
4127
4126
pto->m_next_local_addr_send = PoissonNextSend (current_time, AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL);
4128
4127
}
4129
4128
4130
4129
//
4131
4130
// Message: addr
4132
4131
//
4133
- if (pto->IsAddrRelayPeer () && pto->m_next_addr_send < current_time) {
4132
+ if (pto->RelayAddrsWithConn () && pto->m_next_addr_send < current_time) {
4134
4133
pto->m_next_addr_send = PoissonNextSend (current_time, AVG_ADDRESS_BROADCAST_INTERVAL);
4135
4134
std::vector<CAddress> vAddr;
4136
4135
vAddr.reserve (pto->vAddrToSend .size ());
0 commit comments