Bitcoin Core 22.99.0
P2P Digital Currency
tx_out.cpp
Go to the documentation of this file.
1// Copyright (c) 2019-2020 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
6#include <core_memusage.h>
7#include <policy/policy.h>
9#include <streams.h>
10#include <test/fuzz/fuzz.h>
11#include <version.h>
12
14{
16 CTxOut tx_out;
17 try {
18 int version;
19 ds >> version;
20 ds.SetVersion(version);
21 ds >> tx_out;
22 } catch (const std::ios_base::failure&) {
23 return;
24 }
25
26 const CFeeRate dust_relay_fee{DUST_RELAY_TX_FEE};
27 (void)GetDustThreshold(tx_out, dust_relay_fee);
28 (void)IsDust(tx_out, dust_relay_fee);
29 (void)RecursiveDynamicUsage(tx_out);
30
31 (void)tx_out.ToString();
32 (void)tx_out.IsNull();
33 tx_out.SetNull();
34 assert(tx_out.IsNull());
35}
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:205
void SetVersion(int n)
Definition: streams.h:362
Fee rate in satoshis per kilobyte: CAmount / kB.
Definition: feerate.h:30
An output of a transaction.
Definition: transaction.h:129
void SetNull()
Definition: transaction.h:143
bool IsNull() const
Definition: transaction.h:149
std::string ToString() const
Definition: transaction.cpp:55
static size_t RecursiveDynamicUsage(const CScript &script)
Definition: core_memusage.h:12
CAmount GetDustThreshold(const CTxOut &txout, const CFeeRate &dustRelayFeeIn)
Definition: policy.cpp:14
bool IsDust(const CTxOut &txout, const CFeeRate &dustRelayFeeIn)
Definition: policy.cpp:53
static const unsigned int DUST_RELAY_TX_FEE
Min feerate for defining dust.
Definition: policy.h:54
@ SER_NETWORK
Definition: serialize.h:138
FUZZ_TARGET(tx_out)
Definition: tx_out.cpp:13
assert(!tx.IsCoinBase())
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation
Definition: version.h:15