mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 23:07:59 +01:00
Remove GetScriptForWitness function
This commit is contained in:
parent
b887060d06
commit
fec8336ad9
2 changed files with 0 additions and 22 deletions
|
@ -313,18 +313,6 @@ CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys)
|
|||
return script;
|
||||
}
|
||||
|
||||
CScript GetScriptForWitness(const CScript& redeemscript)
|
||||
{
|
||||
std::vector<std::vector<unsigned char> > vSolutions;
|
||||
TxoutType typ = Solver(redeemscript, vSolutions);
|
||||
if (typ == TxoutType::PUBKEY) {
|
||||
return GetScriptForDestination(WitnessV0KeyHash(Hash160(vSolutions[0])));
|
||||
} else if (typ == TxoutType::PUBKEYHASH) {
|
||||
return GetScriptForDestination(WitnessV0KeyHash(uint160{vSolutions[0]}));
|
||||
}
|
||||
return GetScriptForDestination(WitnessV0ScriptHash(redeemscript));
|
||||
}
|
||||
|
||||
bool IsValidDestination(const CTxDestination& dest) {
|
||||
return dest.which() != 0;
|
||||
}
|
||||
|
|
|
@ -263,14 +263,4 @@ CScript GetScriptForRawPubKey(const CPubKey& pubkey);
|
|||
/** Generate a multisig script. */
|
||||
CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys);
|
||||
|
||||
/**
|
||||
* Generate a pay-to-witness script for the given redeem script. If the redeem
|
||||
* script is P2PK or P2PKH, this returns a P2WPKH script, otherwise it returns a
|
||||
* P2WSH script.
|
||||
*
|
||||
* TODO: replace calls to GetScriptForWitness with GetScriptForDestination using
|
||||
* the various witness-specific CTxDestination subtypes.
|
||||
*/
|
||||
CScript GetScriptForWitness(const CScript& redeemscript);
|
||||
|
||||
#endif // BITCOIN_SCRIPT_STANDARD_H
|
||||
|
|
Loading…
Add table
Reference in a new issue