diff options
| author | Pieter Wuille <[email protected]> | 2019-02-06 18:08:21 -0800 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2019-02-15 22:36:05 -0800 |
| commit | 3b40bff9880e9ae2817136b7d14989afccfc1937 (patch) | |
| tree | 65325ad0dbdda14e32704dfff400196aa13d04b8 /src/script/descriptor.h | |
| parent | Merge #15399: fuzz: Script validation flags (diff) | |
| download | discoin-3b40bff9880e9ae2817136b7d14989afccfc1937.tar.xz discoin-3b40bff9880e9ae2817136b7d14989afccfc1937.zip | |
Descriptor checksum
Diffstat (limited to 'src/script/descriptor.h')
| -rw-r--r-- | src/script/descriptor.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/script/descriptor.h b/src/script/descriptor.h index 44f0efca0..907a10228 100644 --- a/src/script/descriptor.h +++ b/src/script/descriptor.h @@ -62,8 +62,15 @@ struct Descriptor { virtual bool ExpandFromCache(int pos, const std::vector<unsigned char>& cache, std::vector<CScript>& output_scripts, FlatSigningProvider& out) const = 0; }; -/** Parse a descriptor string. Included private keys are put in out. Returns nullptr if parsing fails. */ -std::unique_ptr<Descriptor> Parse(const std::string& descriptor, FlatSigningProvider& 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 + * is set, the checksum is mandatory - otherwise it is optional. + * + * If a parse error occurs, or the checksum is missing/invalid, or anything + * else is wrong, nullptr is returned. + */ +std::unique_ptr<Descriptor> Parse(const std::string& descriptor, FlatSigningProvider& out, bool require_checksum = false); /** Find a descriptor for the specified script, using information from provider where possible. * |