Merge bitcoin/bitcoin#28729: addrman: log AS only when using asmap
02a4f1a385addrman: log AS only when using asmap (brunoerg) Pull request description: This PR changes the log to just print the ASN when using asmap, same logic presented in other logs: https://github.com/bitcoin/bitcoin/blob/afa081a39bde77d3959aa35b6e6c75a2fe988d68/src/net_processing.cpp#L3552-L3556 https://github.com/bitcoin/bitcoin/blob/afa081a39bde77d3959aa35b6e6c75a2fe988d68/src/net_processing.cpp#L3598-L3604 ACKs for top commit: naumenkogs: ACK02a4f1a385mzumsande: Code Review ACK02a4f1a385Tree-SHA512: adad5904ab163660d47554b32dc2dc3dfdff8dd64b94e5320ad11706381264d1e338654fa8239430eed4ccbebc8f6670698b4278895794055c37fc4bcefe71bc
This commit is contained in:
2 files changed
+7
-5
No files matched your search
+6
-4
@@ -610,8 +610,9 @@ bool AddrManImpl::AddSingle(const CAddress& addr, const CNetAddr& source, std::c
|
|||||||
ClearNew(nUBucket, nUBucketPos);
|
ClearNew(nUBucket, nUBucketPos);
|
||||||
pinfo->nRefCount++;
|
pinfo->nRefCount++;
|
||||||
vvNew[nUBucket][nUBucketPos] = nId;
|
vvNew[nUBucket][nUBucketPos] = nId;
|
||||||
LogPrint(BCLog::ADDRMAN, "Added %s mapped to AS%i to new[%i][%i]\n",
|
const auto mapped_as{m_netgroupman.GetMappedAS(addr)};
|
||||||
addr.ToStringAddrPort(), m_netgroupman.GetMappedAS(addr), nUBucket, nUBucketPos);
|
LogPrint(BCLog::ADDRMAN, "Added %s%s to new[%i][%i]\n",
|
||||||
|
addr.ToStringAddrPort(), (mapped_as ? strprintf(" mapped to AS%i", mapped_as) : ""), nUBucket, nUBucketPos);
|
||||||
} else {
|
} else {
|
||||||
if (pinfo->nRefCount == 0) {
|
if (pinfo->nRefCount == 0) {
|
||||||
Delete(nId);
|
Delete(nId);
|
||||||
@@ -669,8 +670,9 @@ bool AddrManImpl::Good_(const CService& addr, bool test_before_evict, NodeSecond
|
|||||||
} else {
|
} else {
|
||||||
// move nId to the tried tables
|
// move nId to the tried tables
|
||||||
MakeTried(info, nId);
|
MakeTried(info, nId);
|
||||||
LogPrint(BCLog::ADDRMAN, "Moved %s mapped to AS%i to tried[%i][%i]\n",
|
const auto mapped_as{m_netgroupman.GetMappedAS(addr)};
|
||||||
addr.ToStringAddrPort(), m_netgroupman.GetMappedAS(addr), tried_bucket, tried_bucket_pos);
|
LogPrint(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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ class InvalidMessagesTest(BitcoinTestFramework):
|
|||||||
self.test_addrv2('unrecognized network',
|
self.test_addrv2('unrecognized network',
|
||||||
[
|
[
|
||||||
'received: addrv2 (25 bytes)',
|
'received: addrv2 (25 bytes)',
|
||||||
'9.9.9.9:8333 mapped',
|
'9.9.9.9:8333',
|
||||||
'Added 1 addresses',
|
'Added 1 addresses',
|
||||||
],
|
],
|
||||||
bytes.fromhex(
|
bytes.fromhex(
|
||||||
|
|||||||
Reference in new issue
Block a user