Get the SigOp count. fAccurate - Accurately count CHECKMULTISIG, see BIP16 for details. Note that this is consensus-critical.
(self, fAccurate)
| 802 | return "CScript([%s])" % ', '.join(ops) |
| 803 | |
| 804 | def GetSigOpCount(self, fAccurate): |
| 805 | """Get the SigOp count. |
| 806 | |
| 807 | fAccurate - Accurately count CHECKMULTISIG, see BIP16 for details. |
| 808 | |
| 809 | Note that this is consensus-critical. |
| 810 | """ |
| 811 | n = 0 |
| 812 | lastOpcode = OP_INVALIDOPCODE |
| 813 | for (opcode, data, sop_idx) in self.raw_iter(): |
| 814 | if opcode in (OP_CHECKSIG, OP_CHECKSIGVERIFY): |
| 815 | n += 1 |
| 816 | elif opcode in (OP_CHECKMULTISIG, OP_CHECKMULTISIGVERIFY): |
| 817 | if fAccurate and (OP_1 <= lastOpcode <= OP_16): |
| 818 | n += opcode.decode_op_n() |
| 819 | else: |
| 820 | n += 20 |
| 821 | lastOpcode = opcode |
| 822 | return n |
| 823 | |
| 824 | |
| 825 | SIGHASH_ALL = 1 |
nothing calls this directly
no test coverage detected