Skip to content

Commit

Permalink
[dag block indexer] fixed getting parents error for DFS algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
welbon committed Jun 26, 2024
1 parent 62b1f1d commit 15fdd63
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ protected void executeInternal(JobExecutionContext jobExecutionContext) {
return;
}

// fetchAndProcessBlockSequel();
fetchAndProcessBlocksParallel();
fetchAndProcessBlockSequel();
// fetchAndProcessBlocksParallel();
}

public void fetchAndProcessBlocksParallel() {
Expand Down Expand Up @@ -186,8 +186,14 @@ public void fetchAndProcessBlockSequel() {
}
}

void fetchParentsBlock(Block block, Set<String> visit, Deque<Block> deque, List<Block> blockList, long minHeight) throws JSONRPC2SessionException {
for (String parent : block.getBlockMetadata().getParentsHash()) {
void fetchParentsBlock(
Block block,
Set<String> visit,
Deque<Block> deque,
List<Block> blockList,
long minHeight
) throws JSONRPC2SessionException {
for (String parent : block.getHeader().getParentsHash()) {
if (!visit.contains(parent)) {
visit.add(parent);
Block block_parent = elasticSearchHandler.getBlockContent(parent);
Expand Down

0 comments on commit 15fdd63

Please sign in to comment.