57 for (
int i = 0; i <
num_in; ++i) {
78 for (
int i = 0; i <
num_out; ++i) {
135 std::copy(
vec.begin(),
vec.end(), buffer.begin());
173 std::map<COutPoint, Coin> coins;
183 coins[*outpoint] = *coin;
248 const Coin& coin = inputs.AccessCoin(
tx_in.prevout);
283#if defined _GNU_SOURCE && (defined(__linux__) || defined(__FreeBSD__))
301 if (buf ==
nullptr || size == 0 ||
fuzzed_file->m_fuzzed_data_provider.ConsumeBool()) {
302 return fuzzed_file->m_fuzzed_data_provider.ConsumeBool() ? 0 : -1;
310 return fuzzed_file->m_fuzzed_data_provider.ConsumeBool() ? 0 : -1;
353 return fuzzed_file->m_fuzzed_data_provider.ConsumeIntegralInRange<
int>(-1, 0);
360 return fuzzed_file->m_fuzzed_data_provider.ConsumeIntegralInRange<
int>(-1, 0);
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
static constexpr CAmount MAX_MONEY
No amount larger than this (in satoshi) is valid.
int64_t CAmount
Amount in satoshis (Can be negative)
static constexpr CAmount COIN
The amount of satoshis in one BTC.
#define Assert(val)
Identity function.
CCoinsView that adds a memory cache for transactions to another CCoinsView.
An encapsulated private key.
void Set(const T pbegin, const T pend, bool fCompressedIn)
Initialize using begin and end iterators to byte data.
An outpoint - a combination of a transaction hash and an index n into its vout.
An encapsulated public key.
static constexpr unsigned int COMPRESSED_SIZE
static constexpr unsigned int SIZE
secp256k1:
A hasher class for SHA-256.
void Finalize(unsigned char hash[OUTPUT_SIZE])
CSHA256 & Write(const unsigned char *data, size_t len)
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
static const uint32_t CURRENT_VERSION
An input of a transaction.
static const uint32_t MAX_SEQUENCE_NONFINAL
This is the maximum sequence number that enables both nLockTime and OP_CHECKLOCKTIMEVERIFY (BIP 65).
static const uint32_t SEQUENCE_FINAL
Setting nSequence to this value for every input in a transaction disables nLockTime/IsFinalTx().
CScriptWitness scriptWitness
Only serialized through CTransaction.
bool IsSpent() const
Either this coin never existed (see e.g.
std::vector< T > ConsumeBytes(size_t num_bytes)
T ConsumeIntegralInRange(T min, T max)
T PickValueInArray(const T(&array)[size])
static ssize_t write(void *cookie, const char *buf, size_t size)
FuzzedDataProvider & m_fuzzed_data_provider
static int seek(void *cookie, int64_t *offset, int whence)
static int close(void *cookie)
static ssize_t read(void *cookie, char *buf, size_t size)
static transaction_identifier FromUint256(const uint256 &id)
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
bool AdditionOverflow(const T i, const T j) noexcept
std::vector< unsigned char > ToByteVector(const T &in)
A mutable version of CTransaction.
std::vector< std::vector< unsigned char > > stack
CTxDestination subtype to encode any future Witness version.
NodeSeconds ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
uint32_t ConsumeSequence(FuzzedDataProvider &fuzzed_data_provider) noexcept
CScript ConsumeScript(FuzzedDataProvider &fuzzed_data_provider, const bool maybe_p2wsh) noexcept
CMutableTransaction ConsumeTransaction(FuzzedDataProvider &fuzzed_data_provider, const std::optional< std::vector< Txid > > &prevout_txids, const int max_num_in, const int max_num_out) noexcept
bool ContainsSpentInput(const CTransaction &tx, const CCoinsViewCache &inputs) noexcept
CScriptWitness ConsumeScriptWitness(FuzzedDataProvider &fuzzed_data_provider, const size_t max_stack_elem_size) noexcept
std::vector< uint8_t > ConstructPubKeyBytes(FuzzedDataProvider &fuzzed_data_provider, std::span< const uint8_t > byte_data, const bool compressed) noexcept
CKey ConsumePrivateKey(FuzzedDataProvider &fuzzed_data_provider, std::optional< bool > compressed) noexcept
CTxDestination ConsumeTxDestination(FuzzedDataProvider &fuzzed_data_provider) noexcept
CAmount ConsumeMoney(FuzzedDataProvider &fuzzed_data_provider, const std::optional< CAmount > &max) noexcept
std::map< COutPoint, Coin > ConsumeCoins(FuzzedDataProvider &fuzzed_data_provider) noexcept
std::chrono::seconds ConsumeDuration(FuzzedDataProvider &fuzzed_data_provider, std::chrono::seconds min, std::chrono::seconds max) noexcept
CScriptNum ConsumeScriptNum(FuzzedDataProvider &fuzzed_data_provider) noexcept
auto & PickValue(FuzzedDataProvider &fuzzed_data_provider, Collection &col)
std::vector< B > ConsumeFixedLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const size_t length) noexcept
Returns a byte vector of specified size regardless of the number of remaining bytes available from th...
uint256 ConsumeUInt256(FuzzedDataProvider &fuzzed_data_provider) noexcept
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)
std::vector< B > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
opcodetype ConsumeOpcodeType(FuzzedDataProvider &fuzzed_data_provider) noexcept
void SetFuzzedErrNo(FuzzedDataProvider &fuzzed_data_provider, const std::array< T, size > &errnos)
Sets errno to a value selected from the given std::array errnos.
uint160 ConsumeUInt160(FuzzedDataProvider &fuzzed_data_provider) noexcept
static const std::vector< uint8_t > WITNESS_STACK_ELEM_OP_TRUE
static const CScript P2WSH_OP_TRUE
static constexpr uint32_t MAX_BIP125_RBF_SEQUENCE
std::optional< int64_t > ParseISO8601DateTime(std::string_view str)
std::chrono::time_point< NodeClock, std::chrono::seconds > NodeSeconds
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
FuzzedDataProvider & fuzzed_data_provider