(sig, pubkey, script, txTo, inIdx, err_raiser)
| 126 | |
| 127 | |
| 128 | def _CheckSig(sig, pubkey, script, txTo, inIdx, err_raiser): |
| 129 | key = bitcoin.core.key.CECKey() |
| 130 | key.set_pubkey(pubkey) |
| 131 | |
| 132 | if len(sig) == 0: |
| 133 | return False |
| 134 | hashtype = sig[-1] |
| 135 | sig = sig[:-1] |
| 136 | |
| 137 | # Raw signature hash due to the SIGHASH_SINGLE bug |
| 138 | # |
| 139 | # Note that we never raise an exception if RawSignatureHash() returns an |
| 140 | # error code. However the first error code case, where inIdx >= |
| 141 | # len(txTo.vin), shouldn't ever happen during EvalScript() as that would |
| 142 | # imply the scriptSig being checked doesn't correspond to a valid txout - |
| 143 | # that should cause other validation machinery to fail long before we ever |
| 144 | # got here. |
| 145 | (h, err) = RawSignatureHash(script, txTo, inIdx, hashtype) |
| 146 | return key.verify(h, sig) |
| 147 | |
| 148 | |
| 149 | def _CheckMultiSig(opcode, script, stack, txTo, inIdx, flags, err_raiser, nOpCount): |
no test coverage detected