checkpointDownloadBlockStep returns empty optional if we are missing receipts (#4040)

Signed-off-by: garyschulte <garyschulte@gmail.com>
pull/4044/head
garyschulte 2 years ago committed by GitHub
parent 3baa4da99e
commit c0be6979d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/checkpointsync/CheckpointDownloadBlockStep.java

@ -71,10 +71,10 @@ public class CheckpointDownloadBlockStep {
.run()
.thenCompose(
receiptTaskResult -> {
final List<TransactionReceipt> transactionReceipts =
receiptTaskResult.getResult().get(block.getHeader());
final Optional<List<TransactionReceipt>> transactionReceipts =
Optional.ofNullable(receiptTaskResult.getResult().get(block.getHeader()));
return CompletableFuture.completedFuture(
Optional.of(new BlockWithReceipts(block, transactionReceipts)));
transactionReceipts.map(receipts -> new BlockWithReceipts(block, receipts)));
})
.exceptionally(throwable -> Optional.empty());
}

Loading…
Cancel
Save