def op_checkmultisig(vm, instr): if len(vm.stack) < 1: raise Exception("OP_CHECKMULTISIG: Stack too small for pubkey_count") pubkey_count = cast_to_number(vm.stack.pop()) if len(vm.stack) < pubkey_count: raise Exception("OP_CHECKMULTISIG: Stack too small for pubkeys") pubkeys = vm.stack[-pubkey_count:] del vm.stack[-pubkey_count:] if len(vm.stack) < 1: raise Exception("OP_CHECKMULTISIG: Stack too small for sig_count") sig_count = cast_to_number(vm.stack.pop()) if len(vm.stack) < sig_count: raise Exception("OP_CHECKMULTISIG: Stack too small for sigs") sigs = vm.stack[-sig_count:] del vm.stack[-sig_count:] vm.stack.append (valtype_from_boolean(check_multisig(vm, sigs, pubkeys)))
def op_checkmultisig(vm, instr): if len(vm.stack) < 1: raise Exception("OP_CHECKMULTISIG: Stack too small for pubkey_count") pubkey_count = cast_to_number(vm.stack.pop()) if len(vm.stack) < pubkey_count: raise Exception("OP_CHECKMULTISIG: Stack too small for pubkeys") pubkeys = vm.stack[-pubkey_count:] del vm.stack[-pubkey_count:] if len(vm.stack) < 1: raise Exception("OP_CHECKMULTISIG: Stack too small for sig_count") sig_count = cast_to_number(vm.stack.pop()) if len(vm.stack) < sig_count: raise Exception("OP_CHECKMULTISIG: Stack too small for sigs") sigs = vm.stack[-sig_count:] del vm.stack[-sig_count:] vm.stack.append(valtype_from_boolean(check_multisig(vm, sigs, pubkeys)))
def op_equal(vm, instr): if len(vm.stack) < 2: raise Exception("OP_EQUAL: Insufficient Arguments") first, second = vm.stack.pop(), vm.stack.pop() vm.stack.append(valtype_from_boolean(first == second))
def op_checksig(vm, instr): if len(vm.stack) < 2: raise Exception("OP_CHECKSIG: Not enough arguments") pubkey = vm.stack.pop() sig = vm.stack.pop() vm.stack.append (valtype_from_boolean(checksig(vm, sig, pubkey) ))
def op_checksig(vm, instr): if len(vm.stack) < 2: raise Exception("OP_CHECKSIG: Not enough arguments") pubkey = vm.stack.pop() sig = vm.stack.pop() vm.stack.append(valtype_from_boolean(checksig(vm, sig, pubkey)))