Fast sync state error (#3261)

* Final commit to log and exit for fastSyncState.getPivotBlockHeader().get()

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Swarnim Pratap Singh <swarnimpratap132@gmail.com>

Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Co-authored-by: Swarnim Pratap Singh <swarnim132@gmail.com>
pull/3307/head
Swarnim Pratap Singh 3 years ago committed by GitHub
parent 0ed8240c52
commit 100630b04d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/worldstate/FastWorldStateDownloader.java

@ -107,6 +107,15 @@ public class FastWorldStateDownloader implements WorldStateDownloader {
return failed;
}
Optional<BlockHeader> checkNull =
Optional.ofNullable(fastSyncState.getPivotBlockHeader().get());
if (checkNull.isEmpty()) {
LOG.error("Pivot Block not present");
final CompletableFuture<Void> failed = new CompletableFuture<>();
failed.completeExceptionally(new NullPointerException("Pivot Block not present"));
return failed;
}
final BlockHeader header = fastSyncState.getPivotBlockHeader().get();
final Hash stateRoot = header.getStateRoot();
if (worldStateStorage.isWorldStateAvailable(stateRoot, header.getHash())) {

Loading…
Cancel
Save