Merge pull request #3 from ahanikel/issues/2
Issue #2: Add previousHash to hashData
This commit is contained in:
commit
bee9675c25
|
|
@ -17,7 +17,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