connector
This commit is contained in:
parent
616e1c97e8
commit
42ab1ce174
@ -78,8 +78,8 @@ class Connector:
|
|||||||
|
|
||||||
# cache and system
|
# cache and system
|
||||||
self.preload = preload
|
self.preload = preload
|
||||||
self.block_preload = Cache(max_size=200 * 1000000)
|
self.block_preload = Cache(max_size=500 * 1000000)
|
||||||
self.block_hashes = Cache(max_size=20 * 100000)
|
self.block_hashes = Cache(max_size=200 * 100000)
|
||||||
self.block_hashes_preload_mutex = False
|
self.block_hashes_preload_mutex = False
|
||||||
self.tx_cache = Cache(max_size=100 * 1000000)
|
self.tx_cache = Cache(max_size=100 * 1000000)
|
||||||
self.block_cache = Cache(max_size=20 * 1000000)
|
self.block_cache = Cache(max_size=20 * 1000000)
|
||||||
@ -628,9 +628,8 @@ class Connector:
|
|||||||
processed_height = self.last_block_height
|
processed_height = self.last_block_height
|
||||||
|
|
||||||
while height < max_height:
|
while height < max_height:
|
||||||
if height - self.last_block_height < self.batch_limit * 10:
|
if self.block_preload._store_size < 400 * 1000000:
|
||||||
try:
|
try:
|
||||||
|
|
||||||
if height < self.last_block_height:
|
if height < self.last_block_height:
|
||||||
height = self.last_block_height + 1
|
height = self.last_block_height + 1
|
||||||
# self.log.critical(str((height, processed_height, self.last_block_height,
|
# self.log.critical(str((height, processed_height, self.last_block_height,
|
||||||
@ -670,13 +669,13 @@ class Connector:
|
|||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
if processed_height < self.last_block_height:
|
if processed_height < self.last_block_height:
|
||||||
for i in range(processed_height, self.last_block_height):
|
for i in range(processed_height, self.last_block_height):
|
||||||
self.block_preload.remove(i)
|
self.block_preload.remove(i)
|
||||||
processed_height = self.last_block_height
|
processed_height = self.last_block_height
|
||||||
if self.block_preload._store_size < 190 * 1000000:
|
if self.block_preload._store_size < 400 * 1000000:
|
||||||
continue
|
continue
|
||||||
self.log.critical(str((processed_height, self.last_block_height)))
|
self.log.critical(str((processed_height, self.last_block_height)))
|
||||||
|
|
||||||
await asyncio.sleep(10)
|
await asyncio.sleep(10)
|
||||||
# remove unused items
|
# remove unused items
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user