Bitcoin Core  22.99.0
P2P Digital Currency
tx_in.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 
5 #include <consensus/validation.h>
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 
13 #include <cassert>
14 
16 {
18  CTxIn tx_in;
19  try {
20  int version;
21  ds >> version;
22  ds.SetVersion(version);
23  ds >> tx_in;
24  } catch (const std::ios_base::failure&) {
25  return;
26  }
27 
28  (void)GetTransactionInputWeight(tx_in);
29  (void)GetVirtualTransactionInputSize(tx_in);
30  (void)RecursiveDynamicUsage(tx_in);
31 
32  (void)tx_in.ToString();
33 }
GetVirtualTransactionInputSize
int64_t GetVirtualTransactionInputSize(const CTxIn &txin, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Definition: policy.cpp:290
CTxIn
An input of a transaction.
Definition: transaction.h:65
policy.h
streams.h
transaction.h
validation.h
version.h
RecursiveDynamicUsage
static size_t RecursiveDynamicUsage(const CScript &script)
Definition: core_memusage.h:12
CDataStream::SetVersion
void SetVersion(int n)
Definition: streams.h:362
FUZZ_TARGET
FUZZ_TARGET(tx_in)
Definition: tx_in.cpp:15
core_memusage.h
CTxIn::ToString
std::string ToString() const
Definition: transaction.cpp:33
fuzz.h
GetTransactionInputWeight
static int64_t GetTransactionInputWeight(const CTxIn &txin)
Definition: validation.h:154
CDataStream
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:204
SER_NETWORK
@ SER_NETWORK
Definition: serialize.h:138
INIT_PROTO_VERSION
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation
Definition: version.h:15