示例#1
0
    def calculate_hash(self):
        # increase the sequence to avoid 2 identical transactions having the same hash

        message = self.sender + self.recipient + str(self.value) + str(
            self.sequence)

        return sha256(message)
示例#2
0
    def calculate_hash(self):
        # increase the sequence to avoid 2 identical transactions having the same hash
        seq = Sequence.objects.all()[0]
        seq.value += 1
        seq.save()

        message = self.sender + self.recipient + str(self.value) + str(
            seq.value)

        return sha256(message)
示例#3
0
    def calculate_hash(self):

        message = self.get_message()
        return sha256(message)
示例#4
0
 def calculate_hash(self):
     message = self.recipient + str(self.value) + self.parent_transaction.id
     return sha256(message)