mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 14:35:45 +00:00
added proper corner case handling in case a requested block is not found
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
34c4da2184
commit
b3d6b07c93
@ -306,6 +306,8 @@ def get_spending_transactions(connection, inputs):
|
||||
@register_query(TarantoolDBConnection)
|
||||
def get_block(connection, block_id=None):
|
||||
_block = connection.run(connection.space("blocks").select(block_id, index="height", limit=1))
|
||||
if len(_block) == 0:
|
||||
return
|
||||
_block = Block.from_tuple(_block[0])
|
||||
return _block.to_dict()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user