mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Drop unused GetScriptForWitness
This commit is contained in:
parent
7662c0b79a
commit
689eff3aa0
@ -279,26 +279,3 @@ CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys)
|
||||
script << CScript::EncodeOP_N(keys.size()) << OP_CHECKMULTISIG;
|
||||
return script;
|
||||
}
|
||||
|
||||
CScript GetScriptForWitness(const CScript& redeemscript)
|
||||
{
|
||||
CScript ret;
|
||||
|
||||
txnouttype typ;
|
||||
std::vector<std::vector<unsigned char> > vSolutions;
|
||||
if (Solver(redeemscript, typ, vSolutions)) {
|
||||
if (typ == TX_PUBKEY) {
|
||||
unsigned char h160[20];
|
||||
CHash160().Write(&vSolutions[0][0], vSolutions[0].size()).Finalize(h160);
|
||||
ret << OP_0 << std::vector<unsigned char>(&h160[0], &h160[20]);
|
||||
return ret;
|
||||
} else if (typ == TX_PUBKEYHASH) {
|
||||
ret << OP_0 << vSolutions[0];
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
uint256 hash;
|
||||
CSHA256().Write(&redeemscript[0], redeemscript.size()).Finalize(hash.begin());
|
||||
ret << OP_0 << ToByteVector(hash);
|
||||
return ret;
|
||||
}
|
||||
|
@ -77,6 +77,5 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::
|
||||
CScript GetScriptForDestination(const CTxDestination& dest);
|
||||
CScript GetScriptForRawPubKey(const CPubKey& pubkey);
|
||||
CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys);
|
||||
CScript GetScriptForWitness(const CScript& redeemscript);
|
||||
|
||||
#endif // BITCOIN_SCRIPT_STANDARD_H
|
||||
|
Loading…
Reference in New Issue
Block a user