![]() |
Bitcoin Core 30.99.0
P2P Digital Currency
|
#include <attributes.h>#include <script/script.h>#include <span.h>#include <string>#include <optional>#include <utility>#include <vector>Go to the source code of this file.
Enumerations | |
| enum class | TxoutType { NONSTANDARD , ANCHOR , PUBKEY , PUBKEYHASH , SCRIPTHASH , MULTISIG , NULL_DATA , WITNESS_V0_SCRIPTHASH , WITNESS_V0_KEYHASH , WITNESS_V1_TAPROOT , WITNESS_UNKNOWN } |
Functions | |
| std::string | GetTxnOutputType (TxoutType t) |
| Get the name of a TxoutType as a string. More... | |
| constexpr bool | IsPushdataOp (opcodetype opcode) |
| TxoutType | Solver (const CScript &scriptPubKey, std::vector< std::vector< unsigned char > > &vSolutionsRet) |
| Parse a scriptPubKey and identify script type for standard scripts. More... | |
| CScript | GetScriptForRawPubKey (const CPubKey &pubkey) |
| Generate a P2PK script for the given pubkey. More... | |
| std::optional< std::pair< int, std::vector< std::span< const unsigned char > > > > | MatchMultiA (const CScript &script LIFETIMEBOUND) |
| Determine if script is a "multi_a" script. More... | |
| CScript | GetScriptForMultisig (int nRequired, const std::vector< CPubKey > &keys) |
| Generate a multisig script. More... | |
|
strong |
Generate a multisig script.
Definition at line 218 of file solver.cpp.
Generate a P2PK script for the given pubkey.
Definition at line 213 of file solver.cpp.
| std::string GetTxnOutputType | ( | TxoutType | t | ) |
Get the name of a TxoutType as a string.
Definition at line 18 of file solver.cpp.
|
constexpr |
| std::optional< std::pair< int, std::vector< std::span< const unsigned char > > > > MatchMultiA | ( | const CScript &script | LIFETIMEBOUND | ) |
Determine if script is a "multi_a" script.
Returns (threshold, keyspans) if so, and nullopt otherwise. The keyspans refer to bytes in the passed script.
| TxoutType Solver | ( | const CScript & | scriptPubKey, |
| std::vector< std::vector< unsigned char > > & | vSolutionsRet | ||
| ) |
Parse a scriptPubKey and identify script type for standard scripts.
If successful, returns script type and parsed pubkeys or hashes, depending on the type. For example, for a P2SH script, vSolutionsRet will contain the script hash, for P2PKH it will contain the key hash, etc.
| [in] | scriptPubKey | Script to parse |
| [out] | vSolutionsRet | Vector of parsed pubkeys and hashes |
Definition at line 141 of file solver.cpp.