diff options
author | Ben Woosley <ben.woosley@gmail.com> | 2020-01-14 22:48:34 -0800 |
---|---|---|
committer | Ben Woosley <ben.woosley@gmail.com> | 2020-06-19 12:14:07 -0700 |
commit | 3fcc46812334074d2c77a6233e8a961cd0785872 (patch) | |
tree | 028e1d7cc8812c24221d30fbc68aa96545fee708 /src | |
parent | 0a5ea32ce605984094c5552877cb99bc81654f2c (diff) |
Prefer explicit CScriptID construction
Diffstat (limited to 'src')
-rw-r--r-- | src/script/sign.cpp | 6 | ||||
-rw-r--r-- | src/script/standard.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 1e00afcf89..43988c4fd7 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -131,7 +131,7 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator } case TX_SCRIPTHASH: h160 = uint160(vSolutions[0]); - if (GetCScript(provider, sigdata, h160, scriptRet)) { + if (GetCScript(provider, sigdata, CScriptID{h160}, scriptRet)) { ret.push_back(std::vector<unsigned char>(scriptRet.begin(), scriptRet.end())); return true; } @@ -165,7 +165,7 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator case TX_WITNESS_V0_SCRIPTHASH: CRIPEMD160().Write(&vSolutions[0][0], vSolutions[0].size()).Finalize(h160.begin()); - if (GetCScript(provider, sigdata, h160, scriptRet)) { + if (GetCScript(provider, sigdata, CScriptID{h160}, scriptRet)) { ret.push_back(std::vector<unsigned char>(scriptRet.begin(), scriptRet.end())); return true; } @@ -458,7 +458,7 @@ bool IsSegWitOutput(const SigningProvider& provider, const CScript& script) if (whichtype == TX_SCRIPTHASH) { auto h160 = uint160(solutions[0]); CScript subscript; - if (provider.GetCScript(h160, subscript)) { + if (provider.GetCScript(CScriptID{h160}, subscript)) { whichtype = Solver(subscript, solutions); if (whichtype == TX_WITNESS_V0_SCRIPTHASH || whichtype == TX_WITNESS_V0_KEYHASH || whichtype == TX_WITNESS_UNKNOWN) return true; } diff --git a/src/script/standard.h b/src/script/standard.h index c1a9fc90bd..7c74d05be5 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -25,7 +25,7 @@ class CScriptID : public uint160 public: CScriptID() : uint160() {} explicit CScriptID(const CScript& in); - CScriptID(const uint160& in) : uint160(in) {} + explicit CScriptID(const uint160& in) : uint160(in) {} }; /** |