Bitcoin Core  22.99.0
P2P Digital Currency
Functions | Variables
outputtype.cpp File Reference
#include <outputtype.h>
#include <pubkey.h>
#include <script/script.h>
#include <script/sign.h>
#include <script/signingprovider.h>
#include <script/standard.h>
#include <util/vector.h>
#include <assert.h>
#include <optional>
#include <string>
Include dependency graph for outputtype.cpp:

Go to the source code of this file.

Functions

std::optional< OutputTypeParseOutputType (const std::string &type)
 
const std::string & FormatOutputType (OutputType type)
 
CTxDestination GetDestinationForKey (const CPubKey &key, OutputType type)
 Get a destination of the requested type (if possible) to the specified key. More...
 
std::vector< CTxDestinationGetAllDestinationsForKey (const CPubKey &key)
 Get all destinations (potentially) supported by the wallet for the given key. More...
 
CTxDestination AddAndGetDestinationForScript (FillableSigningProvider &keystore, const CScript &script, OutputType type)
 Get a destination of the requested type (if possible) to the specified script. More...
 
std::optional< OutputTypeOutputTypeFromDestination (const CTxDestination &dest)
 Get the OutputType for a CTxDestination. More...
 

Variables

static const std::string OUTPUT_TYPE_STRING_LEGACY = "legacy"
 
static const std::string OUTPUT_TYPE_STRING_P2SH_SEGWIT = "p2sh-segwit"
 
static const std::string OUTPUT_TYPE_STRING_BECH32 = "bech32"
 
static const std::string OUTPUT_TYPE_STRING_BECH32M = "bech32m"
 

Function Documentation

◆ AddAndGetDestinationForScript()

CTxDestination AddAndGetDestinationForScript ( FillableSigningProvider keystore,
const CScript script,
OutputType   
)

Get a destination of the requested type (if possible) to the specified script.

This function will automatically add the script (and any other necessary scripts) to the keystore.

Definition at line 82 of file outputtype.cpp.

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

◆ FormatOutputType()

const std::string& FormatOutputType ( OutputType  type)

Definition at line 38 of file outputtype.cpp.

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

◆ GetAllDestinationsForKey()

std::vector<CTxDestination> GetAllDestinationsForKey ( const CPubKey key)

Get all destinations (potentially) supported by the wallet for the given key.

Definition at line 69 of file outputtype.cpp.

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

◆ GetDestinationForKey()

CTxDestination GetDestinationForKey ( const CPubKey key,
OutputType   
)

Get a destination of the requested type (if possible) to the specified key.

The caller must make sure LearnRelatedScripts has been called beforehand.

Definition at line 49 of file outputtype.cpp.

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

◆ OutputTypeFromDestination()

std::optional<OutputType> OutputTypeFromDestination ( const CTxDestination dest)

Get the OutputType for a CTxDestination.

Definition at line 109 of file outputtype.cpp.

Here is the caller graph for this function:

◆ ParseOutputType()

std::optional<OutputType> ParseOutputType ( const std::string &  type)

Definition at line 24 of file outputtype.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ OUTPUT_TYPE_STRING_BECH32

const std::string OUTPUT_TYPE_STRING_BECH32 = "bech32"
static

Definition at line 21 of file outputtype.cpp.

◆ OUTPUT_TYPE_STRING_BECH32M

const std::string OUTPUT_TYPE_STRING_BECH32M = "bech32m"
static

Definition at line 22 of file outputtype.cpp.

◆ OUTPUT_TYPE_STRING_LEGACY

const std::string OUTPUT_TYPE_STRING_LEGACY = "legacy"
static

Definition at line 19 of file outputtype.cpp.

◆ OUTPUT_TYPE_STRING_P2SH_SEGWIT

const std::string OUTPUT_TYPE_STRING_P2SH_SEGWIT = "p2sh-segwit"
static

Definition at line 20 of file outputtype.cpp.