Skip to content

Commit 40acd6f

Browse files
committed
[move-only] Move constants to test-only header
Review hint: git diff --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
1 parent 7cf41bb commit 40acd6f

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

src/addrman.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,6 @@ static constexpr int32_t DEFAULT_ADDRMAN_CONSISTENCY_CHECKS{0};
5353
* * Several indexes are kept for high performance. Setting m_consistency_check_ratio with the -checkaddrman
5454
* configuration option will introduce (expensive) consistency checks for the entire data structure.
5555
*/
56-
57-
/** Total number of buckets for tried addresses */
58-
static constexpr int32_t ADDRMAN_TRIED_BUCKET_COUNT_LOG2{8};
59-
static constexpr int ADDRMAN_TRIED_BUCKET_COUNT{1 << ADDRMAN_TRIED_BUCKET_COUNT_LOG2};
60-
61-
/** Total number of buckets for new addresses */
62-
static constexpr int32_t ADDRMAN_NEW_BUCKET_COUNT_LOG2{10};
63-
static constexpr int ADDRMAN_NEW_BUCKET_COUNT{1 << ADDRMAN_NEW_BUCKET_COUNT_LOG2};
64-
65-
/** Maximum allowed number of entries in buckets for new and tried addresses */
66-
static constexpr int32_t ADDRMAN_BUCKET_SIZE_LOG2{6};
67-
static constexpr int ADDRMAN_BUCKET_SIZE{1 << ADDRMAN_BUCKET_SIZE_LOG2};
68-
69-
/**
70-
* Stochastical (IP) address manager
71-
*/
7256
class CAddrMan
7357
{
7458
const std::unique_ptr<AddrManImpl> m_impl;

src/addrman_impl.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
#ifndef BITCOIN_ADDRMAN_IMPL_H
66
#define BITCOIN_ADDRMAN_IMPL_H
77

8+
/** Total number of buckets for tried addresses */
9+
static constexpr int32_t ADDRMAN_TRIED_BUCKET_COUNT_LOG2{8};
10+
static constexpr int ADDRMAN_TRIED_BUCKET_COUNT{1 << ADDRMAN_TRIED_BUCKET_COUNT_LOG2};
11+
/** Total number of buckets for new addresses */
12+
static constexpr int32_t ADDRMAN_NEW_BUCKET_COUNT_LOG2{10};
13+
static constexpr int ADDRMAN_NEW_BUCKET_COUNT{1 << ADDRMAN_NEW_BUCKET_COUNT_LOG2};
14+
/** Maximum allowed number of entries in buckets for new and tried addresses */
15+
static constexpr int32_t ADDRMAN_BUCKET_SIZE_LOG2{6};
16+
static constexpr int ADDRMAN_BUCKET_SIZE{1 << ADDRMAN_BUCKET_SIZE_LOG2};
17+
818
/**
919
* Extended statistics about a CAddress
1020
*/

0 commit comments

Comments
 (0)