Bitcoin Core  22.99.0
P2P Digital Currency
addrman.cpp
Go to the documentation of this file.
1 // Copyright (c) 2020-2021 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <addrdb.h>
6 #include <addrman.h>
7 #include <addrman_impl.h>
8 #include <chainparams.h>
9 #include <merkleblock.h>
10 #include <random.h>
12 #include <test/fuzz/fuzz.h>
13 #include <test/fuzz/util.h>
14 #include <test/util/setup_common.h>
15 #include <time.h>
16 #include <util/asmap.h>
17 #include <util/system.h>
18 
19 #include <cassert>
20 #include <cstdint>
21 #include <optional>
22 #include <string>
23 #include <vector>
24 
25 namespace {
26 const BasicTestingSetup* g_setup;
27 
28 int32_t GetCheckRatio()
29 {
30  return std::clamp<int32_t>(g_setup->m_node.args->GetIntArg("-checkaddrman", 0), 0, 1000000);
31 }
32 } // namespace
33 
35 {
36  static const auto testing_setup = MakeNoLogFileContext<>(CBaseChainParams::REGTEST);
37  g_setup = testing_setup.get();
38 }
39 
40 FUZZ_TARGET_INIT(data_stream_addr_man, initialize_addrman)
41 {
42  FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
43  CDataStream data_stream = ConsumeDataStream(fuzzed_data_provider);
44  AddrMan addr_man{/*asmap=*/std::vector<bool>(), /*deterministic=*/false, GetCheckRatio()};
45  try {
46  ReadFromStream(addr_man, data_stream);
47  } catch (const std::exception&) {
48  }
49 }
50 
54 CNetAddr RandAddr(FuzzedDataProvider& fuzzed_data_provider, FastRandomContext& fast_random_context)
55 {
56  CNetAddr addr;
57  if (fuzzed_data_provider.remaining_bytes() > 1 && fuzzed_data_provider.ConsumeBool()) {
58  addr = ConsumeNetAddr(fuzzed_data_provider);
59  } else {
60  // The networks [1..6] correspond to CNetAddr::BIP155Network (private).
61  static const std::map<uint8_t, uint8_t> net_len_map = {{1, ADDR_IPV4_SIZE},
62  {2, ADDR_IPV6_SIZE},
63  {4, ADDR_TORV3_SIZE},
64  {5, ADDR_I2P_SIZE},
65  {6, ADDR_CJDNS_SIZE}};
66  uint8_t net = fast_random_context.randrange(5) + 1; // [1..5]
67  if (net == 3) {
68  net = 6;
69  }
70 
72 
73  s << net;
74  s << fast_random_context.randbytes(net_len_map.at(net));
75 
76  s >> addr;
77  }
78 
79  // Return a dummy IPv4 5.5.5.5 if we generated an invalid address.
80  if (!addr.IsValid()) {
81  in_addr v4_addr = {};
82  v4_addr.s_addr = 0x05050505;
83  addr = CNetAddr{v4_addr};
84  }
85 
86  return addr;
87 }
88 
90 void FillAddrman(AddrMan& addrman, FuzzedDataProvider& fuzzed_data_provider)
91 {
92  // Add a fraction of the addresses to the "tried" table.
93  // 0, 1, 2, 3 corresponding to 0%, 100%, 50%, 33%
94  const size_t n = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 3);
95 
96  const size_t num_sources = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 50);
97  CNetAddr prev_source;
98  // Generate a FastRandomContext seed to use inside the loops instead of
99  // fuzzed_data_provider. When fuzzed_data_provider is exhausted it
100  // just returns 0.
101  FastRandomContext fast_random_context{ConsumeUInt256(fuzzed_data_provider)};
102  for (size_t i = 0; i < num_sources; ++i) {
103  const auto source = RandAddr(fuzzed_data_provider, fast_random_context);
104  const size_t num_addresses = fast_random_context.randrange(500) + 1; // [1..500]
105 
106  for (size_t j = 0; j < num_addresses; ++j) {
107  const auto addr = CAddress{CService{RandAddr(fuzzed_data_provider, fast_random_context), 8333}, NODE_NETWORK};
108  const auto time_penalty = fast_random_context.randrange(100000001);
109  addrman.Add({addr}, source, time_penalty);
110 
111  if (n > 0 && addrman.size() % n == 0) {
112  addrman.Good(addr, GetTime());
113  }
114 
115  // Add 10% of the addresses from more than one source.
116  if (fast_random_context.randrange(10) == 0 && prev_source.IsValid()) {
117  addrman.Add({addr}, prev_source, time_penalty);
118  }
119  }
120  prev_source = source;
121  }
122 }
123 
125 {
126 public:
127  explicit AddrManDeterministic(std::vector<bool> asmap, FuzzedDataProvider& fuzzed_data_provider)
128  : AddrMan{std::move(asmap), /*deterministic=*/true, GetCheckRatio()}
129  {
130  WITH_LOCK(m_impl->cs, m_impl->insecure_rand = FastRandomContext{ConsumeUInt256(fuzzed_data_provider)});
131  }
132 
140  bool operator==(const AddrManDeterministic& other)
141  {
142  LOCK2(m_impl->cs, other.m_impl->cs);
143 
144  if (m_impl->mapInfo.size() != other.m_impl->mapInfo.size() || m_impl->nNew != other.m_impl->nNew ||
145  m_impl->nTried != other.m_impl->nTried) {
146  return false;
147  }
148 
149  // Check that all values in `mapInfo` are equal to all values in `other.mapInfo`.
150  // Keys may be different.
151 
152  auto addrinfo_hasher = [](const AddrInfo& a) {
153  CSipHasher hasher(0, 0);
154  auto addr_key = a.GetKey();
155  auto source_key = a.source.GetAddrBytes();
156  hasher.Write(a.nLastSuccess);
157  hasher.Write(a.nAttempts);
158  hasher.Write(a.nRefCount);
159  hasher.Write(a.fInTried);
160  hasher.Write(a.GetNetwork());
161  hasher.Write(a.source.GetNetwork());
162  hasher.Write(addr_key.size());
163  hasher.Write(source_key.size());
164  hasher.Write(addr_key.data(), addr_key.size());
165  hasher.Write(source_key.data(), source_key.size());
166  return (size_t)hasher.Finalize();
167  };
168 
169  auto addrinfo_eq = [](const AddrInfo& lhs, const AddrInfo& rhs) {
170  return std::tie(static_cast<const CService&>(lhs), lhs.source, lhs.nLastSuccess, lhs.nAttempts, lhs.nRefCount, lhs.fInTried) ==
171  std::tie(static_cast<const CService&>(rhs), rhs.source, rhs.nLastSuccess, rhs.nAttempts, rhs.nRefCount, rhs.fInTried);
172  };
173 
174  using Addresses = std::unordered_set<AddrInfo, decltype(addrinfo_hasher), decltype(addrinfo_eq)>;
175 
176  const size_t num_addresses{m_impl->mapInfo.size()};
177 
178  Addresses addresses{num_addresses, addrinfo_hasher, addrinfo_eq};
179  for (const auto& [id, addr] : m_impl->mapInfo) {
180  addresses.insert(addr);
181  }
182 
183  Addresses other_addresses{num_addresses, addrinfo_hasher, addrinfo_eq};
184  for (const auto& [id, addr] : other.m_impl->mapInfo) {
185  other_addresses.insert(addr);
186  }
187 
188  if (addresses != other_addresses) {
189  return false;
190  }
191 
192  auto IdsReferToSameAddress = [&](int id, int other_id) EXCLUSIVE_LOCKS_REQUIRED(m_impl->cs, other.m_impl->cs) {
193  if (id == -1 && other_id == -1) {
194  return true;
195  }
196  if ((id == -1 && other_id != -1) || (id != -1 && other_id == -1)) {
197  return false;
198  }
199  return m_impl->mapInfo.at(id) == other.m_impl->mapInfo.at(other_id);
200  };
201 
202  // Check that `vvNew` contains the same addresses as `other.vvNew`. Notice - `vvNew[i][j]`
203  // contains just an id and the address is to be found in `mapInfo.at(id)`. The ids
204  // themselves may differ between `vvNew` and `other.vvNew`.
205  for (size_t i = 0; i < ADDRMAN_NEW_BUCKET_COUNT; ++i) {
206  for (size_t j = 0; j < ADDRMAN_BUCKET_SIZE; ++j) {
207  if (!IdsReferToSameAddress(m_impl->vvNew[i][j], other.m_impl->vvNew[i][j])) {
208  return false;
209  }
210  }
211  }
212 
213  // Same for `vvTried`.
214  for (size_t i = 0; i < ADDRMAN_TRIED_BUCKET_COUNT; ++i) {
215  for (size_t j = 0; j < ADDRMAN_BUCKET_SIZE; ++j) {
216  if (!IdsReferToSameAddress(m_impl->vvTried[i][j], other.m_impl->vvTried[i][j])) {
217  return false;
218  }
219  }
220  }
221 
222  return true;
223  }
224 };
225 
226 [[nodiscard]] inline std::vector<bool> ConsumeAsmap(FuzzedDataProvider& fuzzed_data_provider) noexcept
227 {
228  std::vector<bool> asmap = ConsumeRandomLengthBitVector(fuzzed_data_provider);
229  if (!SanityCheckASMap(asmap, 128)) asmap.clear();
230  return asmap;
231 }
232 
234 {
235  FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
236  SetMockTime(ConsumeTime(fuzzed_data_provider));
237  std::vector<bool> asmap = ConsumeAsmap(fuzzed_data_provider);
238  auto addr_man_ptr = std::make_unique<AddrManDeterministic>(asmap, fuzzed_data_provider);
239  if (fuzzed_data_provider.ConsumeBool()) {
240  const std::vector<uint8_t> serialized_data{ConsumeRandomLengthByteVector(fuzzed_data_provider)};
241  CDataStream ds(serialized_data, SER_DISK, INIT_PROTO_VERSION);
242  const auto ser_version{fuzzed_data_provider.ConsumeIntegral<int32_t>()};
243  ds.SetVersion(ser_version);
244  try {
245  ds >> *addr_man_ptr;
246  } catch (const std::ios_base::failure&) {
247  addr_man_ptr = std::make_unique<AddrManDeterministic>(asmap, fuzzed_data_provider);
248  }
249  }
250  AddrManDeterministic& addr_man = *addr_man_ptr;
251  LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10000) {
252  CallOneOf(
253  fuzzed_data_provider,
254  [&] {
255  addr_man.ResolveCollisions();
256  },
257  [&] {
258  (void)addr_man.SelectTriedCollision();
259  },
260  [&] {
261  std::vector<CAddress> addresses;
262  LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10000) {
263  const std::optional<CAddress> opt_address = ConsumeDeserializable<CAddress>(fuzzed_data_provider);
264  if (!opt_address) {
265  break;
266  }
267  addresses.push_back(*opt_address);
268  }
269  const std::optional<CNetAddr> opt_net_addr = ConsumeDeserializable<CNetAddr>(fuzzed_data_provider);
270  if (opt_net_addr) {
271  addr_man.Add(addresses, *opt_net_addr, fuzzed_data_provider.ConsumeIntegralInRange<int64_t>(0, 100000000));
272  }
273  },
274  [&] {
275  const std::optional<CService> opt_service = ConsumeDeserializable<CService>(fuzzed_data_provider);
276  if (opt_service) {
277  addr_man.Good(*opt_service, ConsumeTime(fuzzed_data_provider));
278  }
279  },
280  [&] {
281  const std::optional<CService> opt_service = ConsumeDeserializable<CService>(fuzzed_data_provider);
282  if (opt_service) {
283  addr_man.Attempt(*opt_service, fuzzed_data_provider.ConsumeBool(), ConsumeTime(fuzzed_data_provider));
284  }
285  },
286  [&] {
287  const std::optional<CService> opt_service = ConsumeDeserializable<CService>(fuzzed_data_provider);
288  if (opt_service) {
289  addr_man.Connected(*opt_service, ConsumeTime(fuzzed_data_provider));
290  }
291  },
292  [&] {
293  const std::optional<CService> opt_service = ConsumeDeserializable<CService>(fuzzed_data_provider);
294  if (opt_service) {
295  addr_man.SetServices(*opt_service, ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS));
296  }
297  });
298  }
299  const AddrMan& const_addr_man{addr_man};
300  (void)const_addr_man.GetAddr(
301  /*max_addresses=*/fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096),
302  /*max_pct=*/fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096),
303  /*network=*/std::nullopt);
304  (void)const_addr_man.Select(fuzzed_data_provider.ConsumeBool());
305  (void)const_addr_man.size();
307  data_stream << const_addr_man;
308 }
309 
310 // Check that serialize followed by unserialize produces the same addrman.
312 {
313  FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
314  SetMockTime(ConsumeTime(fuzzed_data_provider));
315 
316  std::vector<bool> asmap = ConsumeAsmap(fuzzed_data_provider);
317  AddrManDeterministic addr_man1{asmap, fuzzed_data_provider};
318  AddrManDeterministic addr_man2{asmap, fuzzed_data_provider};
319 
321 
322  FillAddrman(addr_man1, fuzzed_data_provider);
323  data_stream << addr_man1;
324  data_stream >> addr_man2;
325  assert(addr_man1 == addr_man2);
326 }
ADDRV2_FORMAT
static constexpr int ADDRV2_FORMAT
A flag that is ORed into the protocol version to designate that addresses should be serialized in (un...
Definition: netaddress.h:34
ConsumeUInt256
uint256 ConsumeUInt256(FuzzedDataProvider &fuzzed_data_provider) noexcept
Definition: util.h:195
LOCK2
#define LOCK2(cs1, cs2)
Definition: sync.h:227
CService
A combination of a network address (CNetAddr) and a (TCP) port.
Definition: netaddress.h:528
merkleblock.h
AddrInfo::nLastSuccess
int64_t nLastSuccess
last successful connection by us
Definition: addrman_impl.h:50
BasicTestingSetup::m_node
node::NodeContext m_node
Definition: setup_common.h:85
assert
assert(!tx.IsCoinBase())
SER_DISK
@ SER_DISK
Definition: serialize.h:132
asmap.h
RandAddr
CNetAddr RandAddr(FuzzedDataProvider &fuzzed_data_provider, FastRandomContext &fast_random_context)
Generate a random address.
Definition: addrman.cpp:54
addrman_impl.h
setup_common.h
AddrInfo::nAttempts
int nAttempts
connection attempts since last successful attempt
Definition: addrman_impl.h:53
CNetAddr
Network address.
Definition: netaddress.h:118
source
const char * source
Definition: rpcconsole.cpp:66
util.h
AddrMan
Stochastic address manager.
Definition: addrman.h:79
AddrMan::size
size_t size() const
Return the number of (unique) addresses in all tables.
Definition: addrman.cpp:1182
GetTime
int64_t GetTime()
DEPRECATED Use either GetTimeSeconds (not mockable) or GetTime<T> (mockable)
Definition: time.cpp:26
FastRandomContext::randbytes
std::vector< unsigned char > randbytes(size_t len)
Generate random bytes.
Definition: random.cpp:623
WITH_LOCK
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
Definition: sync.h:270
ADDRMAN_TRIED_BUCKET_COUNT
static constexpr int ADDRMAN_TRIED_BUCKET_COUNT
Definition: addrman_impl.h:26
AddrInfo
Extended statistics about a CAddress.
Definition: addrman_impl.h:37
ConsumeNetAddr
CNetAddr ConsumeNetAddr(FuzzedDataProvider &fuzzed_data_provider) noexcept
Definition: util.cpp:481
NODE_NETWORK
@ NODE_NETWORK
Definition: protocol.h:277
AddrMan::m_impl
const std::unique_ptr< AddrManImpl > m_impl
Definition: addrman.h:82
chainparams.h
AddrMan::Connected
void Connected(const CService &addr, int64_t nTime=GetAdjustedTime())
We have successfully connected to this peer.
Definition: addrman.cpp:1222
ADDRMAN_BUCKET_SIZE
static constexpr int ADDRMAN_BUCKET_SIZE
Definition: addrman_impl.h:32
CSipHasher
SipHash-2-4.
Definition: siphash.h:13
FillAddrman
void FillAddrman(AddrMan &addrman, FuzzedDataProvider &fuzzed_data_provider)
Fill addrman with lots of addresses from lots of sources.
Definition: addrman.cpp:90
ConsumeRandomLengthBitVector
std::vector< bool > ConsumeRandomLengthBitVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
Definition: util.h:111
ConsumeTime
int64_t ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
Definition: util.cpp:281
addrdb.h
initialize_addrman
void initialize_addrman()
Definition: addrman.cpp:34
random.h
AddrMan::Good
bool Good(const CService &addr, int64_t nTime=GetAdjustedTime())
Mark an address record as accessible and attempt to move it to addrman's tried table.
Definition: addrman.cpp:1192
ADDR_TORV3_SIZE
static constexpr size_t ADDR_TORV3_SIZE
Size of TORv3 address (in bytes).
Definition: netaddress.h:101
AddrMan::Add
bool Add(const std::vector< CAddress > &vAddr, const CNetAddr &source, int64_t nTimePenalty=0)
Attempt to add one or more addresses to addrman's new table.
Definition: addrman.cpp:1187
CallOneOf
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)
Definition: util.h:82
CSipHasher::Finalize
uint64_t Finalize() const
Compute the 64-bit SipHash-2-4 of the data written so far.
Definition: siphash.cpp:76
SetMockTime
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
Definition: time.cpp:101
ConsumeDataStream
CDataStream ConsumeDataStream(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
Definition: util.h:116
CBaseChainParams::REGTEST
static const std::string REGTEST
Definition: chainparamsbase.h:25
ALL_SERVICE_FLAGS
constexpr ServiceFlags ALL_SERVICE_FLAGS[]
Definition: net.h:48
FuzzedDataProvider.h
time.h
ConsumeRandomLengthByteVector
std::vector< uint8_t > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
Definition: util.h:103
CNetAddr::IsValid
bool IsValid() const
Definition: netaddress.cpp:451
id
static NodeId id
Definition: denialofservice_tests.cpp:37
BasicTestingSetup
Basic testing setup.
Definition: setup_common.h:83
AddrInfo::source
CNetAddr source
where knowledge about this address first came from
Definition: addrman_impl.h:47
AddrMan::SelectTriedCollision
std::pair< CAddress, int64_t > SelectTriedCollision()
Randomly select an address in the tried table that another address is attempting to evict.
Definition: addrman.cpp:1207
ConsumeAsmap
std::vector< bool > ConsumeAsmap(FuzzedDataProvider &fuzzed_data_provider) noexcept
Definition: addrman.cpp:226
AddrManDeterministic::AddrManDeterministic
AddrManDeterministic(std::vector< bool > asmap, FuzzedDataProvider &fuzzed_data_provider)
Definition: addrman.cpp:127
LIMITED_WHILE
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
Definition: fuzz.h:18
CDataStream::SetVersion
void SetVersion(int n)
Definition: streams.h:276
AddrMan::Attempt
void Attempt(const CService &addr, bool fCountFailure, int64_t nTime=GetAdjustedTime())
Mark an entry as connection attempted to.
Definition: addrman.cpp:1197
GetCheckRatio
static int32_t GetCheckRatio(const NodeContext &node_ctx)
Definition: addrman_tests.cpp:29
node::NodeContext::args
ArgsManager * args
Definition: context.h:50
FuzzedDataProvider::remaining_bytes
size_t remaining_bytes()
Definition: FuzzedDataProvider.h:84
system.h
CAddress
A CService with information about it as peer.
Definition: protocol.h:358
ADDR_IPV6_SIZE
static constexpr size_t ADDR_IPV6_SIZE
Size of IPv6 address (in bytes).
Definition: netaddress.h:97
ADDR_IPV4_SIZE
static constexpr size_t ADDR_IPV4_SIZE
Size of IPv4 address (in bytes).
Definition: netaddress.h:94
AddrInfo::nRefCount
int nRefCount
reference count in new sets (memory only)
Definition: addrman_impl.h:56
fuzz.h
EXCLUSIVE_LOCKS_REQUIRED
#define EXCLUSIVE_LOCKS_REQUIRED(...)
Definition: threadsafety.h:49
ADDR_I2P_SIZE
static constexpr size_t ADDR_I2P_SIZE
Size of I2P address (in bytes).
Definition: netaddress.h:104
FuzzedDataProvider
Definition: FuzzedDataProvider.h:31
FuzzedDataProvider::ConsumeIntegral
T ConsumeIntegral()
Definition: FuzzedDataProvider.h:194
ADDRMAN_NEW_BUCKET_COUNT
static constexpr int ADDRMAN_NEW_BUCKET_COUNT
Definition: addrman_impl.h:29
ADDR_CJDNS_SIZE
static constexpr size_t ADDR_CJDNS_SIZE
Size of CJDNS address (in bytes).
Definition: netaddress.h:107
FastRandomContext::randrange
uint64_t randrange(uint64_t range) noexcept
Generate a random integer in the range [0..range).
Definition: random.h:202
AddrManDeterministic
Definition: addrman.cpp:124
CDataStream
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:184
addrman.h
ReadFromStream
void ReadFromStream(AddrMan &addr, CDataStream &ssPeers)
Only used by tests.
Definition: addrdb.cpp:180
SER_NETWORK
@ SER_NETWORK
Definition: serialize.h:131
FuzzedDataProvider::ConsumeBool
bool ConsumeBool()
Definition: FuzzedDataProvider.h:288
ConsumeWeakEnum
WeakEnumType ConsumeWeakEnum(FuzzedDataProvider &fuzzed_data_provider, const WeakEnumType(&all_types)[size]) noexcept
Definition: util.h:157
AddrMan::ResolveCollisions
void ResolveCollisions()
See if any to-be-evicted tried table entries have been tested and if so resolve the collisions.
Definition: addrman.cpp:1202
ArgsManager::GetIntArg
int64_t GetIntArg(const std::string &strArg, int64_t nDefault) const
Return integer argument or default value.
Definition: system.cpp:594
AddrManDeterministic::operator==
bool operator==(const AddrManDeterministic &other)
Compare with another AddrMan.
Definition: addrman.cpp:140
AddrInfo::fInTried
bool fInTried
in tried set? (memory only)
Definition: addrman_impl.h:59
FuzzedDataProvider::ConsumeIntegralInRange
T ConsumeIntegralInRange(T min, T max)
Definition: FuzzedDataProvider.h:204
FUZZ_TARGET_INIT
FUZZ_TARGET_INIT(data_stream_addr_man, initialize_addrman)
Definition: addrman.cpp:40
FastRandomContext
Fast randomness source.
Definition: random.h:131
SanityCheckASMap
bool SanityCheckASMap(const std::vector< bool > &asmap, int bits)
Definition: asmap.cpp:130
AddrMan::SetServices
void SetServices(const CService &addr, ServiceFlags nServices)
Update an entry's service bits.
Definition: addrman.cpp:1227
AddrMan::GetAddr
std::vector< CAddress > GetAddr(size_t max_addresses, size_t max_pct, std::optional< Network > network) const
Return all or many randomly selected addresses, optionally by network.
Definition: addrman.cpp:1217
INIT_PROTO_VERSION
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation
Definition: version.h:15
PROTOCOL_VERSION
static const int PROTOCOL_VERSION
network protocol versioning
Definition: version.h:12
CSipHasher::Write
CSipHasher & Write(uint64_t data)
Hash a 64-bit integer worth of data It is treated as if this was the little-endian interpretation of ...
Definition: siphash.cpp:28