From 1de226374daff48f7e05174df8ddf2570f67a4e7 Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Wed, 9 Oct 2019 17:33:41 +0100 Subject: [PATCH] Minot simulator updates --- test/simulator/bitcoind_sim.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/simulator/bitcoind_sim.py b/test/simulator/bitcoind_sim.py index 47248a1..b481b43 100644 --- a/test/simulator/bitcoind_sim.py +++ b/test/simulator/bitcoind_sim.py @@ -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()