Updates os.urandom to python3

All string generated with urandom(x) were using binascii + os.urandom + encode. In python3 os.urandom has a hex method.
This commit is contained in:
Sergi Delgado Segura
2019-10-07 11:39:10 +01:00
parent beac88a2c5
commit 5ae210d893
5 changed files with 13 additions and 15 deletions

View File

@@ -172,8 +172,8 @@ def simulate_mining():
prev_block_hash = None
while True:
block_hash = binascii.hexlify(os.urandom(32)).decode('utf-8')
coinbase_tx_hash = binascii.hexlify(os.urandom(32)).decode('utf-8')
block_hash = os.urandom(32).hex()
coinbase_tx_hash = os.urandom(32).hex()
txs_to_mine = [coinbase_tx_hash]
if len(mempool) != 0: