Tweak mempool code
Precede 2 private functions with _. Removed unused arg.
This commit is contained in:
parent
80caa1c4ea
commit
c764d1de18
@ -49,7 +49,7 @@ class MemPool(util.LoggedClass):
|
|||||||
initial mempool sync.'''
|
initial mempool sync.'''
|
||||||
self.prioritized.add(tx_hash)
|
self.prioritized.add(tx_hash)
|
||||||
|
|
||||||
def resync_daemon_hashes(self, unprocessed, unfetched):
|
def _resync_daemon_hashes(self, unprocessed, unfetched):
|
||||||
'''Re-sync self.txs with the list of hashes in the daemon's mempool.
|
'''Re-sync self.txs with the list of hashes in the daemon's mempool.
|
||||||
|
|
||||||
Additionally, remove gone hashes from unprocessed and
|
Additionally, remove gone hashes from unprocessed and
|
||||||
@ -90,7 +90,7 @@ class MemPool(util.LoggedClass):
|
|||||||
unfetched = set()
|
unfetched = set()
|
||||||
txs = self.txs
|
txs = self.txs
|
||||||
fetch_size = 800
|
fetch_size = 800
|
||||||
process_some = self.async_process_some(unfetched, fetch_size // 2)
|
process_some = self._async_process_some(fetch_size // 2)
|
||||||
|
|
||||||
await self.daemon.mempool_refresh_event.wait()
|
await self.daemon.mempool_refresh_event.wait()
|
||||||
self.logger.info('beginning processing of daemon mempool. '
|
self.logger.info('beginning processing of daemon mempool. '
|
||||||
@ -122,7 +122,7 @@ class MemPool(util.LoggedClass):
|
|||||||
self.prioritized.clear()
|
self.prioritized.clear()
|
||||||
await self.daemon.mempool_refresh_event.wait()
|
await self.daemon.mempool_refresh_event.wait()
|
||||||
|
|
||||||
self.resync_daemon_hashes(unprocessed, unfetched)
|
self._resync_daemon_hashes(unprocessed, unfetched)
|
||||||
self.daemon.mempool_refresh_event.clear()
|
self.daemon.mempool_refresh_event.clear()
|
||||||
|
|
||||||
if unfetched:
|
if unfetched:
|
||||||
@ -139,7 +139,7 @@ class MemPool(util.LoggedClass):
|
|||||||
self.stop = True
|
self.stop = True
|
||||||
break
|
break
|
||||||
|
|
||||||
def async_process_some(self, unfetched, limit):
|
def _async_process_some(self, limit):
|
||||||
pending = []
|
pending = []
|
||||||
txs = self.txs
|
txs = self.txs
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user