36 }
catch (
const std::ios_base::failure&) {
43 }
catch (
const std::ios_base::failure&) {
48 bool valid_mutable_tx =
true;
56 }
catch (
const std::ios_base::failure&) {
57 valid_mutable_tx =
false;
59 assert(valid_tx == valid_mutable_tx);
72 const bool is_standard_with_permit_bare_multisig =
IsStandardTx(tx,
true, dust_relay_fee, reason);
73 const bool is_standard_without_permit_bare_multisig =
IsStandardTx(tx,
false, dust_relay_fee, reason);
74 if (is_standard_without_permit_bare_multisig) {
75 assert(is_standard_with_permit_bare_multisig);
82 }
catch (
const std::runtime_error&) {
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given chain name.
#define Assert(val)
Identity function.
static const std::string REGTEST
CCoinsView that adds a memory cache for transactions to another CCoinsView.
Abstract view on the open txout dataset.
Double ended buffer combining vector and stream-like interfaces.
Fee rate in satoshis per kilobyte: CAmount / kB.
The basic transaction that is broadcasted on the network and contained in blocks.
const uint256 & GetWitnessHash() const
const uint256 & GetHash() const
std::string ToString() const
unsigned int GetTotalSize() const
Get the total transaction size in bytes, including witness data.
CAmount GetValueOut() const
static const uint256 ZERO
static int64_t GetTransactionWeight(const CTransaction &tx)
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, bool include_hex=true, int serialize_flags=0, const CTxUndo *txundo=nullptr, TxVerbosity verbosity=TxVerbosity::SHOW_DETAILS)
static size_t RecursiveDynamicUsage(const CScript &script)
bool AreInputsStandard(const CTransaction &tx, const CCoinsViewCache &mapInputs, bool taproot_active)
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 IsStandardTx(const CTransaction &tx, bool permit_bare_multisig, const CFeeRate &dust_relay_fee, std::string &reason)
Check for standard transaction types.
bool IsWitnessStandard(const CTransaction &tx, const CCoinsViewCache &mapInputs)
Check if the transaction is over standard P2WSH resources limit: 3600bytes witnessScript size,...
static const unsigned int DUST_RELAY_TX_FEE
Min feerate for defining dust.
constexpr deserialize_type deserialize
A mutable version of CTransaction.
FUZZ_TARGET_INIT(transaction, initialize_transaction)
void initialize_transaction()
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,...
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation