mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
Remove unused CSubNet serialize code
This commit is contained in:
parent
fa384fdd0b
commit
fa4e6afdae
2 changed files with 0 additions and 29 deletions
|
@ -536,24 +536,6 @@ class CSubNet
|
||||||
friend bool operator==(const CSubNet& a, const CSubNet& b);
|
friend bool operator==(const CSubNet& a, const CSubNet& b);
|
||||||
friend bool operator!=(const CSubNet& a, const CSubNet& b) { return !(a == b); }
|
friend bool operator!=(const CSubNet& a, const CSubNet& b) { return !(a == b); }
|
||||||
friend bool operator<(const CSubNet& a, const CSubNet& b);
|
friend bool operator<(const CSubNet& a, const CSubNet& b);
|
||||||
|
|
||||||
SERIALIZE_METHODS(CSubNet, obj)
|
|
||||||
{
|
|
||||||
READWRITE(obj.network);
|
|
||||||
if (obj.network.IsIPv4()) {
|
|
||||||
// Before commit 102867c587f5f7954232fb8ed8e85cda78bb4d32, CSubNet used the last 4 bytes of netmask
|
|
||||||
// to store the relevant bytes for an IPv4 mask. For compatibility reasons, keep doing so in
|
|
||||||
// serialized form.
|
|
||||||
unsigned char dummy[12] = {0};
|
|
||||||
READWRITE(dummy);
|
|
||||||
READWRITE(MakeSpan(obj.netmask).first(4));
|
|
||||||
} else {
|
|
||||||
READWRITE(obj.netmask);
|
|
||||||
}
|
|
||||||
READWRITE(obj.valid);
|
|
||||||
// Mark invalid if the result doesn't pass sanity checking.
|
|
||||||
SER_READ(obj, if (obj.valid) obj.valid = obj.SanityCheck());
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** A combination of a network address (CNetAddr) and a (TCP) port */
|
/** A combination of a network address (CNetAddr) and a (TCP) port */
|
||||||
|
|
|
@ -142,17 +142,6 @@ FUZZ_TARGET_DESERIALIZE(script_deserialize, {
|
||||||
CScript script;
|
CScript script;
|
||||||
DeserializeFromFuzzingInput(buffer, script);
|
DeserializeFromFuzzingInput(buffer, script);
|
||||||
})
|
})
|
||||||
FUZZ_TARGET_DESERIALIZE(sub_net_deserialize, {
|
|
||||||
CSubNet sub_net_1;
|
|
||||||
DeserializeFromFuzzingInput(buffer, sub_net_1, INIT_PROTO_VERSION);
|
|
||||||
AssertEqualAfterSerializeDeserialize(sub_net_1, INIT_PROTO_VERSION);
|
|
||||||
CSubNet sub_net_2;
|
|
||||||
DeserializeFromFuzzingInput(buffer, sub_net_2, INIT_PROTO_VERSION | ADDRV2_FORMAT);
|
|
||||||
AssertEqualAfterSerializeDeserialize(sub_net_2, INIT_PROTO_VERSION | ADDRV2_FORMAT);
|
|
||||||
CSubNet sub_net_3;
|
|
||||||
DeserializeFromFuzzingInput(buffer, sub_net_3);
|
|
||||||
AssertEqualAfterSerializeDeserialize(sub_net_3, INIT_PROTO_VERSION | ADDRV2_FORMAT);
|
|
||||||
})
|
|
||||||
FUZZ_TARGET_DESERIALIZE(tx_in_deserialize, {
|
FUZZ_TARGET_DESERIALIZE(tx_in_deserialize, {
|
||||||
CTxIn tx_in;
|
CTxIn tx_in;
|
||||||
DeserializeFromFuzzingInput(buffer, tx_in);
|
DeserializeFromFuzzingInput(buffer, tx_in);
|
||||||
|
|
Loading…
Add table
Reference in a new issue