Minot simulator updates

This commit is contained in:
Sergi Delgado Segura
2019-10-09 17:33:41 +01:00
parent b69ffdc0aa
commit 1de226374d

View File

@@ -15,14 +15,12 @@ app = Flask(__name__)
HOST = 'localhost'
PORT = '18443'
mining_simulator = ZMQPublisher(topic=b'hashblock', feed_protocol=FEED_PROTOCOL, feed_addr=FEED_ADDR,
feed_port=FEED_PORT)
TIME_BETWEEN_BLOCKS = 10
mempool = []
mined_transactions = {}
blocks = {}
blockchain = []
TIME_BETWEEN_BLOCKS = 10
@app.route('/', methods=['POST'])
@@ -185,6 +183,9 @@ def simulate_mining():
global mempool, mined_transactions, blocks, blockchain
prev_block_hash = None
mining_simulator = ZMQPublisher(topic=b'hashblock', feed_protocol=FEED_PROTOCOL, feed_addr=FEED_ADDR,
feed_port=FEED_PORT)
while True:
block_hash = os.urandom(32).hex()
coinbase_tx_hash = os.urandom(32).hex()