net: make V1Transport implicitly use current chainparams

The rest of net.cpp already uses Params() to determine chainparams in many
places (and even V1Transport itself does so in some places).

Since the only chainparams dependency is through the message start characters,
just store those directly in the transport.
This commit is contained in:
Pieter Wuille
2023-07-27 15:35:41 -04:00
parent 0de48fe858
commit fb2c5edb79
3 changed files with 16 additions and 15 deletions

View File

@@ -25,8 +25,8 @@ void initialize_p2p_transport_serialization()
FUZZ_TARGET(p2p_transport_serialization, .init = initialize_p2p_transport_serialization)
{
// Construct transports for both sides, with dummy NodeIds.
V1Transport recv_transport{Params(), NodeId{0}, SER_NETWORK, INIT_PROTO_VERSION};
V1Transport send_transport{Params(), NodeId{1}, SER_NETWORK, INIT_PROTO_VERSION};
V1Transport recv_transport{NodeId{0}, SER_NETWORK, INIT_PROTO_VERSION};
V1Transport send_transport{NodeId{1}, SER_NETWORK, INIT_PROTO_VERSION};
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};