Issue #2: Add previousHash to hashData

This commit is contained in:
Axel Hanikel 2018-01-29 12:34:07 +01:00
parent 6aa5eec11a
commit 5cd5d32b8b
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ class Block:
self.hash = self.calculateHash() self.hash = self.calculateHash()
def calculateHash(self): def calculateHash(self):
hashData = str(self.index) + str(self.data) + self.timestamp + str(self.nonce) hashData = str(self.index) + str(self.data) + self.timestamp + self.previousHash + str(self.nonce)
return hashlib.sha256(hashData).hexdigest() return hashlib.sha256(hashData).hexdigest()
def mineBlock(self, difficulty): def mineBlock(self, difficulty):