MCPcopy Create free account
hub / github.com/ElementsProject/elements / AddressPosition

Class AddressPosition

src/addrman.h:32–54  ·  view source on GitHub ↗

Test-only struct, capturing info about an address in AddrMan */

Source from the content-addressed store, hash-verified

30
31/** Test-only struct, capturing info about an address in AddrMan */
32struct AddressPosition {
33 // Whether the address is in the new or tried table
34 const bool tried;
35
36 // Addresses in the tried table should always have a multiplicity of 1.
37 // Addresses in the new table can have multiplicity between 1 and
38 // ADDRMAN_NEW_BUCKETS_PER_ADDRESS
39 const int multiplicity;
40
41 // If the address is in the new table, the bucket and position are
42 // populated based on the first source who sent the address.
43 // In certain edge cases, this may not be where the address is currently
44 // located.
45 const int bucket;
46 const int position;
47
48 bool operator==(AddressPosition other) {
49 return std::tie(tried, multiplicity, bucket, position) ==
50 std::tie(other.tried, other.multiplicity, other.bucket, other.position);
51 }
52 explicit AddressPosition(bool tried_in, int multiplicity_in, int bucket_in, int position_in)
53 : tried{tried_in}, multiplicity{multiplicity_in}, bucket{bucket_in}, position{position_in} {}
54};
55
56/** Stochastic address manager
57 *

Callers 1

FindAddressEntry_Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected