_get_clear_mempool_ops
This commit is contained in:
parent
869fc1698c
commit
e4ac106b98
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,))
|
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(
|
# clear the mempool tx index
|
||||||
start=(b'\x00' * 20, ), stop=(b'\xff' * 20, ), deserialize_key=False, deserialize_value=False):
|
self._get_clear_mempool_ops()
|
||||||
self.db.prefix_db.stage_raw_delete(k, v)
|
|
||||||
|
|
||||||
for hashX, new_history in self.hashXs_by_tx.items():
|
for hashX, new_history in self.hashXs_by_tx.items():
|
||||||
# TODO: combine this with compaction so that we only read the history once
|
# TODO: combine this with compaction so that we only read the history once
|
||||||
|
@ -1450,6 +1449,12 @@ class BlockchainProcessorService(BlockchainService):
|
||||||
# print("*************\n")
|
# print("*************\n")
|
||||||
return txo_count
|
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):
|
def clear_after_advance_or_reorg(self):
|
||||||
self.txo_to_claim.clear()
|
self.txo_to_claim.clear()
|
||||||
self.claim_hash_to_txo.clear()
|
self.claim_hash_to_txo.clear()
|
||||||
|
|
Loading…
Reference in a new issue