txscript: Remove unused isPushOnly function.
This commit is contained in:
parent
ded9b8c506
commit
e9a777d84e
1 changed files with 1 additions and 25 deletions
|
@ -161,26 +161,6 @@ func ExtractWitnessProgramInfo(script []byte) (int, []byte, error) {
|
||||||
return witnessVersion, witnessProgram, nil
|
return witnessVersion, witnessProgram, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// isPushOnly returns true if the script only pushes data, false otherwise.
|
|
||||||
//
|
|
||||||
// DEPRECATED. Use IsPushOnlyScript instead.
|
|
||||||
func isPushOnly(pops []parsedOpcode) bool {
|
|
||||||
// NOTE: This function does NOT verify opcodes directly since it is
|
|
||||||
// internal and is only called with parsed opcodes for scripts that did
|
|
||||||
// not have any parse errors. Thus, consensus is properly maintained.
|
|
||||||
|
|
||||||
for _, pop := range pops {
|
|
||||||
// All opcodes up to OP_16 are data push instructions.
|
|
||||||
// NOTE: This does consider OP_RESERVED to be a data push
|
|
||||||
// instruction, but execution of OP_RESERVED will fail anyways
|
|
||||||
// and matches the behavior required by consensus.
|
|
||||||
if pop.opcode.value > OP_16 {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsPushOnlyScript returns whether or not the passed script only pushes data
|
// IsPushOnlyScript returns whether or not the passed script only pushes data
|
||||||
// according to the consensus definition of pushing data.
|
// according to the consensus definition of pushing data.
|
||||||
//
|
//
|
||||||
|
@ -901,11 +881,7 @@ func GetWitnessSigOpCount(sigScript, pkScript []byte, witness wire.TxWitness) in
|
||||||
// Next, we'll check the sigScript to see if this is a nested p2sh
|
// Next, we'll check the sigScript to see if this is a nested p2sh
|
||||||
// witness program. This is a case wherein the sigScript is actually a
|
// witness program. This is a case wherein the sigScript is actually a
|
||||||
// datapush of a p2wsh witness program.
|
// datapush of a p2wsh witness program.
|
||||||
sigPops, err := parseScript(sigScript)
|
if IsPayToScriptHash(pkScript) && IsPushOnlyScript(sigScript) &&
|
||||||
if err != nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
if IsPayToScriptHash(pkScript) && isPushOnly(sigPops) &&
|
|
||||||
IsWitnessProgram(sigScript[1:]) {
|
IsWitnessProgram(sigScript[1:]) {
|
||||||
return getWitnessSigOps(sigScript[1:], witness)
|
return getWitnessSigOps(sigScript[1:], witness)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue