Bitcoin Core  22.99.0
P2P Digital Currency
Enumerations | Functions | Variables
outputtype.h File Reference
#include <attributes.h>
#include <script/signingprovider.h>
#include <script/standard.h>
#include <array>
#include <optional>
#include <string>
#include <vector>
Include dependency graph for outputtype.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  OutputType { OutputType::LEGACY, OutputType::P2SH_SEGWIT, OutputType::BECH32, OutputType::BECH32M }
 

Functions

std::optional< OutputTypeParseOutputType (const std::string &str)
 
const std::string & FormatOutputType (OutputType type)
 
CTxDestination GetDestinationForKey (const CPubKey &key, OutputType)
 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)
 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 constexpr auto OUTPUT_TYPES
 

Enumeration Type Documentation

◆ OutputType

enum OutputType
strong
Enumerator
LEGACY 
P2SH_SEGWIT 
BECH32 
BECH32M 

Definition at line 18 of file outputtype.h.

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 &  str)

Definition at line 24 of file outputtype.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ OUTPUT_TYPES

constexpr auto OUTPUT_TYPES
staticconstexpr
Initial value:

Definition at line 25 of file outputtype.h.

OutputType::LEGACY
@ LEGACY
OutputType::BECH32M
@ BECH32M
OutputType::P2SH_SEGWIT
@ P2SH_SEGWIT
OutputType::BECH32
@ BECH32