7311: Only attempt to remove headers on successful requests

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>
pull/7638/head
Matilda Clerke 1 month ago
parent 84b422c5ce
commit 8e6e2b0c87
  1. 2
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/DownloadReceiptsStep.java

@ -96,9 +96,9 @@ public class DownloadReceiptsStep
throw new IllegalStateException( throw new IllegalStateException(
"Unexpectedly got receipts for block header already populated!"); "Unexpectedly got receipts for block header already populated!");
})); }));
}
// remove all the headers we found receipts for // remove all the headers we found receipts for
headers.removeAll(getReceipts.keySet()); headers.removeAll(getReceipts.keySet());
}
// repeat until all headers have receipts // repeat until all headers have receipts
} while (!headers.isEmpty()); } while (!headers.isEmpty());
return CompletableFuture.completedFuture(getReceipts); return CompletableFuture.completedFuture(getReceipts);

Loading…
Cancel
Save