diff --git a/blockchain/miner.py b/blockchain/miner.py index 2a0a17daf..024156d65 100644 --- a/blockchain/miner.py +++ b/blockchain/miner.py @@ -1,6 +1,8 @@ import time + from blockchain.block import Blockchain + class Miner: def __init__(self, blockchain): self.blockchain = blockchain @@ -9,12 +11,12 @@ def mine_block(self, data): while True: if self.blockchain.is_chain_valid(self.blockchain.chain): self.blockchain.add_block(data) - print('Block successfully mined!') - print('Proof of work: {}'.format(self.blockchain.chain[-1].hash)) + print("Block successfully mined!") + print("Proof of work: {}".format(self.blockchain.chain[-1].hash)) break else: - print('Block not mined. Invalid chain.') + print("Block not mined. Invalid chain.") self.blockchain.chain = [self.blockchain.create_genesis_block()] self.blockchain.difficulty += 1 - print('New difficulty: {}'.format(self.blockchain.difficulty)) + print("New difficulty: {}".format(self.blockchain.difficulty)) time.sleep(1)