Skip to content

Commit 93a3b96

Browse files
authored
Fix parsing of empty blocks (#1064)
1 parent 413920c commit 93a3b96

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

proxy/common_neon/solana_interactor.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,14 @@ def get_block_info_list(self, block_slot_list: List[int], commitment='confirmed'
393393

394394
response_list = self._send_rpc_batch_request('getBlock', request_list)
395395
for block_slot, response in zip(block_slot_list, response_list):
396-
if (not response) or ('result' not in response):
396+
if response is None:
397397
block = SolanaBlockInfo(block_slot=block_slot)
398398
else:
399399
net_block = response.get('result', None)
400-
block = self._decode_block_info(block_slot, net_block)
400+
if net_block is None:
401+
block = SolanaBlockInfo(block_slot=block_slot)
402+
else:
403+
block = self._decode_block_info(block_slot, net_block)
401404
block_list.append(block)
402405
return block_list
403406

0 commit comments

Comments
 (0)