walker bugfix
This commit is contained in:
@@ -12,7 +12,7 @@ from dexorder.blockstate.fork import Fork, current_fork
|
|||||||
from dexorder.blockstate.state import FinalizedBlockState
|
from dexorder.blockstate.state import FinalizedBlockState
|
||||||
from dexorder.base.block import Block, BlockInfo, latest_block
|
from dexorder.base.block import Block, BlockInfo, latest_block
|
||||||
from dexorder.progressor import BlockProgressor
|
from dexorder.progressor import BlockProgressor
|
||||||
from dexorder.util.async_util import Maywaitable
|
from dexorder.util.async_util import Maywaitable, maywait
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
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=='blocks' and last_flush + self.flush_delay <= processed_height or \
|
||||||
self.flush_type=='time' and last_flush + self.flush_delay <= now():
|
self.flush_type=='time' and last_flush + self.flush_delay <= now():
|
||||||
if self.flush_callback is not None:
|
if self.flush_callback is not None:
|
||||||
await self.flush_callback()
|
await maywait(self.flush_callback())
|
||||||
# flush height to db
|
# flush height to db
|
||||||
db.kv[kv_key] = cur_height
|
db.kv[kv_key] = cur_height
|
||||||
if self.flush_type=='blocks':
|
if self.flush_type=='blocks':
|
||||||
|
|||||||
Reference in New Issue
Block a user