Skip to content

Commit

Permalink
Halt the chain download when the future is cancelled (or otherwise co…
Browse files Browse the repository at this point in the history
…mpleted). (PegaSysEng#901)
  • Loading branch information
ajsutton authored and tmohay committed Feb 20, 2019
1 parent fda78b7 commit 92bb480
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ public CompletableFuture<?> getCurrentTask() {
return currentTask;
}

private CompletableFuture<?> executeDownload() {
private void executeDownload() {
if (downloadFuture.isDone()) {
return;
}
// Find target, pull checkpoint headers, import, repeat
currentTask =
waitForPeers()
Expand Down Expand Up @@ -124,7 +127,6 @@ private CompletableFuture<?> executeDownload() {
downloadFuture.complete(null);
}
});
return currentTask;
}

private CompletableFuture<List<BlockHeader>> pullCheckpointHeaders(final SyncTarget syncTarget) {
Expand Down

0 comments on commit 92bb480

Please sign in to comment.