Skip to content

Commit

Permalink
Don't allow implementers to think ScriptHash(Witness*()) results in n…
Browse files Browse the repository at this point in the history
…esting computation
  • Loading branch information
instagibbs committed Jan 14, 2020
1 parent 4b8f1e9 commit 6dd59d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/script/standard.h
Expand Up @@ -80,9 +80,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;
Expand Down

0 comments on commit 6dd59d2

Please sign in to comment.