mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
merge bitcoin#23354: Introduce new V4 format addrman
This commit is contained in:
parent
7a97aabfe0
commit
d1a4b14b48
@ -174,7 +174,7 @@ void AddrManImpl::Serialize(Stream& s_) const
|
||||
|
||||
// Increment `lowest_compatible` iff a newly introduced format is incompatible with
|
||||
// the previous one.
|
||||
static constexpr uint8_t lowest_compatible = Format::V3_BIP155;
|
||||
static constexpr uint8_t lowest_compatible = Format::V4_MULTIPORT;
|
||||
s << static_cast<uint8_t>(INCOMPATIBILITY_BASE + lowest_compatible);
|
||||
|
||||
s << nKey;
|
||||
|
@ -159,6 +159,7 @@ private:
|
||||
V1_DETERMINISTIC = 1, //!< for pre-asmap files
|
||||
V2_ASMAP = 2, //!< for files including asmap version
|
||||
V3_BIP155 = 3, //!< same as V2_ASMAP plus addresses are in BIP155 format
|
||||
V4_MULTIPORT = 4, //!< adds support for multiple ports per IP
|
||||
};
|
||||
|
||||
//! The maximum format this software knows it can unserialize. Also, we always serialize
|
||||
@ -166,7 +167,7 @@ private:
|
||||
//! The format (first byte in the serialized stream) can be higher than this and
|
||||
//! still this software may be able to unserialize the file - if the second byte
|
||||
//! (see `lowest_compatible` in `Unserialize()`) is less or equal to this.
|
||||
static constexpr Format FILE_FORMAT = Format::V3_BIP155;
|
||||
static constexpr Format FILE_FORMAT = Format::V4_MULTIPORT;
|
||||
|
||||
//! The initial value of a field that is incremented every time an incompatible format
|
||||
//! change is made (such that old software versions would not be able to parse and
|
||||
|
@ -17,7 +17,7 @@ from test_framework.util import assert_equal
|
||||
def serialize_addrman(
|
||||
*,
|
||||
format=1,
|
||||
lowest_compatible=3,
|
||||
lowest_compatible=4,
|
||||
net_magic="regtest",
|
||||
bucket_key=1,
|
||||
len_new=None,
|
||||
@ -74,7 +74,7 @@ class AddrmanTest(BitcoinTestFramework):
|
||||
expected_msg=init_error(
|
||||
"Unsupported format of addrman database: 1. It is compatible with "
|
||||
"formats >=111, but the maximum supported by this version of "
|
||||
f"{self.config['environment']['PACKAGE_NAME']} is 3.: (.+)"
|
||||
f"{self.config['environment']['PACKAGE_NAME']} is 4.: (.+)"
|
||||
),
|
||||
match=ErrorMatch.FULL_REGEX,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user