Example #1
0
 def verify(self, index, lock_script, block_timestamp):
     outpoint, unlock_script, sequence = self.inputs[index]
     if block_timestamp >= 1333238400:
         m = verifying_machine_p2sh(self, index, KEY)
     else:
         m = verifying_machine(self, index, KEY)
     m.eval_script(unlock_script, lock_script)
Example #2
0
 def verify (self, index, lock_script, block_timestamp):
     outpoint, unlock_script, sequence = self.inputs[index]
     if block_timestamp >= 1333238400:
         m = verifying_machine_p2sh (self, index, KEY)
     else:
         m = verifying_machine (self, index, KEY)
     m.eval_script (unlock_script, lock_script)
Example #3
0
 def verify (self, index, lock_script, block_timestamp):
     outpoint, unlock_script, sequence = self.inputs[index]
     if block_timestamp >= 1333238400:
         m = verifying_machine_p2sh (self, index, KEY)
     else:
         m = verifying_machine (self, index, KEY)
     r = m.eval_script (lock_script, unlock_script)
     if r is None:
         # if the script did not end in a CHECKSIG op, we need
         #   to check the top of the stack (essentially, OP_VERIFY)
         m.need (1)
         if not m.truth():
             raise VerifyError
     elif r == 1:
         pass
     else:
         # this can happen if r == 0 (verify failed) or r == -1 (openssl error)
         raise VerifyError
Example #4
0
 def verify0 (self, index, prev_outscript):
     outpoint, script, sequence = self.inputs[index]
     m = verifying_machine (prev_outscript, self, index)
     #print 'source script', pprint_script (parse_script (script))
     eval_script (m, parse_script (script))
     m.clear_alt()
     # should terminate with OP_CHECKSIG or its like
     #print 'redeem script', pprint_script (parse_script (prev_outscript))
     r = eval_script (m, parse_script (prev_outscript))
     if r is None:
         # if the script did not end in a CHECKSIG op, we need
         #   to check the top of the stack (essentially, OP_VERIFY)
         m.need (1)
         if not m.truth():
             raise VerifyError
     elif r == 1:
         pass
     else:
         # this can happen if r == 0 (verify failed) or r == -1 (openssl error)
         raise VerifyError
Example #5
0
 def verify0(self, index, prev_outscript):
     outpoint, script, sequence = self.inputs[index]
     m = verifying_machine(prev_outscript, self, index)
     #print 'source script', pprint_script (parse_script (script))
     eval_script(m, parse_script(script))
     m.clear_alt()
     # should terminate with OP_CHECKSIG or its like
     #print 'redeem script', pprint_script (parse_script (prev_outscript))
     r = eval_script(m, parse_script(prev_outscript))
     if r is None:
         # if the script did not end in a CHECKSIG op, we need
         #   to check the top of the stack (essentially, OP_VERIFY)
         m.need(1)
         if not m.truth():
             raise VerifyError
     elif r == 1:
         pass
     else:
         # this can happen if r == 0 (verify failed) or r == -1 (openssl error)
         raise VerifyError