Skip to content

Commit 6dd59d2

Browse files
committed
Don't allow implementers to think ScriptHash(Witness*()) results in nesting computation
1 parent 4b8f1e9 commit 6dd59d2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/script/standard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,14 @@ struct PKHash : public uint160
8080
using uint160::uint160;
8181
};
8282

83+
struct WitnessV0KeyHash;
8384
struct ScriptHash : public uint160
8485
{
8586
ScriptHash() : uint160() {}
87+
// These don't do what you'd expect.
88+
// Use ScriptHash(GetScriptForDestination(...)) instead.
89+
explicit ScriptHash(const WitnessV0KeyHash& hash) = delete;
90+
explicit ScriptHash(const PKHash& hash) = delete;
8691
explicit ScriptHash(const uint160& hash) : uint160(hash) {}
8792
explicit ScriptHash(const CScript& script);
8893
using uint160::uint160;

0 commit comments

Comments
 (0)