Issue #2: Add previousHash to hashData
This commit is contained in:
parent
6aa5eec11a
commit
5cd5d32b8b
|
|
@ -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):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue