Bitcoin Core 28.99.0
P2P Digital Currency
Typedefs | Functions
addresstype.cpp File Reference
#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>
Include dependency graph for addresstype.cpp:

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 Documentation

◆ valtype

typedef std::vector<unsigned char> valtype

Definition at line 18 of file addresstype.cpp.

Function Documentation

◆ ExtractDestination()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetScriptForDestination()

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.

◆ IsValidDestination()

bool IsValidDestination ( const CTxDestination dest)

Check whether a CTxDestination corresponds to one with an address.

Definition at line 171 of file addresstype.cpp.

Here is the caller graph for this function:

◆ ToKeyID() [1/2]

CKeyID ToKeyID ( const PKHash key_hash)

Definition at line 29 of file addresstype.cpp.

Here is the caller graph for this function:

◆ ToKeyID() [2/2]

CKeyID ToKeyID ( const WitnessV0KeyHash key_hash)

Definition at line 34 of file addresstype.cpp.

◆ ToScriptID()

CScriptID ToScriptID ( const ScriptHash script_hash)

Definition at line 39 of file addresstype.cpp.

Here is the caller graph for this function: