![]() |
Bitcoin Core 30.99.0
P2P Digital Currency
|
#include <addresstype.h>#include <crypto/sha256.h>#include <hash.h>#include <pubkey.h>#include <script/script.h>#include <script/solver.h>#include <uint256.h>#include <util/hash_type.h>#include <cassert>#include <vector>Go to the source code of this file.
Typedefs | |
| typedef std::vector< unsigned char > | valtype |
Functions | |
| CKeyID | ToKeyID (const PKHash &key_hash) |
| CKeyID | ToKeyID (const WitnessV0KeyHash &key_hash) |
| CScriptID | ToScriptID (const ScriptHash &script_hash) |
| bool | ExtractDestination (const CScript &scriptPubKey, CTxDestination &addressRet) |
| Parse a scriptPubKey for the destination. More... | |
| CScript | GetScriptForDestination (const CTxDestination &dest) |
| Generate a Bitcoin scriptPubKey for the given CTxDestination. More... | |
| bool | IsValidDestination (const CTxDestination &dest) |
| Check whether a CTxDestination corresponds to one with an address. More... | |
| typedef std::vector<unsigned char> valtype |
Definition at line 18 of file addresstype.cpp.
| bool ExtractDestination | ( | const CScript & | scriptPubKey, |
| CTxDestination & | addressRet | ||
| ) |
Parse a scriptPubKey for the destination.
For standard scripts that have addresses (and P2PK as an exception), a corresponding CTxDestination is assigned to addressRet. For all other scripts. addressRet is assigned as a CNoDestination containing the scriptPubKey.
Returns true for standard destinations with addresses - P2PKH, P2SH, P2WPKH, P2WSH, P2TR and P2W??? scripts. Returns false for non-standard destinations and those without addresses - P2PK, bare multisig, null data, and nonstandard scripts.
Definition at line 49 of file addresstype.cpp.
| CScript GetScriptForDestination | ( | const CTxDestination & | dest | ) |
Generate a Bitcoin scriptPubKey for the given CTxDestination.
Returns a P2PKH script for a CKeyID destination, a P2SH script for a CScriptID, and an empty script for CNoDestination.
Definition at line 166 of file addresstype.cpp.
| bool IsValidDestination | ( | const CTxDestination & | dest | ) |
Check whether a CTxDestination corresponds to one with an address.
Definition at line 171 of file addresstype.cpp.
| CKeyID ToKeyID | ( | const WitnessV0KeyHash & | key_hash | ) |
Definition at line 34 of file addresstype.cpp.
| CScriptID ToScriptID | ( | const ScriptHash & | script_hash | ) |