mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
Merge bitcoin/bitcoin#22696: p2p: log addrman consistency checks
4844b74ba7
p2p: log addrman consistency checks (Jon Atack) Pull request description: This mini-patch picks up #22479 to log addrman consistency checks in the `BCLOG::ADDRMAN` category when they are enabled with the `-checkaddrman=<n>` configuration option for values of n greater than 0. ``` $ ./src/bitcoind -signet -checkaddrman=20 -debug=addrman ... 2021-08-13T11:14:45Z Addrman checks started: new 3352, tried 89, total 3441 2021-08-13T11:14:45Z Addrman checks completed successfully ``` This allows people to - verify the checks are running - see when and how often they are being performed - see the number of new/tried/total addrman entries per check - see the start/end of the checks Thanks to John Newbery for ideas to improve this logging. ACKs for top commit: jnewbery: Code review ACK4844b74ba7
Zero-1729: tACK4844b74ba7
theStack: Concept and code-review ACK4844b74ba7
♟️ Tree-SHA512: 10b51c480d52a753ea8a59dbdd1e2c4f49067e7f4afe59d58426a8fb438f52447fe3a6090fa52132bc382d876927fa338b229c906d85668086f7f8f5bd8ed38a
This commit is contained in:
commit
adf9bcfc37
1 changed files with 3 additions and 0 deletions
|
@ -439,6 +439,8 @@ int CAddrMan::Check_() const
|
|||
if (m_consistency_check_ratio == 0) return 0;
|
||||
if (insecure_rand.randrange(m_consistency_check_ratio) >= 1) return 0;
|
||||
|
||||
LogPrint(BCLog::ADDRMAN, "Addrman checks started: new %i, tried %i, total %u\n", nNew, nTried, vRandom.size());
|
||||
|
||||
std::unordered_set<int> setTried;
|
||||
std::unordered_map<int, int> mapNew;
|
||||
|
||||
|
@ -517,6 +519,7 @@ int CAddrMan::Check_() const
|
|||
if (nKey.IsNull())
|
||||
return -16;
|
||||
|
||||
LogPrint(BCLog::ADDRMAN, "Addrman checks completed successfully\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue