Skip to content

Commit 4d83401

Browse files
committed
[addrman] Improve tried table collision logging
1 parent d88f7f8 commit 4d83401

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/addrman.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@ void CAddrMan::Good_(const CService& addr, bool test_before_evict, int64_t nTime
239239

240240
// Will moving this address into tried evict another entry?
241241
if (test_before_evict && (vvTried[tried_bucket][tried_bucket_pos] != -1)) {
242-
LogPrint(BCLog::ADDRMAN, "Collision inserting element into tried table, moving %s to m_tried_collisions=%d\n", addr.ToString(), m_tried_collisions.size());
242+
// Output the entry we'd be colliding with, for debugging purposes
243+
auto colliding_entry = mapInfo.find(vvTried[tried_bucket][tried_bucket_pos]);
244+
LogPrint(BCLog::ADDRMAN, "Collision inserting element into tried table (%s), moving %s to m_tried_collisions=%d\n", colliding_entry != mapInfo.end() ? colliding_entry->second.ToString() : "", addr.ToString(), m_tried_collisions.size());
243245
if (m_tried_collisions.size() < ADDRMAN_SET_TRIED_COLLISION_SIZE) {
244246
m_tried_collisions.insert(nId);
245247
}

0 commit comments

Comments
 (0)