40 keystore.
keys.emplace(key_id, privkey);
41 keystore.
pubkeys.emplace(key_id, pubkey);
45 switch (script_type) {
57 std::map<COutPoint, Coin> coins;
58 coins[txSpend.
vin[0].prevout] =
Coin(txCredit.
vout[0], 100,
false);
59 std::map<int, bilingual_str> input_errors;
62 txdata.Init(txSpend, {txCredit.
vout[0]});
69 txSpend.
vin[0].scriptSig,
70 txCredit.
vout[0].scriptPubKey,
71 &txSpend.
vin[0].scriptWitness,
85 std::vector<std::vector<unsigned char>> stack;
87 for (
int i = 0; i < 100; ++i) {
90 for (
int i = 0; i < 1000; ++i) {
93 for (
int i = 0; i < 100; ++i) {
97 auto stack_copy = stack;
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
An encapsulated private key.
CPubKey GetPubKey() const
Compute the public key from a private key.
void Set(const T pbegin, const T pend, bool fCompressedIn)
Initialize using begin and end iterators to byte data.
A reference to a CKey: the Hash160 of its serialized public key.
An encapsulated public key.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
RAII class initializing and deinitializing global state for elliptic curve support.
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
bool EvalScript(std::vector< std::vector< unsigned char > > &stack, const CScript &script, script_verify_flags flags, const BaseSignatureChecker &checker, SigVersion sigversion, ScriptExecutionData &execdata, ScriptError *serror)
bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, const CScriptWitness *witness, script_verify_flags flags, const BaseSignatureChecker &checker, ScriptError *serror)
@ BASE
Bare scripts and BIP16 P2SH-wrapped redeemscripts.
@ ASSERT_FAIL
Abort execution through assertion failure (for consensus code)
static constexpr script_verify_flags STANDARD_SCRIPT_VERIFY_FLAGS
Standard script verification flags that standard transactions will comply with.
void SignTransaction(CMutableTransaction &mtx, const SigningProvider *keystore, const std::map< COutPoint, Coin > &coins, const UniValue &hashType, UniValue &result)
Sign a transaction with the given keystore and previous transactions.
enum ScriptError_t ScriptError
A mutable version of CTransaction.
std::vector< CTxOut > vout
std::map< CKeyID, CPubKey > pubkeys
std::map< CKeyID, CKey > keys
CMutableTransaction BuildSpendingTransaction(const CScript &scriptSig, const CScriptWitness &scriptWitness, const CTransaction &txCredit)
CMutableTransaction BuildCreditingTransaction(const CScript &scriptPubKey, int nValue)
static void VerifyScriptP2TR(benchmark::Bench &bench)
static void VerifyNestedIfScript(benchmark::Bench &bench)
static void VerifyScriptP2WPKH(benchmark::Bench &bench)
static void VerifyScriptBench(benchmark::Bench &bench, ScriptType script_type)
BENCHMARK(VerifyScriptP2WPKH)