diff --git a/server/block_processor.py b/server/block_processor.py index c3f16aa..1e661ac 100644 --- a/server/block_processor.py +++ b/server/block_processor.py @@ -224,6 +224,7 @@ class BlockProcessor(server.db.DB): if self.caught_up: # Flush everything as queries are performed on the DB and # not in-memory. + await asyncio.sleep(0) self.flush(True) self.client.notify(touched) elif time.time() > self.next_cache_check: @@ -498,43 +499,47 @@ class BlockProcessor(server.db.DB): self.write_undo_info(self.height, b''.join(undo_info)) def advance_txs(self, tx_hashes, txs, touched): - put_utxo = self.utxo_cache.__setitem__ - spend_utxo = self.spend_utxo undo_info = [] # Use local vars for speed in the loops history = self.history + history_size = self.history_size tx_num = self.tx_count script_hash168 = self.coin.hash168_from_script() s_pack = pack + put_utxo = self.utxo_cache.__setitem__ + spend_utxo = self.spend_utxo + undo_info_append = undo_info.append for tx, tx_hash in zip(txs, tx_hashes): hash168s = set() + add_hash168 = hash168s.add tx_numb = s_pack('