29 nSize += (32 + 4 + 1 + 107 + 4);
39 const std::optional<unsigned> &max_datacarrier_bytes,
57 if (!max_datacarrier_bytes ||
58 scriptPubKey.
size() > *max_datacarrier_bytes) {
67 const std::optional<unsigned> &max_datacarrier_bytes,
69 std::string &reason) {
90 reason =
"scriptsig-size";
93 if (!
txin.scriptSig.IsPushOnly()) {
94 reason =
"scriptsig-not-pushonly";
102 if (!
::IsStandard(txout.scriptPubKey, max_datacarrier_bytes,
104 reason =
"scriptpubkey";
111 (!permit_bare_multisig)) {
112 reason =
"bare-multisig";
122 reason =
"multi-op-return";
CCoinsView that adds a memory cache for transactions to another CCoinsView.
Fee rate in satoshis per kilobyte: Amount / kB.
Serialized script, used inside transaction inputs and outputs.
bool IsUnspendable() const
Returns whether the script is guaranteed to fail at execution, regardless of the initial stack.
The basic transaction that is broadcasted on the network and contained in blocks.
static constexpr int32_t MAX_VERSION
const std::vector< CTxOut > vout
unsigned int GetTotalSize() const
Get the total transaction size in bytes.
const std::vector< CTxIn > vin
static constexpr int32_t MIN_VERSION
An input of a transaction.
An output of a transaction.
Amount GetDustThreshold(const CTxOut &txout, const CFeeRate &dustRelayFeeIn)
bool IsStandard(const CScript &scriptPubKey, const std::optional< unsigned > &max_datacarrier_bytes, TxoutType &whichType)
int64_t GetVirtualTransactionInputSize(const CTxIn &txin, int64_t nSigChecks, unsigned int bytes_per_sigCheck)
bool AreInputsStandard(const CTransaction &tx, const CCoinsViewCache &mapInputs, uint32_t flags)
Check transaction inputs to mitigate two potential denial-of-service attacks:
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.
bool IsDust(const CTxOut &txout, const CFeeRate &dustRelayFeeIn)
int64_t GetVirtualTransactionSize(int64_t nSize, int64_t nSigChecks, unsigned int bytes_per_sigCheck)
Compute the virtual transaction size (size, or more if sigChecks are too dense).
static constexpr unsigned int MAX_STANDARD_TX_SIZE
The maximum size for transactions we're willing to relay/mine.
static constexpr unsigned int MAX_TX_IN_SCRIPT_SIG_SIZE
Biggest 'standard' txin is a 15-of-15 P2SH multisig with compressed keys (remember the 520 byte limit...
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
size_t GetSerializeSize(const T &t, int nVersion=0)
TxoutType Solver(const CScript &scriptPubKey, std::vector< std::vector< uint8_t > > &vSolutionsRet)
Parse a scriptPubKey and identify script type for standard scripts.
static constexpr Amount zero() noexcept
static const int PROTOCOL_VERSION
network protocol versioning