mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Merge d4cc0c6845 into merged_master (Bitcoin PR bitcoin/bitcoin#30750)
This commit is contained in:
commit
a51624f2ed
45 changed files with 367 additions and 375 deletions
|
|
@ -342,7 +342,7 @@ void AddrManImpl::Unserialize(Stream& s_)
|
|||
serialized_asmap_checksum == supplied_asmap_checksum};
|
||||
|
||||
if (!restore_bucketing) {
|
||||
LogPrint(BCLog::ADDRMAN, "Bucketing method was updated, re-bucketing addrman entries from disk\n");
|
||||
LogDebug(BCLog::ADDRMAN, "Bucketing method was updated, re-bucketing addrman entries from disk\n");
|
||||
}
|
||||
|
||||
for (auto bucket_entry : bucket_entries) {
|
||||
|
|
@ -387,7 +387,7 @@ void AddrManImpl::Unserialize(Stream& s_)
|
|||
}
|
||||
}
|
||||
if (nLost + nLostUnk > 0) {
|
||||
LogPrint(BCLog::ADDRMAN, "addrman lost %i new and %i tried addresses due to collisions or invalid addresses\n", nLostUnk, nLost);
|
||||
LogDebug(BCLog::ADDRMAN, "addrman lost %i new and %i tried addresses due to collisions or invalid addresses\n", nLostUnk, nLost);
|
||||
}
|
||||
|
||||
const int check_code{CheckAddrman()};
|
||||
|
|
@ -481,7 +481,7 @@ void AddrManImpl::ClearNew(int nUBucket, int nUBucketPos)
|
|||
assert(infoDelete.nRefCount > 0);
|
||||
infoDelete.nRefCount--;
|
||||
vvNew[nUBucket][nUBucketPos] = -1;
|
||||
LogPrint(BCLog::ADDRMAN, "Removed %s from new[%i][%i]\n", infoDelete.ToStringAddrPort(), nUBucket, nUBucketPos);
|
||||
LogDebug(BCLog::ADDRMAN, "Removed %s from new[%i][%i]\n", infoDelete.ToStringAddrPort(), nUBucket, nUBucketPos);
|
||||
if (infoDelete.nRefCount == 0) {
|
||||
Delete(nIdDelete);
|
||||
}
|
||||
|
|
@ -536,7 +536,7 @@ void AddrManImpl::MakeTried(AddrInfo& info, nid_type nId)
|
|||
vvNew[nUBucket][nUBucketPos] = nIdEvict;
|
||||
nNew++;
|
||||
m_network_counts[infoOld.GetNetwork()].n_new++;
|
||||
LogPrint(BCLog::ADDRMAN, "Moved %s from tried[%i][%i] to new[%i][%i] to make space\n",
|
||||
LogDebug(BCLog::ADDRMAN, "Moved %s from tried[%i][%i] to new[%i][%i] to make space\n",
|
||||
infoOld.ToStringAddrPort(), nKBucket, nKBucketPos, nUBucket, nUBucketPos);
|
||||
}
|
||||
assert(vvTried[nKBucket][nKBucketPos] == -1);
|
||||
|
|
@ -612,7 +612,7 @@ bool AddrManImpl::AddSingle(const CAddress& addr, const CNetAddr& source, std::c
|
|||
pinfo->nRefCount++;
|
||||
vvNew[nUBucket][nUBucketPos] = nId;
|
||||
const auto mapped_as{m_netgroupman.GetMappedAS(addr)};
|
||||
LogPrint(BCLog::ADDRMAN, "Added %s%s to new[%i][%i]\n",
|
||||
LogDebug(BCLog::ADDRMAN, "Added %s%s to new[%i][%i]\n",
|
||||
addr.ToStringAddrPort(), (mapped_as ? strprintf(" mapped to AS%i", mapped_as) : ""), nUBucket, nUBucketPos);
|
||||
} else {
|
||||
if (pinfo->nRefCount == 0) {
|
||||
|
|
@ -663,7 +663,7 @@ bool AddrManImpl::Good_(const CService& addr, bool test_before_evict, NodeSecond
|
|||
}
|
||||
// Output the entry we'd be colliding with, for debugging purposes
|
||||
auto colliding_entry = mapInfo.find(vvTried[tried_bucket][tried_bucket_pos]);
|
||||
LogPrint(BCLog::ADDRMAN, "Collision with %s while attempting to move %s to tried table. Collisions=%d\n",
|
||||
LogDebug(BCLog::ADDRMAN, "Collision with %s while attempting to move %s to tried table. Collisions=%d\n",
|
||||
colliding_entry != mapInfo.end() ? colliding_entry->second.ToStringAddrPort() : "",
|
||||
addr.ToStringAddrPort(),
|
||||
m_tried_collisions.size());
|
||||
|
|
@ -672,7 +672,7 @@ bool AddrManImpl::Good_(const CService& addr, bool test_before_evict, NodeSecond
|
|||
// move nId to the tried tables
|
||||
MakeTried(info, nId);
|
||||
const auto mapped_as{m_netgroupman.GetMappedAS(addr)};
|
||||
LogPrint(BCLog::ADDRMAN, "Moved %s%s to tried[%i][%i]\n",
|
||||
LogDebug(BCLog::ADDRMAN, "Moved %s%s to tried[%i][%i]\n",
|
||||
addr.ToStringAddrPort(), (mapped_as ? strprintf(" mapped to AS%i", mapped_as) : ""), tried_bucket, tried_bucket_pos);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -685,7 +685,7 @@ bool AddrManImpl::Add_(const std::vector<CAddress>& vAddr, const CNetAddr& sourc
|
|||
added += AddSingle(*it, source, time_penalty) ? 1 : 0;
|
||||
}
|
||||
if (added > 0) {
|
||||
LogPrint(BCLog::ADDRMAN, "Added %i addresses (of %i) from %s: %i tried, %i new\n", added, vAddr.size(), source.ToStringAddr(), nTried, nNew);
|
||||
LogDebug(BCLog::ADDRMAN, "Added %i addresses (of %i) from %s: %i tried, %i new\n", added, vAddr.size(), source.ToStringAddr(), nTried, nNew);
|
||||
}
|
||||
return added > 0;
|
||||
}
|
||||
|
|
@ -777,7 +777,7 @@ std::pair<CAddress, NodeSeconds> AddrManImpl::Select_(bool new_only, std::option
|
|||
|
||||
// With probability GetChance() * chance_factor, return the entry.
|
||||
if (insecure_rand.randbits<30>() < chance_factor * info.GetChance() * (1 << 30)) {
|
||||
LogPrint(BCLog::ADDRMAN, "Selected %s from %s\n", info.ToStringAddrPort(), search_tried ? "tried" : "new");
|
||||
LogDebug(BCLog::ADDRMAN, "Selected %s from %s\n", info.ToStringAddrPort(), search_tried ? "tried" : "new");
|
||||
return {info, info.m_last_try};
|
||||
}
|
||||
|
||||
|
|
@ -837,7 +837,7 @@ std::vector<CAddress> AddrManImpl::GetAddr_(size_t max_addresses, size_t max_pct
|
|||
|
||||
addresses.push_back(ai);
|
||||
}
|
||||
LogPrint(BCLog::ADDRMAN, "GetAddr returned %d random addresses\n", addresses.size());
|
||||
LogDebug(BCLog::ADDRMAN, "GetAddr returned %d random addresses\n", addresses.size());
|
||||
return addresses;
|
||||
}
|
||||
|
||||
|
|
@ -935,7 +935,7 @@ void AddrManImpl::ResolveCollisions_()
|
|||
|
||||
// Give address at least 60 seconds to successfully connect
|
||||
if (current_time - info_old.m_last_try > 60s) {
|
||||
LogPrint(BCLog::ADDRMAN, "Replacing %s with %s in tried table\n", info_old.ToStringAddrPort(), info_new.ToStringAddrPort());
|
||||
LogDebug(BCLog::ADDRMAN, "Replacing %s with %s in tried table\n", info_old.ToStringAddrPort(), info_new.ToStringAddrPort());
|
||||
|
||||
// Replaces an existing address already in the tried table with the new address
|
||||
Good_(info_new, false, current_time);
|
||||
|
|
@ -945,7 +945,7 @@ void AddrManImpl::ResolveCollisions_()
|
|||
// If the collision hasn't resolved in some reasonable amount of time,
|
||||
// just evict the old entry -- we must not be able to
|
||||
// connect to it for some reason.
|
||||
LogPrint(BCLog::ADDRMAN, "Unable to test; replacing %s with %s in tried table anyway\n", info_old.ToStringAddrPort(), info_new.ToStringAddrPort());
|
||||
LogDebug(BCLog::ADDRMAN, "Unable to test; replacing %s with %s in tried table anyway\n", info_old.ToStringAddrPort(), info_new.ToStringAddrPort());
|
||||
Good_(info_new, false, current_time);
|
||||
erase_collision = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue