29 nSize += (32 + 4 + 1 + 107 + 4);
31 return 3 * dustRelayFeeIn.
GetFee(nSize);
39 std::vector<std::vector<uint8_t>> vSolutions;
40 whichType =
Solver(scriptPubKey, vSolutions);
45 uint8_t m = vSolutions.front()[0];
46 uint8_t n = vSolutions.back()[0];
59 unsigned nMaxDatacarrierBytes =
61 if (scriptPubKey.
size() > nMaxDatacarrierBytes) {
70 const CFeeRate &dust_relay_fee, std::string &reason) {
88 reason =
"scriptsig-size";
92 reason =
"scriptsig-not-pushonly";
97 unsigned int nDataOut = 0;
101 reason =
"scriptpubkey";
108 (!permit_bare_multisig)) {
109 reason =
"bare-multisig";
111 }
else if (
IsDust(txout, dust_relay_fee)) {
119 reason =
"multi-op-return";
152 std::vector<std::vector<uint8_t>> vSolutions;
163 unsigned int bytes_per_sigCheck) {
164 return std::max(nSize,
nSigChecks * bytes_per_sigCheck);
168 unsigned int bytes_per_sigCheck) {
174 unsigned int bytes_per_sigCheck) {
int64_t GetIntArg(const std::string &strArg, int64_t nDefault) const
Return integer argument or default value.
CCoinsView that adds a memory cache for transactions to another CCoinsView.
const Coin & AccessCoin(const COutPoint &output) const
Return a reference to Coin in the cache, or coinEmpty if not found.
Fee rate in satoshis per kilobyte: Amount / kB.
Amount GetFee(size_t nBytes) const
Return the fee in satoshis for the given size in bytes.
Serialized script, used inside transaction inputs and outputs.
bool IsPushOnly(const_iterator pc) const
Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical).
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 const int32_t MAX_STANDARD_VERSION
const std::vector< CTxOut > vout
unsigned int GetTotalSize() const
Get the total transaction size in bytes.
const std::vector< CTxIn > vin
An input of a transaction.
An output of a transaction.
Amount GetDustThreshold(const CTxOut &txout, const CFeeRate &dustRelayFeeIn)
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, bool permit_bare_multisig, const CFeeRate &dust_relay_fee, std::string &reason)
Check for standard transaction types.
bool IsStandard(const CScript &scriptPubKey, TxoutType &whichType)
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 const 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...
static const unsigned int MAX_STANDARD_TX_SIZE
The maximum size for transactions we're willing to relay/mine.
size_t GetSerializeSize(const T &t, int nVersion=0)
bool fAcceptDatacarrier
A data carrying output is an unspendable output containing data.
TxoutType Solver(const CScript &scriptPubKey, std::vector< std::vector< uint8_t >> &vSolutionsRet)
Parse a scriptPubKey and identify script type for standard scripts.
static const unsigned int MAX_OP_RETURN_RELAY
Default setting for nMaxDatacarrierBytes.
static constexpr Amount zero()
static const int PROTOCOL_VERSION
network protocol versioning