Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
test
fuzz
tx_out.cpp
Go to the documentation of this file.
1
// Copyright (c) 2019-present The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#include <
consensus/validation.h
>
6
#include <
core_memusage.h
>
7
#include <
policy/feerate.h
>
8
#include <
policy/policy.h
>
9
#include <
primitives/transaction.h
>
10
#include <
streams.h
>
11
#include <
test/fuzz/fuzz.h
>
12
13
FUZZ_TARGET
(tx_out)
14
{
15
CTxOut
tx_out;
16
try
{
17
SpanReader
{buffer} >> tx_out;
18
}
catch
(
const
std::ios_base::failure&) {
19
return
;
20
}
21
22
const
CFeeRate
dust_relay_fee{
DUST_RELAY_TX_FEE
};
23
(void)
GetDustThreshold
(tx_out, dust_relay_fee);
24
(void)
IsDust
(tx_out, dust_relay_fee);
25
(void)
RecursiveDynamicUsage
(tx_out);
26
27
(void)tx_out.
ToString
();
28
(void)tx_out.
IsNull
();
29
tx_out.
SetNull
();
30
assert
(tx_out.
IsNull
());
31
}
CFeeRate
Fee rate in satoshis per virtualbyte: CAmount / vB the feerate is represented internally as FeeFrac.
Definition
feerate.h:32
CTxOut
An output of a transaction.
Definition
transaction.h:140
CTxOut::SetNull
void SetNull()
Definition
transaction.h:154
CTxOut::IsNull
bool IsNull() const
Definition
transaction.h:160
CTxOut::ToString
std::string ToString() const
Definition
transaction.cpp:61
SpanReader
Minimal stream for reading from an existing byte array by std::span.
Definition
streams.h:83
validation.h
core_memusage.h
RecursiveDynamicUsage
static size_t RecursiveDynamicUsage(const CScript &script)
Definition
core_memusage.h:12
feerate.h
fuzz.h
FUZZ_TARGET
#define FUZZ_TARGET(...)
Definition
fuzz.h:35
GetDustThreshold
CAmount GetDustThreshold(const CTxOut &txout, const CFeeRate &dustRelayFeeIn)
Definition
policy.cpp:26
IsDust
bool IsDust(const CTxOut &txout, const CFeeRate &dustRelayFeeIn)
Definition
policy.cpp:65
policy.h
DUST_RELAY_TX_FEE
static constexpr unsigned int DUST_RELAY_TX_FEE
Min feerate for defining dust.
Definition
policy.h:67
transaction.h
streams.h
assert
assert(!tx.IsCoinBase())
Generated on
for Bitcoin Core by
1.17.0