Skip to content

Commit fec8336

Browse files
committed
Remove GetScriptForWitness function
1 parent b887060 commit fec8336

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

src/script/standard.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -313,18 +313,6 @@ CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys)
313313
return script;
314314
}
315315

316-
CScript GetScriptForWitness(const CScript& redeemscript)
317-
{
318-
std::vector<std::vector<unsigned char> > vSolutions;
319-
TxoutType typ = Solver(redeemscript, vSolutions);
320-
if (typ == TxoutType::PUBKEY) {
321-
return GetScriptForDestination(WitnessV0KeyHash(Hash160(vSolutions[0])));
322-
} else if (typ == TxoutType::PUBKEYHASH) {
323-
return GetScriptForDestination(WitnessV0KeyHash(uint160{vSolutions[0]}));
324-
}
325-
return GetScriptForDestination(WitnessV0ScriptHash(redeemscript));
326-
}
327-
328316
bool IsValidDestination(const CTxDestination& dest) {
329317
return dest.which() != 0;
330318
}

src/script/standard.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,4 @@ CScript GetScriptForRawPubKey(const CPubKey& pubkey);
263263
/** Generate a multisig script. */
264264
CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys);
265265

266-
/**
267-
* Generate a pay-to-witness script for the given redeem script. If the redeem
268-
* script is P2PK or P2PKH, this returns a P2WPKH script, otherwise it returns a
269-
* P2WSH script.
270-
*
271-
* TODO: replace calls to GetScriptForWitness with GetScriptForDestination using
272-
* the various witness-specific CTxDestination subtypes.
273-
*/
274-
CScript GetScriptForWitness(const CScript& redeemscript);
275-
276266
#endif // BITCOIN_SCRIPT_STANDARD_H

0 commit comments

Comments
 (0)