def highest_block(cls, session):
"""
Return integer result of MAX(block_num) db query.
This does not have the same meaning as last irreversible block, ie, it
makes no claim that the all blocks lower than the MAX(block_num) exist
in the database.
Args:
session (sqlalchemy.orm.session.Session):
Returns:
int:
"""
highest = session.query(func.max(cls.block_num)).scalar()
if not highest:
return 0
else:
return highest
评论列表
文章目录