fix positioning when multiple blocks in one fork

This commit is contained in:
Victor Oliva
2024-10-31 08:44:21 +01:00
parent b6040c7518
commit c974870311
+2 -2
View File
@@ -89,9 +89,9 @@ const blockTable$ = blocksByHeight$.pipeState(
if (height === best.number) {
competingBlocks.sort((a) => (a.hash === best.hash ? -1 : 1))
} else {
competingBlocks.sort((a) =>
competingBlocks.sort((a, b) =>
(blockPositions[a.hash] ?? Number.POSITIVE_INFINITY) <
(blockPositions[best.hash] ?? Number.POSITIVE_INFINITY)
(blockPositions[b.hash] ?? Number.POSITIVE_INFINITY)
? -1
: 1,
)