Skip to content

Commit

Permalink
return failed Future when BWS is invoked but not ready
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Jan 24, 2024
1 parent 90558fd commit 5be17b4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public synchronized CompletableFuture<Void> syncBackwardsUntil(final Hash newBlo
newTargetBlock -> status.updateTargetHeight(newTargetBlock.getHeader().getNumber()));
return status.currentFuture;
} else {
return CompletableFuture.completedFuture(null);
return CompletableFuture.failedFuture(new Throwable("Backward sync is not ready"));
}
}

Expand All @@ -151,7 +151,7 @@ public synchronized CompletableFuture<Void> syncBackwardsUntil(final Block newPi
status.updateTargetHeight(newPivot.getHeader().getNumber());
return status.currentFuture;
} else {
return CompletableFuture.completedFuture(null);
return CompletableFuture.failedFuture(new Throwable("Backward sync is not ready"));
}
}

Expand Down

0 comments on commit 5be17b4

Please sign in to comment.