Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 2_bitcoin_mining/bitcoin_mining.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def mine(block_number, transactions, previous_hash, prefix_zeros):
print(f"Yay! Successfully mined bitcoins with nonce value:{nonce}")
return new_hash

raise BaseException(f"Couldn't find correct has after trying {MAX_NONCE} times")
raise BaseException(f"Couldn't find correct hash after trying {MAX_NONCE} times")

if __name__=='__main__':
transactions='''
Expand All @@ -27,4 +27,4 @@ def mine(block_number, transactions, previous_hash, prefix_zeros):
new_hash = mine(5,transactions,'0000000xa036944e29568d0cff17edbe038f81208fecf9a66be9a2b8321c6ec7', difficulty)
total_time = str((time.time() - start))
print(f"end mining. Mining took: {total_time} seconds")
print(new_hash)
print(new_hash)