mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
Prefer explicit CScriptID construction
This commit is contained in:
parent
0a5ea32ce6
commit
3fcc468123
2 changed files with 4 additions and 4 deletions
|
@ -131,7 +131,7 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator
|
||||||
}
|
}
|
||||||
case TX_SCRIPTHASH:
|
case TX_SCRIPTHASH:
|
||||||
h160 = uint160(vSolutions[0]);
|
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()));
|
ret.push_back(std::vector<unsigned char>(scriptRet.begin(), scriptRet.end()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator
|
||||||
|
|
||||||
case TX_WITNESS_V0_SCRIPTHASH:
|
case TX_WITNESS_V0_SCRIPTHASH:
|
||||||
CRIPEMD160().Write(&vSolutions[0][0], vSolutions[0].size()).Finalize(h160.begin());
|
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()));
|
ret.push_back(std::vector<unsigned char>(scriptRet.begin(), scriptRet.end()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -458,7 +458,7 @@ bool IsSegWitOutput(const SigningProvider& provider, const CScript& script)
|
||||||
if (whichtype == TX_SCRIPTHASH) {
|
if (whichtype == TX_SCRIPTHASH) {
|
||||||
auto h160 = uint160(solutions[0]);
|
auto h160 = uint160(solutions[0]);
|
||||||
CScript subscript;
|
CScript subscript;
|
||||||
if (provider.GetCScript(h160, subscript)) {
|
if (provider.GetCScript(CScriptID{h160}, subscript)) {
|
||||||
whichtype = Solver(subscript, solutions);
|
whichtype = Solver(subscript, solutions);
|
||||||
if (whichtype == TX_WITNESS_V0_SCRIPTHASH || whichtype == TX_WITNESS_V0_KEYHASH || whichtype == TX_WITNESS_UNKNOWN) return true;
|
if (whichtype == TX_WITNESS_V0_SCRIPTHASH || whichtype == TX_WITNESS_V0_KEYHASH || whichtype == TX_WITNESS_UNKNOWN) return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ class CScriptID : public uint160
|
||||||
public:
|
public:
|
||||||
CScriptID() : uint160() {}
|
CScriptID() : uint160() {}
|
||||||
explicit CScriptID(const CScript& in);
|
explicit CScriptID(const CScript& in);
|
||||||
CScriptID(const uint160& in) : uint160(in) {}
|
explicit CScriptID(const uint160& in) : uint160(in) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue