Expose --index_address_statuses
setting and improve first sync performance #35
1 changed files with 8 additions and 3 deletions
|
@ -1395,9 +1395,8 @@ class BlockchainProcessorService(BlockchainService):
|
|||
|
||||
self.db.prefix_db.tx_count.stage_put(key_args=(height,), value_args=(tx_count,))
|
||||
|
||||
for k, v in self.db.prefix_db.hashX_mempool_status.iterate(
|
||||
start=(b'\x00' * 20, ), stop=(b'\xff' * 20, ), deserialize_key=False, deserialize_value=False):
|
||||
self.db.prefix_db.stage_raw_delete(k, v)
|
||||
# clear the mempool tx index
|
||||
self._get_clear_mempool_ops()
|
||||
|
||||
for hashX, new_history in self.hashXs_by_tx.items():
|
||||
# TODO: combine this with compaction so that we only read the history once
|
||||
|
@ -1450,6 +1449,12 @@ class BlockchainProcessorService(BlockchainService):
|
|||
# print("*************\n")
|
||||
return txo_count
|
||||
|
||||
def _get_clear_mempool_ops(self):
|
||||
self.db.prefix_db.multi_delete(
|
||||
list(self.db.prefix_db.hashX_mempool_status.iterate(start=(b'\x00' * 20, ), stop=(b'\xff' * 20, ),
|
||||
deserialize_key=False, deserialize_value=False))
|
||||
)
|
||||
|
||||
def clear_after_advance_or_reorg(self):
|
||||
self.txo_to_claim.clear()
|
||||
self.claim_hash_to_txo.clear()
|
||||
|
|
Loading…
Reference in a new issue