Get the SigOp count. fAccurate - Accurately count CHECKMULTISIG, see BIP16 for details. Note that this is consensus-critical.
(self, fAccurate)
| 791 | return CScript([OP_HASH160, bitcoin.core.Hash160(self), OP_EQUAL]) |
| 792 | |
| 793 | def GetSigOpCount(self, fAccurate): |
| 794 | """Get the SigOp count. |
| 795 | |
| 796 | fAccurate - Accurately count CHECKMULTISIG, see BIP16 for details. |
| 797 | |
| 798 | Note that this is consensus-critical. |
| 799 | """ |
| 800 | n = 0 |
| 801 | lastOpcode = OP_INVALIDOPCODE |
| 802 | for (opcode, data, sop_idx) in self.raw_iter(): |
| 803 | if opcode in (OP_CHECKSIG, OP_CHECKSIGVERIFY): |
| 804 | n += 1 |
| 805 | elif opcode in (OP_CHECKMULTISIG, OP_CHECKMULTISIGVERIFY): |
| 806 | if fAccurate and (OP_1 <= lastOpcode <= OP_16): |
| 807 | n += opcode.decode_op_n() |
| 808 | else: |
| 809 | n += 20 |
| 810 | lastOpcode = opcode |
| 811 | return n |
| 812 | |
| 813 | class CScriptWitness(ImmutableSerializable): |
| 814 | """An encoding of the data elements on the initial stack for (segregated |
no test coverage detected