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)
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)
def calculate_hash(self): message = self.get_message() return sha256(message)
def calculate_hash(self): message = self.recipient + str(self.value) + self.parent_transaction.id return sha256(message)