Parse a scriptPubKey for the destination.
Declared in <addresstype.h>
bool
ExtractDestination(
CScript const& scriptPubKey,
CTxDestination& addressRet);
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.
True for standard destinations with addresses - P2PKH, P2SH, P2WPKH, P2WSH, P2TR and P2W??? scripts. False for non-standard destinations and those without addresses - P2PK, bare multisig, null data, and nonstandard scripts.
| Name | Description |
|---|---|
| scriptPubKey | The output script to parse. |
| addressRet | Receives the extracted destination. |