mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-06 13:47:56 +02:00
Don't allow implementers to think ScriptHash(Witness*()) results in nesting computation
Github-Pull: #17924
Rebased-From: 6dd59d2e49
This commit is contained in:
committed by
João Barbosa
parent
e2c45d89f7
commit
eac49073eb
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user