34#include <boost/algorithm/string/classification.hpp>
35#include <boost/algorithm/string/split.hpp>
36#include <boost/test/unit_test.hpp>
40typedef std::vector<unsigned char>
valtype;
71 if (strFlags.empty() || strFlags ==
"NONE")
return 0;
72 unsigned int flags = 0;
73 std::vector<std::string> words;
74 boost::algorithm::split(words, strFlags, boost::algorithm::is_any_of(
","));
76 for (
const std::string& word : words)
79 BOOST_ERROR(
"Bad test: unknown verification flag '" << word <<
"'");
91 standard_flags_missing &= ~(pair.second);
93 return standard_flags_missing == 0;
102 std::map<std::string, unsigned int>::const_iterator it =
mapFlagNames.begin();
104 if (
flags & it->second) {
105 ret += it->first +
",";
109 return ret.substr(0, ret.size() - 1);
116 const std::map<COutPoint, int64_t>& map_prevout_values,
unsigned int flags,
121 for (
unsigned int i = 0; i < tx.
vin.size() &&
tx_valid; ++i) {
123 const CAmount amount = map_prevout_values.count(input.
prevout) ? map_prevout_values.at(input.
prevout) : 0;
128 BOOST_ERROR(
"Bad test: " << strTest);
132 BOOST_CHECK_MESSAGE(
tx_valid, strTest);
138 BOOST_CHECK_MESSAGE(!
tx_valid, strTest);
178 std::set<unsigned int> flags_combos;
180 const unsigned int flags_excluding_one =
TrimFlags(
flags & ~(pair.second));
181 if (
flags != flags_excluding_one) {
182 flags_combos.insert(flags_excluding_one);
192 BOOST_CHECK_MESSAGE(
CheckMapFlagNames(),
"mapFlagNames is missing a script verification flag");
196 for (
unsigned int idx = 0; idx < tests.
size(); idx++) {
198 std::string strTest = test.
write();
199 if (test[0].isArray())
203 BOOST_ERROR(
"Bad test: " << strTest);
207 std::map<COutPoint, CScript> mapprevOutScriptPubKeys;
208 std::map<COutPoint, int64_t> mapprevOutValues;
211 for (
unsigned int inpIdx = 0; inpIdx < inputs.
size(); inpIdx++) {
212 const UniValue& input = inputs[inpIdx];
218 if (vinput.
size() < 3 || vinput.
size() > 4)
224 mapprevOutScriptPubKeys[outpoint] =
ParseScript(vinput[2].get_str());
225 if (vinput.
size() >= 4)
227 mapprevOutValues[outpoint] = vinput[3].
get_int64();
232 BOOST_ERROR(
"Bad test: " << strTest);
236 std::string transaction = test[1].
get_str();
249 BOOST_ERROR(
"Bad test flags: " << strTest);
253 "Tx unexpectedly failed: " << strTest);
259 if (!
CheckTxScripts(tx, mapprevOutScriptPubKeys, mapprevOutValues,
flags, txdata, strTest,
true)) {
260 BOOST_ERROR(
"Tx unexpectedly failed with flag " <<
name <<
" unset: " << strTest);
264 if (!
CheckTxScripts(tx, mapprevOutScriptPubKeys, mapprevOutValues,
flags, txdata, strTest,
true)) {
265 BOOST_ERROR(
"Tx unexpectedly failed with random flags " <<
ToString(
flags) <<
": " << strTest);
271 if (!
CheckTxScripts(tx, mapprevOutScriptPubKeys, mapprevOutValues, ~flags_excluding_one, txdata, strTest,
false)) {
272 BOOST_ERROR(
"Too many flags unset: " << strTest);
284 for (
unsigned int idx = 0; idx < tests.
size(); idx++) {
286 std::string strTest = test.
write();
287 if (test[0].isArray())
291 BOOST_ERROR(
"Bad test: " << strTest);
295 std::map<COutPoint, CScript> mapprevOutScriptPubKeys;
296 std::map<COutPoint, int64_t> mapprevOutValues;
299 for (
unsigned int inpIdx = 0; inpIdx < inputs.
size(); inpIdx++) {
300 const UniValue& input = inputs[inpIdx];
306 if (vinput.
size() < 3 || vinput.
size() > 4)
312 mapprevOutScriptPubKeys[outpoint] =
ParseScript(vinput[2].get_str());
313 if (vinput.
size() >= 4)
315 mapprevOutValues[outpoint] = vinput[3].
get_int64();
320 BOOST_ERROR(
"Bad test: " << strTest);
324 std::string transaction = test[1].
get_str();
330 BOOST_CHECK_MESSAGE(test[2].get_str() ==
"BADTX", strTest);
339 BOOST_ERROR(
"Bad test flags: " << strTest);
344 "Tx unexpectedly passed: " << strTest);
350 if (!
CheckTxScripts(tx, mapprevOutScriptPubKeys, mapprevOutValues,
flags, txdata, strTest,
false)) {
351 BOOST_ERROR(
"Tx unexpectedly passed with flag " <<
name <<
" set: " << strTest);
355 if (!
CheckTxScripts(tx, mapprevOutScriptPubKeys, mapprevOutValues,
flags, txdata, strTest,
false)) {
356 BOOST_ERROR(
"Tx unexpectedly passed with random flags " <<
name <<
": " << strTest);
362 if (!
CheckTxScripts(tx, mapprevOutScriptPubKeys, mapprevOutValues, flags_excluding_one, txdata, strTest,
true)) {
363 BOOST_ERROR(
"Too many flags set: " << strTest);
373 unsigned char ch[] = {0x01, 0x00, 0x00, 0x00, 0x01, 0x6b, 0xff, 0x7f, 0xcd, 0x4f, 0x85, 0x65, 0xef, 0x40, 0x6d, 0xd5, 0xd6, 0x3d, 0x4f, 0xf9, 0x4f, 0x31, 0x8f, 0xe8, 0x20, 0x27, 0xfd, 0x4d, 0xc4, 0x51, 0xb0, 0x44, 0x74, 0x01, 0x9f, 0x74, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x49, 0x30, 0x46, 0x02, 0x21, 0x00, 0xda, 0x0d, 0xc6, 0xae, 0xce, 0xfe, 0x1e, 0x06, 0xef, 0xdf, 0x05, 0x77, 0x37, 0x57, 0xde, 0xb1, 0x68, 0x82, 0x09, 0x30, 0xe3, 0xb0, 0xd0, 0x3f, 0x46, 0xf5, 0xfc, 0xf1, 0x50, 0xbf, 0x99, 0x0c, 0x02, 0x21, 0x00, 0xd2, 0x5b, 0x5c, 0x87, 0x04, 0x00, 0x76, 0xe4, 0xf2, 0x53, 0xf8, 0x26, 0x2e, 0x76, 0x3e, 0x2d, 0xd5, 0x1e, 0x7f, 0xf0, 0xbe, 0x15, 0x77, 0x27, 0xc4, 0xbc, 0x42, 0x80, 0x7f, 0x17, 0xbd, 0x39, 0x01, 0x41, 0x04, 0xe6, 0xc2, 0x6e, 0xf6, 0x7d, 0xc6, 0x10, 0xd2, 0xcd, 0x19, 0x24, 0x84, 0x78, 0x9a, 0x6c, 0xf9, 0xae, 0xa9, 0x93, 0x0b, 0x94, 0x4b, 0x7e, 0x2d, 0xb5, 0x34, 0x2b, 0x9d, 0x9e, 0x5b, 0x9f, 0xf7, 0x9a, 0xff, 0x9a, 0x2e, 0xe1, 0x97, 0x8d, 0xd7, 0xfd, 0x01, 0xdf, 0xc5, 0x22, 0xee, 0x02, 0x28, 0x3d, 0x3b, 0x06, 0xa9, 0xd0, 0x3a, 0xcf, 0x80, 0x96, 0x96, 0x8d, 0x7d, 0xbb, 0x0f, 0x91, 0x78, 0xff, 0xff, 0xff, 0xff, 0x02, 0x8b, 0xa7, 0x94, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xba, 0xde, 0xec, 0xfd, 0xef, 0x05, 0x07, 0x24, 0x7f, 0xc8, 0xf7, 0x42, 0x41, 0xd7, 0x3b, 0xc0, 0x39, 0x97, 0x2d, 0x7b, 0x88, 0xac, 0x40, 0x94, 0xa8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xc1, 0x09, 0x32, 0x48, 0x3f, 0xec, 0x93, 0xed, 0x51, 0xf5, 0xfe, 0x95, 0xe7, 0x25, 0x59, 0xf2, 0xcc, 0x70, 0x43, 0xf9, 0x88, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00};
374 std::vector<unsigned char> vch(ch, ch +
sizeof(ch) -1);
382 tx.
vin.push_back(tx.
vin[0]);
391 std::vector<CMutableTransaction> dummyTransactions =
396 t1.vin[0].prevout.hash = dummyTransactions[0].GetHash();
397 t1.vin[0].prevout.n = 1;
398 t1.vin[0].scriptSig << std::vector<unsigned char>(65, 0);
399 t1.vin[1].prevout.hash = dummyTransactions[1].GetHash();
400 t1.vin[1].prevout.n = 0;
401 t1.vin[1].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);
402 t1.vin[2].prevout.hash = dummyTransactions[1].GetHash();
403 t1.vin[2].prevout.n = 1;
404 t1.vin[2].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);
406 t1.vout[0].nValue = 90*
CENT;
407 t1.vout[0].scriptPubKey <<
OP_1;
416 outputm.
vin.resize(1);
417 outputm.
vin[0].prevout.SetNull();
419 outputm.
vout.resize(1);
420 outputm.
vout[0].nValue = 1;
421 outputm.
vout[0].scriptPubKey = outscript;
425 assert(output->vin.size() == 1);
426 assert(output->vin[0] == outputm.
vin[0]);
427 assert(output->vout.size() == 1);
432 inputm.
vin.resize(1);
433 inputm.
vin[0].prevout.hash = output->GetHash();
434 inputm.
vin[0].prevout.n = 0;
435 inputm.
vout.resize(1);
436 inputm.
vout[0].nValue = 1;
447 assert(input.
vin[0].scriptWitness.stack == inputm.
vin[0].scriptWitness.stack);
464 }
else if (v.size() == 1 && v[0] >= 1 && v[0] <= 16) {
466 }
else if (v.size() == 1 && v[0] == 0x81) {
477 std::vector<valtype> stack;
480 stack.back() = std::vector<unsigned char>(redeemScript.
begin(), redeemScript.
end());
496 std::vector<int> sigHashes;
505 for(uint32_t ij = 0; ij < 4500; ij++) {
506 uint32_t i = mtx.
vin.size();
508 prevId.
SetHex(
"0000000000000000000000000000000000000000000000000000000000000100");
511 mtx.
vin.resize(mtx.
vin.size() + 1);
512 mtx.
vin[i].prevout = outpoint;
515 mtx.
vout.resize(mtx.
vout.size() + 1);
516 mtx.
vout[i].nValue = 1000;
521 for(uint32_t i = 0; i < mtx.
vin.size(); i++) {
522 bool hashSigned =
SignSignature(keystore, scriptPubKey, mtx, i, 1000, sigHashes.at(i % sigHashes.size()));
537 std::vector<Coin> coins;
538 for(uint32_t i = 0; i < mtx.
vin.size(); i++) {
547 for(uint32_t i = 0; i < mtx.
vin.size(); i++) {
548 std::vector<CScriptCheck> vChecks;
551 check.
swap(vChecks.back());
552 control.
Add(vChecks);
555 bool controlCheck = control.
Wait();
572 CKey key1, key2, key3, key1L, key2L;
573 CPubKey pubkey1, pubkey2, pubkey3, pubkey1L, pubkey2L;
588 CScript scriptPubkey1, scriptPubkey2, scriptPubkey1L, scriptPubkey2L, scriptMulti;
593 std::vector<CPubKey> oneandthree;
594 oneandthree.push_back(pubkey1);
595 oneandthree.push_back(pubkey3);
602 CScript destination_script_1, destination_script_2, destination_script_1L, destination_script_2L, destination_script_multi;
755 std::vector<CMutableTransaction> dummyTransactions =
760 t.vin[0].prevout.hash = dummyTransactions[0].GetHash();
761 t.vin[0].prevout.n = 1;
762 t.vin[0].scriptSig << std::vector<unsigned char>(65, 0);
764 t.vout[0].nValue = 90*
CENT;
769 constexpr auto CheckIsStandard = [](
const auto& t) {
774 constexpr auto CheckIsNotStandard = [](
const auto& t,
const std::string& reason_in) {
786 t.vout[0].nValue = nDustThreshold - 1;
787 CheckIsNotStandard(t,
"dust");
789 t.vout[0].nValue = nDustThreshold;
794 CheckIsNotStandard(t,
"version");
797 CheckIsNotStandard(t,
"version");
800 CheckIsNotStandard(t,
"version");
813 t.vout[0].nValue = 674 - 1;
814 CheckIsNotStandard(t,
"dust");
816 t.vout[0].nValue = 674;
821 CheckIsNotStandard(t,
"scriptpubkey");
824 t.vout[0].scriptPubKey =
CScript() <<
OP_RETURN <<
ParseHex(
"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
829 t.vout[0].scriptPubKey =
CScript() <<
OP_RETURN <<
ParseHex(
"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3800");
831 CheckIsNotStandard(t,
"scriptpubkey");
839 t.vout[0].scriptPubKey =
CScript() <<
OP_RETURN <<
OP_RESERVED << -1 << 0 <<
ParseHex(
"01") << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12 << 13 << 14 << 15 << 16;
841 t.vout[0].scriptPubKey =
CScript() <<
OP_RETURN << 0 <<
ParseHex(
"01") << 2 <<
ParseHex(
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
846 CheckIsNotStandard(t,
"scriptpubkey");
855 t.vout[0].scriptPubKey =
CScript() <<
OP_RETURN <<
ParseHex(
"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
856 t.vout[0].nValue = 0;
857 t.vout[1].scriptPubKey =
CScript() <<
OP_RETURN <<
ParseHex(
"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
858 t.vout[1].nValue = 0;
859 CheckIsNotStandard(t,
"multi-op-return");
861 t.vout[0].scriptPubKey =
CScript() <<
OP_RETURN <<
ParseHex(
"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
863 CheckIsNotStandard(t,
"multi-op-return");
867 CheckIsNotStandard(t,
"multi-op-return");
874 t.vin[0].scriptSig =
CScript() << std::vector<unsigned char>(1647, 0);
877 t.vin[0].scriptSig =
CScript() << std::vector<unsigned char>(1648, 0);
878 CheckIsNotStandard(t,
"scriptsig-size");
883 << std::vector<unsigned char>(75, 0)
884 << std::vector<unsigned char>(235, 0)
885 << std::vector<unsigned char>(1234, 0)
889 const std::vector<unsigned char> non_push_ops = {
894 while (pc < t.vin[0].scriptSig.end()) {
897 t.vin[0].scriptSig.GetOp(pc, opcode);
902 int index = prev_pc - t.vin[0].scriptSig.begin();
903 unsigned char orig_op = *prev_pc;
905 for (
auto op : non_push_ops) {
906 t.vin[0].scriptSig[index] = op;
907 CheckIsNotStandard(t,
"scriptsig-not-pushonly");
909 t.vin[0].scriptSig[index] = orig_op;
916 t.vout[0].scriptPubKey =
CScript() << OP_RETURN << std::vector<unsigned char>(19, 0);
926 t.vout[0].scriptPubKey =
CScript() << OP_RETURN << std::vector<unsigned char>(20, 0);
928 CheckIsNotStandard(t,
"tx-size");
934 t.vin[0].scriptSig =
CScript() << std::vector<unsigned char>(65, 0);
938 CheckIsNotStandard(t,
"bare-multisig");
942 t.vout[0].scriptPubKey =
CScript() <<
OP_0 <<
ParseHex(
"ffffffffffffffffffffffffffffffffffffffff");
943 t.vout[0].nValue = 294;
945 t.vout[0].nValue = 293;
946 CheckIsNotStandard(t,
"dust");
949 t.vout[0].scriptPubKey =
CScript() <<
OP_0 <<
ParseHex(
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
950 t.vout[0].nValue = 330;
952 t.vout[0].nValue = 329;
953 CheckIsNotStandard(t,
"dust");
956 for (
int op =
OP_2; op <=
OP_16; op += 1) {
958 t.vout[0].nValue = 240;
961 t.vout[0].nValue = 239;
962 CheckIsNotStandard(t,
"dust");
static constexpr CAmount MAX_MONEY
No amount larger than this (in satoshi) is valid.
int64_t CAmount
Amount in satoshis (Can be negative)
static bool verify_flags(unsigned int flags)
Check that all specified flags are part of the libconsensus interface.
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
#define Assert(val)
Identity function.
RAII-style controller object for a CCheckQueue that guarantees the passed queue is finished before co...
void Add(std::vector< T > &vChecks)
Queue for verifications that have to be performed.
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.
CAmount GetFeePerK() const
Return the fee in satoshis for a size of 1000 bytes.
An encapsulated private key.
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
CPubKey GetPubKey() const
Compute the public key from a private key.
A reference to a CKey: the Hash160 of its serialized public key.
An outpoint - a combination of a transaction hash and an index n into its vout.
An encapsulated public key.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
Closure representing one script verification Note that this stores references to the spending transac...
void swap(CScriptCheck &check)
Serialized script, used inside transaction inputs and outputs.
static opcodetype EncodeOP_N(int n)
The basic transaction that is broadcasted on the network and contained in blocks.
const std::vector< CTxOut > vout
const std::vector< CTxIn > vin
An input of a transaction.
CScriptWitness scriptWitness
Only serialized through CTransaction.
CTxOut out
unspent transaction output
uint32_t nHeight
at which height this containing transaction was included in the active block chain
unsigned int fCoinBase
whether containing transaction was a coinbase
Fillable signing provider that keeps keys in an address->secret map.
virtual bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)
virtual bool AddCScript(const CScript &redeemScript)
A signature creator for transactions.
const std::string & get_str() const
int64_t get_int64() const
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
const UniValue & get_array() const
void SetHex(const char *psz)
void emplace_back(Args &&... args)
void resize(size_type new_size)
static const int CLIENT_VERSION
bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
static int64_t GetTransactionWeight(const CTransaction &tx)
CScript ParseScript(const std::string &s)
BOOST_AUTO_TEST_SUITE_END()
std::vector< unsigned char > valtype
bool EvalScript(std::vector< std::vector< unsigned char > > &stack, const CScript &script, unsigned int flags, const BaseSignatureChecker &checker, SigVersion sigversion, ScriptExecutionData &execdata, ScriptError *serror)
bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, const CScriptWitness *witness, unsigned int flags, const BaseSignatureChecker &checker, ScriptError *serror)
@ BASE
Bare scripts and BIP16 P2SH-wrapped redeemscripts.
@ SCRIPT_VERIFY_NULLDUMMY
@ SCRIPT_VERIFY_SIGPUSHONLY
@ SCRIPT_VERIFY_DISCOURAGE_OP_SUCCESS
@ SCRIPT_VERIFY_CONST_SCRIPTCODE
@ SCRIPT_VERIFY_MINIMALIF
@ SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY
@ SCRIPT_VERIFY_WITNESS_PUBKEYTYPE
@ SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_TAPROOT_VERSION
@ SCRIPT_VERIFY_STRICTENC
@ SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_PUBKEYTYPE
@ SCRIPT_VERIFY_CLEANSTACK
@ SCRIPT_VERIFY_MINIMALDATA
@ SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS
@ SCRIPT_VERIFY_CHECKSEQUENCEVERIFY
@ SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM
@ ASSERT_FAIL
Abort execution through assertion failure (for consensus code)
static unsigned const char tx_valid[]
static unsigned const char tx_invalid[]
#define BOOST_FIXTURE_TEST_SUITE(a, b)
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
bool AreInputsStandard(const CTransaction &tx, const CCoinsViewCache &mapInputs, bool taproot_active)
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.
static const unsigned int DUST_RELAY_TX_FEE
Min feerate for defining dust.
static constexpr unsigned int STANDARD_SCRIPT_VERIFY_FLAGS
Standard script verification flags that standard transactions will comply with.
static const bool DEFAULT_PERMIT_BAREMULTISIG
Default for -permitbaremultisig.
std::shared_ptr< const CTransaction > CTransactionRef
opcodetype
Script opcodes.
std::vector< unsigned char > ToByteVector(const T &in)
std::string ScriptErrorString(const ScriptError serror)
enum ScriptError_t ScriptError
@ SCRIPT_ERR_UNKNOWN_ERROR
static const int64_t values[]
A selection of numbers that do not trigger int64_t overflow when added/subtracted.
constexpr deserialize_type deserialize
static constexpr CAmount CENT
static uint64_t InsecureRandBits(int bits)
bool ProduceSignature(const SigningProvider &provider, const BaseSignatureCreator &creator, const CScript &fromPubKey, SignatureData &sigdata)
Produce a script signature using a generic signature creator.
void UpdateInput(CTxIn &input, const SignatureData &data)
bool SignSignature(const SigningProvider &provider, const CScript &fromPubKey, CMutableTransaction &txTo, unsigned int nIn, const CAmount &amount, int nHashType)
Produce a script signature for a transaction.
SignatureData DataFromTransaction(const CMutableTransaction &tx, unsigned int nIn, const CTxOut &txout)
Extract signature data from a transaction input, and insert it.
const SigningProvider & DUMMY_SIGNING_PROVIDER
CScript GetScriptForMultisig(int nRequired, const std::vector< CPubKey > &keys)
Generate a multisig script.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
static const unsigned int MAX_OP_RETURN_RELAY
Default setting for nMaxDatacarrierBytes.
std::vector< unsigned char > ParseHex(const char *psz)
std::string ToString(const T &t)
Locale-independent version of std::to_string.
A mutable version of CTransaction.
std::vector< CTxOut > vout
void MergeSignatureData(SignatureData sigdata)
bool error(const char *fmt, const Args &... args)
bool IsValidFlagCombination(unsigned flags)
Flags that are not forbidden by an assert in script validation.
SignatureData CombineSignatures(const CMutableTransaction &input1, const CMutableTransaction &input2, const CTransactionRef tx)
static void CheckWithFlag(const CTransactionRef &output, const CMutableTransaction &input, uint32_t flags, bool success)
std::set< unsigned int > ExcludeIndividualFlags(unsigned int flags)
unsigned int FillFlags(unsigned int flags)
UniValue read_json(const std::string &jsondata)
std::vector< unsigned char > valtype
BOOST_AUTO_TEST_CASE(tx_valid)
unsigned int ParseScriptFlags(std::string strFlags)
static void ReplaceRedeemScript(CScript &script, const CScript &redeemScript)
std::string FormatScriptFlags(unsigned int flags)
static void CreateCreditAndSpend(const FillableSigningProvider &keystore, const CScript &outscript, CTransactionRef &output, CMutableTransaction &input, bool success=true)
static CScript PushAll(const std::vector< valtype > &values)
static std::map< std::string, unsigned int > mapFlagNames
bool CheckTxScripts(const CTransaction &tx, const std::map< COutPoint, CScript > &map_prevout_scriptPubKeys, const std::map< COutPoint, int64_t > &map_prevout_values, unsigned int flags, const PrecomputedTransactionData &txdata, const std::string &strTest, bool expect_valid)
unsigned int TrimFlags(unsigned int flags)
std::vector< CMutableTransaction > SetupDummyInputs(FillableSigningProvider &keystoreRet, CCoinsViewCache &coinsRet, const std::array< CAmount, 4 > &nValues)
bool CheckTransaction(const CTransaction &tx, TxValidationState &state)
uint256 uint256S(const char *str)
static CCheckQueue< CScriptCheck > scriptcheckqueue(128)
static const int PROTOCOL_VERSION
network protocol versioning