mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
Use ParamsWrapper for witness serialization
This commit is contained in:
@@ -249,13 +249,13 @@ std::string ConsumeScalarRPCArgument(FuzzedDataProvider& fuzzed_data_provider, b
|
||||
},
|
||||
[&] {
|
||||
// hex encoded block
|
||||
std::optional<CBlock> opt_block = ConsumeDeserializable<CBlock>(fuzzed_data_provider);
|
||||
std::optional<CBlock> opt_block = ConsumeDeserializable<CBlock>(fuzzed_data_provider, TX_WITH_WITNESS);
|
||||
if (!opt_block) {
|
||||
good_data = false;
|
||||
return;
|
||||
}
|
||||
CDataStream data_stream{SER_NETWORK, PROTOCOL_VERSION};
|
||||
data_stream << *opt_block;
|
||||
data_stream << TX_WITH_WITNESS(*opt_block);
|
||||
r = HexStr(data_stream);
|
||||
},
|
||||
[&] {
|
||||
@@ -271,13 +271,14 @@ std::string ConsumeScalarRPCArgument(FuzzedDataProvider& fuzzed_data_provider, b
|
||||
},
|
||||
[&] {
|
||||
// hex encoded tx
|
||||
std::optional<CMutableTransaction> opt_tx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider);
|
||||
std::optional<CMutableTransaction> opt_tx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider, TX_WITH_WITNESS);
|
||||
if (!opt_tx) {
|
||||
good_data = false;
|
||||
return;
|
||||
}
|
||||
CDataStream data_stream{SER_NETWORK, fuzzed_data_provider.ConsumeBool() ? PROTOCOL_VERSION : (PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS)};
|
||||
data_stream << *opt_tx;
|
||||
DataStream data_stream;
|
||||
auto allow_witness = (fuzzed_data_provider.ConsumeBool() ? TX_WITH_WITNESS : TX_NO_WITNESS);
|
||||
data_stream << allow_witness(*opt_tx);
|
||||
r = HexStr(data_stream);
|
||||
},
|
||||
[&] {
|
||||
|
||||
Reference in New Issue
Block a user