diff --git a/core/blockchain_pruner.go b/core/blockchain_pruner.go index 98a3fd6cd..0dbe6fb69 100644 --- a/core/blockchain_pruner.go +++ b/core/blockchain_pruner.go @@ -148,6 +148,10 @@ func (bp *blockchainPruner) pruneBeaconChainBlock(maxBlockNum uint64) (minKey [] } blockInfo := rawdb.ReadBlock(bp.db, hash, blockNum) + if blockInfo == nil { + return true + } + err := bp.deleteBlockInfo(blockInfo) if err != nil { utils.Logger().Error(). diff --git a/core/blockchain_pruner_meric.go b/core/blockchain_pruner_metric.go similarity index 100% rename from core/blockchain_pruner_meric.go rename to core/blockchain_pruner_metric.go diff --git a/node/node.go b/node/node.go index 2e026989c..d8cc5f39c 100644 --- a/node/node.go +++ b/node/node.go @@ -160,6 +160,8 @@ func (node *Node) Beaconchain() *core.BlockChain { isNotBeaconChainValidator := node.NodeConfig.Role() == nodeconfig.Validator && node.NodeConfig.ShardID != shard.BeaconChainShardID if isEnablePruneBeaconChain && isNotBeaconChainValidator { bc.EnablePruneBeaconChainFeature() + } else if isEnablePruneBeaconChain && !isNotBeaconChainValidator { + utils.Logger().Info().Msg("`IsEnablePruneBeaconChain` only available in validator node and shard 1-3") } return bc }