Changeset View
Changeset View
Standalone View
Standalone View
src/script/descriptor.h
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | struct Descriptor { | ||||
* Expand a descriptor at a specified position. | * Expand a descriptor at a specified position. | ||||
* | * | ||||
* pos: the position at which to expand the descriptor. If IsRange() is | * pos: the position at which to expand the descriptor. If IsRange() is | ||||
* false, this is ignored. | * false, this is ignored. | ||||
* provider: the provider to query for private keys in case of hardened | * provider: the provider to query for private keys in case of hardened | ||||
* derivation. | * derivation. | ||||
* output_script: the expanded scriptPubKeys will be put here. | * output_script: the expanded scriptPubKeys will be put here. | ||||
* out: scripts and public keys necessary for solving the expanded | * out: scripts and public keys necessary for solving the expanded | ||||
* scriptPubKeys will be put here (may be equal to provider). | * scriptPubKeys will be put here (may be equal to provider). cache: vector | ||||
* which will be overwritten with cache data necessary to-evaluate the | |||||
* descriptor at this point without access to private keys. | |||||
*/ | */ | ||||
virtual bool Expand(int pos, const SigningProvider &provider, | virtual bool Expand(int pos, const SigningProvider &provider, | ||||
std::vector<CScript> &output_scripts, | std::vector<CScript> &output_scripts, | ||||
FlatSigningProvider &out, | |||||
std::vector<uint8_t> *cache = nullptr) const = 0; | |||||
/** | |||||
* Expand a descriptor at a specified position using cached expansion data. | |||||
* | |||||
* pos: the position at which to expand the descriptor. If IsRange() is | |||||
* false, this is ignored. cache: vector from which cached expansion data | |||||
* will be read. output_script: the expanded scriptPubKeys will be put here. | |||||
* out: scripts and public keys necessary for solving the expanded | |||||
* scriptPubKeys will be put here (may be equal to provider). | |||||
*/ | |||||
virtual bool ExpandFromCache(int pos, const std::vector<uint8_t> &cache, | |||||
std::vector<CScript> &output_scripts, | |||||
FlatSigningProvider &out) const = 0; | FlatSigningProvider &out) const = 0; | ||||
}; | }; | ||||
/** | /** | ||||
* Parse a descriptor string. Included private keys are put in out. | * Parse a descriptor string. Included private keys are put in out. | ||||
* Returns nullptr if parsing fails. | * Returns nullptr if parsing fails. | ||||
*/ | */ | ||||
std::unique_ptr<Descriptor> Parse(const std::string &descriptor, | std::unique_ptr<Descriptor> Parse(const std::string &descriptor, | ||||
FlatSigningProvider &out); | FlatSigningProvider &out); | ||||
Show All 22 Lines |