From 95cc97946566daae231b73074d40311d23594662 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Mon, 14 Nov 2016 23:12:50 +0900 Subject: [PATCH] Yield more during mempool load --- server/block_processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/block_processor.py b/server/block_processor.py index afc97ff..9a89314 100644 --- a/server/block_processor.py +++ b/server/block_processor.py @@ -215,7 +215,7 @@ class MemPool(LoggedClass): for n, (hex_hash, tx) in enumerate(new_txs.items()): # Yield to process e.g. signals - if n % 500 == 0: + if n % 100 == 0: await asyncio.sleep(0) txout_pairs = [txout_pair(txout) for txout in tx.outputs] self.txs[hex_hash] = (None, txout_pairs, None) @@ -236,7 +236,7 @@ class MemPool(LoggedClass): # Now add the inputs for n, (hex_hash, tx) in enumerate(new_txs.items()): # Yield to process e.g. signals - if n % 50 == 0: + if n % 10 == 0: await asyncio.sleep(0) if initial and time.time() > next_log: