Пример #1
0
 def __hash__(self):
     if len(self.instructions):
         #return the hash of the first pushdata instruction
         for instr in self.instructions:
             if is_pushdata(instr.opcode):
                 return hash(self.instruction[0])
         #or the hash of the first instruction if there is no pushdata
         return hash(self.instruction[0])
     return 0
Пример #2
0
def normalize_pushdata(opcodes):
    return [(is_pushdata(op) and OP_PUSHDATA or op) for op in opcodes]
Пример #3
0
 def is_pushdata(self):
     return is_pushdata(self.opcode)
Пример #4
0
 def is_pushdata(self):
     return is_pushdata(self.opcode)
Пример #5
0
def normalize_pushdata(opcodes):
    return [(is_pushdata(op) and OP_PUSHDATA or op) for op in opcodes]