diff options
author | Gregory Sanders <gsanders87@gmail.com> | 2020-01-14 15:05:53 -0500 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2020-01-15 09:59:47 +0000 |
commit | eac49073eb7c5d630dd9a285e36f743fa902c0ee (patch) | |
tree | 082afb3afcc15bb8df3cc2e426171d5a94b9833e /src | |
parent | e2c45d89f7219fd5bcf19a6e04b291abbb4b5f95 (diff) |
Don't allow implementers to think ScriptHash(Witness*()) results in nesting computation
Github-Pull: #17924
Rebased-From: 6dd59d2e491bc11ab26498668543e65440a3a931
Diffstat (limited to 'src')
-rw-r--r-- | src/script/standard.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/script/standard.h b/src/script/standard.h index e45e2d92cc..0c344c7733 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -81,9 +81,14 @@ struct PKHash : public uint160 using uint160::uint160; }; +struct WitnessV0KeyHash; struct ScriptHash : public uint160 { ScriptHash() : uint160() {} + // These don't do what you'd expect. + // Use ScriptHash(GetScriptForDestination(...)) instead. + explicit ScriptHash(const WitnessV0KeyHash& hash) = delete; + explicit ScriptHash(const PKHash& hash) = delete; explicit ScriptHash(const uint160& hash) : uint160(hash) {} explicit ScriptHash(const CScript& script); using uint160::uint160; |