Changeset View
Changeset View
Standalone View
Standalone View
src/script/descriptor.h
// Copyright (c) 2018 The Bitcoin Core developers | // Copyright (c) 2018 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_SCRIPT_DESCRIPTOR_H | #ifndef BITCOIN_SCRIPT_DESCRIPTOR_H | ||||
#define BITCOIN_SCRIPT_DESCRIPTOR_H | #define BITCOIN_SCRIPT_DESCRIPTOR_H | ||||
#include <optional.h> | |||||
#include <outputtype.h> | #include <outputtype.h> | ||||
#include <script/script.h> | #include <script/script.h> | ||||
#include <script/sign.h> | #include <script/sign.h> | ||||
#include <script/signingprovider.h> | #include <script/signingprovider.h> | ||||
#include <vector> | #include <vector> | ||||
using ExtPubKeyMap = std::unordered_map<uint32_t, CExtPubKey>; | using ExtPubKeyMap = std::unordered_map<uint32_t, CExtPubKey>; | ||||
▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | struct Descriptor { | ||||
* @param[in] provider: The provider to query for the private keys. | * @param[in] provider: The provider to query for the private keys. | ||||
* @param[out] out: Any private keys available for the specified `pos`. | * @param[out] out: Any private keys available for the specified `pos`. | ||||
*/ | */ | ||||
virtual void ExpandPrivate(int pos, const SigningProvider &provider, | virtual void ExpandPrivate(int pos, const SigningProvider &provider, | ||||
FlatSigningProvider &out) const = 0; | FlatSigningProvider &out) const = 0; | ||||
/** | /** | ||||
* @return The OutputType of the scriptPubKey(s) produced by this | * @return The OutputType of the scriptPubKey(s) produced by this | ||||
* descriptor. Or nullopt if indeterminate (multiple or none) | * descriptor. Or std::nullopt if indeterminate (multiple or none) | ||||
*/ | */ | ||||
virtual Optional<OutputType> GetOutputType() const = 0; | virtual std::optional<OutputType> GetOutputType() const = 0; | ||||
}; | }; | ||||
/** | /** | ||||
* Parse a `descriptor` string. Included private keys are put in `out`. | * Parse a `descriptor` string. Included private keys are put in `out`. | ||||
* | * | ||||
* If the descriptor has a checksum, it must be valid. If `require_checksum` | * If the descriptor has a checksum, it must be valid. If `require_checksum` | ||||
* is set, the checksum is mandatory - otherwise it is optional. | * is set, the checksum is mandatory - otherwise it is optional. | ||||
* | * | ||||
Show All 38 Lines |