Return early if no valid opcodes found in CountWitnessSigOps(...).
Prior to this commit this was the only place in the codebase where GetOp(...) was called without checking the return value.
Return early if no valid opcodes found in CountWitnessSigOps(...).
Prior to this commit this was the only place in the codebase where GetOp(...) was called without checking the return value.
Prior to this commit this was the only place in the codebase where
GetOp(...) was called without checking the return value.
1564 | + if (scriptSig.GetOp(pc, opcode, data)) { 1565 | + hasValidOp = true; 1566 | + } 1567 | + } 1568 | + if (!hasValidOp) { 1569 | + return 0;
This is not an obvious early return, because one has to go deeper in IsWitnessProgram.
Concept ACK.
Nit, reword to use your usual prefix script:.