Yield more during mempool load

This commit is contained in:
Neil Booth 2016-11-14 23:12:50 +09:00
parent 1830cae3de
commit 95cc979465

View File

@ -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: