fix bug on empty db

This commit is contained in:
lza_menace 2023-02-02 13:34:41 -08:00
parent 29ead85025
commit 33a6a9b8a2

View File

@ -127,4 +127,7 @@ def get_highest_block(nettype, crypto):
Node.nettype == nettype,
Node.crypto == crypto
).order_by(Node.last_height.desc()).limit(1).first()
return highest.last_height
if highest:
return highest.last_height
else:
return 0