From 8da55b9f16fb80287bdef28658d18a35b2f90401 Mon Sep 17 00:00:00 2001 From: Sahil Date: Fri, 31 May 2024 18:23:13 -0400 Subject: [PATCH] fixed the ordering for get_ordered_blocks by adding sorting to indexes --- blockchain_parser/blockchain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockchain_parser/blockchain.py b/blockchain_parser/blockchain.py index 23e7411..3281b05 100644 --- a/blockchain_parser/blockchain.py +++ b/blockchain_parser/blockchain.py @@ -206,7 +206,7 @@ def get_ordered_blocks(self, index, start=0, end=None, cache=None): # that have been confirmed # (or are new enough that they haven't yet been confirmed) blockIndexes = list(filter(lambda block: block.hash not in stale_blocks, blockIndexes)) - + blockIndexes.sort(key= lambda b: b.height) if end is None: end = len(blockIndexes)