From 15fdd63d1a607e9809ee6bbcec2b3d6d81a5814a Mon Sep 17 00:00:00 2001 From: Bob Ong Date: Wed, 26 Jun 2024 19:09:44 +0800 Subject: [PATCH] [dag block indexer] fixed getting parents error for DFS algorithm --- .../indexer/handler/DagInspectorIndexer.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/starcoin-indexer/src/main/java/org/starcoin/indexer/handler/DagInspectorIndexer.java b/starcoin-indexer/src/main/java/org/starcoin/indexer/handler/DagInspectorIndexer.java index 2b79ec7..4b3cc17 100644 --- a/starcoin-indexer/src/main/java/org/starcoin/indexer/handler/DagInspectorIndexer.java +++ b/starcoin-indexer/src/main/java/org/starcoin/indexer/handler/DagInspectorIndexer.java @@ -81,8 +81,8 @@ protected void executeInternal(JobExecutionContext jobExecutionContext) { return; } - // fetchAndProcessBlockSequel(); - fetchAndProcessBlocksParallel(); + fetchAndProcessBlockSequel(); + // fetchAndProcessBlocksParallel(); } public void fetchAndProcessBlocksParallel() { @@ -186,8 +186,14 @@ public void fetchAndProcessBlockSequel() { } } - void fetchParentsBlock(Block block, Set visit, Deque deque, List blockList, long minHeight) throws JSONRPC2SessionException { - for (String parent : block.getBlockMetadata().getParentsHash()) { + void fetchParentsBlock( + Block block, + Set visit, + Deque deque, + List blockList, + long minHeight + ) throws JSONRPC2SessionException { + for (String parent : block.getHeader().getParentsHash()) { if (!visit.contains(parent)) { visit.add(parent); Block block_parent = elasticSearchHandler.getBlockContent(parent);