Bitcoin Core  0.19.99
P2P Digital Currency
outputtype.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2019 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_OUTPUTTYPE_H
7 #define BITCOIN_OUTPUTTYPE_H
8 
9 #include <attributes.h>
10 #include <script/signingprovider.h>
11 #include <script/standard.h>
12 
13 #include <array>
14 #include <string>
15 #include <vector>
16 
17 enum class OutputType {
18  LEGACY,
20  BECH32,
21 
29 };
30 
31 extern const std::array<OutputType, 3> OUTPUT_TYPES;
32 
33 NODISCARD bool ParseOutputType(const std::string& str, OutputType& output_type);
34 const std::string& FormatOutputType(OutputType type);
35 
41 
43 std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey& key);
44 
51 
52 #endif // BITCOIN_OUTPUTTYPE_H
const std::array< OutputType, 3 > OUTPUT_TYPES
Definition: outputtype.cpp:22
std::vector< CTxDestination > GetAllDestinationsForKey(const CPubKey &key)
Get all destinations (potentially) supported by the wallet for the given key.
Definition: outputtype.cpp:68
OutputType
Definition: outputtype.h:17
CTxDestination GetDestinationForKey(const CPubKey &key, OutputType)
Get a destination of the requested type (if possible) to the specified key.
Definition: outputtype.cpp:49
#define NODISCARD
Definition: attributes.h:18
NODISCARD bool ParseOutputType(const std::string &str, OutputType &output_type)
Definition: outputtype.cpp:24
An encapsulated public key.
Definition: pubkey.h:30
Fillable signing provider that keeps keys in an address->secret map.
CTxDestination AddAndGetDestinationForScript(FillableSigningProvider &keystore, const CScript &script, OutputType)
Get a destination of the requested type (if possible) to the specified script.
Definition: outputtype.cpp:81
Special output type for change outputs only.
const std::string & FormatOutputType(OutputType type)
Definition: outputtype.cpp:39
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:390
boost::variant< CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:143