Пример #1
0
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)))
Пример #2
0
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)))
Пример #3
0
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))
Пример #4
0
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) ))
Пример #5
0
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)))
Пример #6
0
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))