walker bugfix

This commit is contained in:
Tim
2024-04-04 00:03:58 -04:00
parent 9103bf4214
commit 328aea1213

View File

@@ -12,7 +12,7 @@ from dexorder.blockstate.fork import Fork, current_fork
from dexorder.blockstate.state import FinalizedBlockState
from dexorder.base.block import Block, BlockInfo, latest_block
from dexorder.progressor import BlockProgressor
from dexorder.util.async_util import Maywaitable
from dexorder.util.async_util import Maywaitable, maywait
log = logging.getLogger(__name__)
@@ -84,7 +84,7 @@ class BlockWalker (BlockProgressor):
self.flush_type=='blocks' and last_flush + self.flush_delay <= processed_height or \
self.flush_type=='time' and last_flush + self.flush_delay <= now():
if self.flush_callback is not None:
await self.flush_callback()
await maywait(self.flush_callback())
# flush height to db
db.kv[kv_key] = cur_height
if self.flush_type=='blocks':