Cleaned code

This commit is contained in:
Daxeel Soni 2018-01-29 17:54:02 +05:30 committed by GitHub
parent 6aa5eec11a
commit ab402814e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import datetime
import json import json
from colorama import Fore, Back, Style from colorama import Fore, Back, Style
import time import time
import sys
# index, timestamp, previousHash, blockHash, data # index, timestamp, previousHash, blockHash, data
@ -26,6 +27,8 @@ class Block:
while self.hash[:difficulty] != "0"*difficulty: while self.hash[:difficulty] != "0"*difficulty:
self.nonce += 1 self.nonce += 1
self.hash = self.calculateHash() self.hash = self.calculateHash()
sys.stdout.write(self.hash)
sys.stdout.flush()
endTime = time.time() endTime = time.time()
print Back.BLUE + "[ Info ] Time Elapsed : " + str(endTime - startTime) + " seconds." print Back.BLUE + "[ Info ] Time Elapsed : " + str(endTime - startTime) + " seconds."