diff options
author | MeshCollider <dobsonsa68@gmail.com> | 2019-08-17 09:23:36 +1200 |
---|---|---|
committer | MeshCollider <dobsonsa68@gmail.com> | 2019-08-17 09:23:52 +1200 |
commit | 7a960ba775a60ebcc2e830356693e3ed702b22f1 (patch) | |
tree | ce69f538a5dc487602264e6a8eda889d4d104dc9 /src/script/descriptor.h | |
parent | b80cdfec9a079b841194c7026faddbd496e1dfc0 (diff) | |
parent | 26d3fad1093dfc697048313be7a96c9adf723654 (diff) | |
download | bitcoin-7a960ba775a60ebcc2e830356693e3ed702b22f1.tar.xz |
Merge #15986: Add checksum to getdescriptorinfo
26d3fad1093dfc697048313be7a96c9adf723654 Add unmodified-but-with-checksum to getdescriptorinfo (Pieter Wuille)
104b3a5069c937383e6f88f2f3fb804ef61b208f Factor out checksum checking from descriptor parsing (Pieter Wuille)
Pull request description:
ACKs for top commit:
achow101:
Code Review ACK 26d3fad1093dfc697048313be7a96c9adf723654
meshcollider:
re-Code Review ACK 26d3fad1093dfc697048313be7a96c9adf723654
Sjors:
ACK 26d3fad1093dfc697048313be7a96c9adf723654
Tree-SHA512: b7a7f89b64a184927d6f9a0c183a087609983f0c5d5593f78e12db4714e930a4af655db9da4b0c407ea2e24d3b926cef6e1f2a15de502d0d1290a6e046826b99
Diffstat (limited to 'src/script/descriptor.h')
-rw-r--r-- | src/script/descriptor.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/descriptor.h b/src/script/descriptor.h index a34e9f0d8a..eae1e262cd 100644 --- a/src/script/descriptor.h +++ b/src/script/descriptor.h @@ -81,6 +81,14 @@ struct Descriptor { */ std::unique_ptr<Descriptor> Parse(const std::string& descriptor, FlatSigningProvider& out, bool require_checksum = false); +/** Get the checksum for a descriptor. + * + * If it already has one, and it is correct, return the checksum in the input. + * If it already has one that is wrong, return "". + * If it does not already have one, return the checksum that would need to be added. + */ +std::string GetDescriptorChecksum(const std::string& descriptor); + /** Find a descriptor for the specified script, using information from provider where possible. * * A non-ranged descriptor which only generates the specified script will be returned in all |