5#include <chainparams.h>
38 }
catch (
const std::ios_base::failure&) {
43 bool valid_mutable_tx =
true;
48 }
catch (
const std::ios_base::failure&) {
49 valid_mutable_tx =
false;
51 assert(valid_tx == valid_mutable_tx);
64 const bool is_standard_with_permit_bare_multisig =
IsStandardTx(tx, std::nullopt,
true, dust_relay_fee, reason);
65 const bool is_standard_without_permit_bare_multisig =
IsStandardTx(tx, std::nullopt,
false, dust_relay_fee, reason);
66 if (is_standard_without_permit_bare_multisig) {
67 assert(is_standard_with_permit_bare_multisig);
74 }
catch (
const std::runtime_error&) {
void SelectParams(const ChainType chain)
Sets the params returned by Params() to those for the given chain type.
#define Assert(val)
Identity function.
CCoinsView that adds a memory cache for transactions to another CCoinsView.
Abstract view on the open txout dataset.
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
The basic transaction that is broadcasted on the network and contained in blocks.
std::string ToString() const
const Wtxid & GetWitnessHash() const LIFETIMEBOUND
unsigned int GetTotalSize() const
Get the total transaction size in bytes, including witness data.
CAmount GetValueOut() const
const Txid & GetHash() const LIFETIMEBOUND
Double ended buffer combining vector and stream-like interfaces.
static const uint256 ZERO
static int32_t GetTransactionWeight(const CTransaction &tx)
std::string EncodeHexTx(const CTransaction &tx)
void TxToUniv(const CTransaction &tx, const uint256 &block_hash, UniValue &entry, bool include_hex=true, const CTxUndo *txundo=nullptr, TxVerbosity verbosity=TxVerbosity::SHOW_DETAILS)
static size_t RecursiveDynamicUsage(const CScript &script)
bool AreInputsStandard(const CTransaction &tx, const CCoinsViewCache &mapInputs)
Check transaction inputs to mitigate two potential denial-of-service attacks:
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Compute the virtual transaction size (weight reinterpreted as bytes).
bool IsWitnessStandard(const CTransaction &tx, const CCoinsViewCache &mapInputs)
Check if the transaction is over standard P2WSH resources limit: 3600bytes witnessScript size,...
bool IsStandardTx(const CTransaction &tx, const std::optional< unsigned > &max_datacarrier_bytes, bool permit_bare_multisig, const CFeeRate &dust_relay_fee, std::string &reason)
Check for standard transaction types.
static constexpr unsigned int DUST_RELAY_TX_FEE
Min feerate for defining dust.
static constexpr TransactionSerParams TX_WITH_WITNESS
constexpr deserialize_type deserialize
A mutable version of CTransaction.
void initialize_transaction()
FUZZ_TARGET(transaction,.init=initialize_transaction)
void SeedRandomStateForTest(SeedRand seedtype)
Seed the global RNG state for testing and log the seed value.
@ ZEROS
Seed with a compile time constant of zeros.
bool CheckTransaction(const CTransaction &tx, TxValidationState &state)
unsigned int GetLegacySigOpCount(const CTransaction &tx)
Auxiliary functions for transaction validation (ideally should not be exposed)
bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
Check if transaction is final and can be included in a block with the specified height and time.
bool SignalsOptInRBF(const CTransaction &tx)
Check whether the sequence numbers on this transaction are signaling opt-in to replace-by-fee,...