2020-12-31 05:48:25 -03:00
|
|
|
// Copyright (c) 2019-2020 The Bitcoin Core developers
|
2019-10-09 10:14:52 -03:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#include <consensus/validation.h>
|
|
|
|
#include <core_memusage.h>
|
|
|
|
#include <policy/policy.h>
|
|
|
|
#include <primitives/transaction.h>
|
|
|
|
#include <streams.h>
|
|
|
|
#include <test/fuzz/fuzz.h>
|
|
|
|
#include <version.h>
|
|
|
|
|
2020-12-03 12:42:49 -03:00
|
|
|
FUZZ_TARGET(tx_out)
|
2019-10-09 10:14:52 -03:00
|
|
|
{
|
|
|
|
CDataStream ds(buffer, SER_NETWORK, INIT_PROTO_VERSION);
|
|
|
|
CTxOut tx_out;
|
|
|
|
try {
|
|
|
|
int version;
|
|
|
|
ds >> version;
|
|
|
|
ds.SetVersion(version);
|
|
|
|
ds >> tx_out;
|
|
|
|
} catch (const std::ios_base::failure&) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const CFeeRate dust_relay_fee{DUST_RELAY_TX_FEE};
|
|
|
|
(void)GetDustThreshold(tx_out, dust_relay_fee);
|
|
|
|
(void)IsDust(tx_out, dust_relay_fee);
|
|
|
|
(void)RecursiveDynamicUsage(tx_out);
|
|
|
|
|
|
|
|
(void)tx_out.ToString();
|
|
|
|
(void)tx_out.IsNull();
|
|
|
|
tx_out.SetNull();
|
|
|
|
assert(tx_out.IsNull());
|
|
|
|
}
|