WIP: next hard fork #5

Draft
BrannonKing wants to merge 178 commits from WIP-HF-2022 into master
Showing only changes of commit 4b03b59391 - Show all commits

View file

@ -832,15 +832,15 @@ func GetPreciseSigOpCount(scriptSig, scriptPubKey []byte, _ bool) int {
func GetWitnessSigOpCount(sigScript, pkScript []byte, witness wire.TxWitness) int { func GetWitnessSigOpCount(sigScript, pkScript []byte, witness wire.TxWitness) int {
// If this is a regular witness program, then we can proceed directly // If this is a regular witness program, then we can proceed directly
// to counting its signature operations without any further processing. // to counting its signature operations without any further processing.
if IsWitnessProgram(pkScript) { if isWitnessProgramScript(pkScript) {
return getWitnessSigOps(pkScript, witness) return getWitnessSigOps(pkScript, witness)
} }
// 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.
if IsPayToScriptHash(pkScript) && IsPushOnlyScript(sigScript) && if isScriptHashScript(pkScript) && IsPushOnlyScript(sigScript) &&
IsWitnessProgram(sigScript[1:]) { len(sigScript) > 0 && isWitnessProgramScript(sigScript[1:]) {
return getWitnessSigOps(sigScript[1:], witness) return getWitnessSigOps(sigScript[1:], witness)
} }