Skip to content

Commit 20e6ea2

Browse files
committed
[addrman] Improve collision logging and address nits
1 parent f71fdda commit 20e6ea2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/addrman.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ void CAddrMan::ResolveCollisions_()
563563

564564
// Give address at least 60 seconds to successfully connect
565565
if (GetAdjustedTime() - info_old.nLastTry > 60) {
566-
LogPrint(BCLog::ADDRMAN, "Swapping %s for %s in tried table\n", info_new.ToString(), info_old.ToString());
566+
LogPrint(BCLog::ADDRMAN, "Replacing %s with %s in tried table\n", info_old.ToString(), info_new.ToString());
567567

568568
// Replaces an existing address already in the tried table with the new address
569569
Good_(info_new, false, GetAdjustedTime());
@@ -573,7 +573,7 @@ void CAddrMan::ResolveCollisions_()
573573
// If the collision hasn't resolved in some reasonable amount of time,
574574
// just evict the old entry -- we must not be able to
575575
// connect to it for some reason.
576-
LogPrint(BCLog::ADDRMAN, "Unable to test; swapping %s for %s in tried table anyway\n", info_new.ToString(), info_old.ToString());
576+
LogPrint(BCLog::ADDRMAN, "Unable to test; replacing %s with %s in tried table anyway\n", info_old.ToString(), info_new.ToString());
577577
Good_(info_new, false, GetAdjustedTime());
578578
erase_collision = true;
579579
}

src/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,12 +1765,12 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
17651765
addr = addrman.Select(fFeeler);
17661766
}
17671767

1768-
// Require outbound connections to be to distinct network groups
1768+
// Require outbound connections, other than feelers, to be to distinct network groups
17691769
if (!fFeeler && setConnected.count(addr.GetGroup())) {
17701770
break;
17711771
}
17721772

1773-
// if we selected an invalid address, restart
1773+
// if we selected an invalid or local address, restart
17741774
if (!addr.IsValid() || IsLocal(addr)) {
17751775
break;
17761776
}

0 commit comments

Comments
 (0)