pull/4037/head^2
Lutty 3 years ago committed by Leo Chen
parent 622c0c6a44
commit 93ae61d6b5
  1. 4
      core/blockchain_pruner.go
  2. 0
      core/blockchain_pruner_metric.go
  3. 2
      node/node.go

@ -148,6 +148,10 @@ func (bp *blockchainPruner) pruneBeaconChainBlock(maxBlockNum uint64) (minKey []
} }
blockInfo := rawdb.ReadBlock(bp.db, hash, blockNum) blockInfo := rawdb.ReadBlock(bp.db, hash, blockNum)
if blockInfo == nil {
return true
}
err := bp.deleteBlockInfo(blockInfo) err := bp.deleteBlockInfo(blockInfo)
if err != nil { if err != nil {
utils.Logger().Error(). utils.Logger().Error().

@ -160,6 +160,8 @@ func (node *Node) Beaconchain() *core.BlockChain {
isNotBeaconChainValidator := node.NodeConfig.Role() == nodeconfig.Validator && node.NodeConfig.ShardID != shard.BeaconChainShardID isNotBeaconChainValidator := node.NodeConfig.Role() == nodeconfig.Validator && node.NodeConfig.ShardID != shard.BeaconChainShardID
if isEnablePruneBeaconChain && isNotBeaconChainValidator { if isEnablePruneBeaconChain && isNotBeaconChainValidator {
bc.EnablePruneBeaconChainFeature() bc.EnablePruneBeaconChainFeature()
} else if isEnablePruneBeaconChain && !isNotBeaconChainValidator {
utils.Logger().Info().Msg("`IsEnablePruneBeaconChain` only available in validator node and shard 1-3")
} }
return bc return bc
} }

Loading…
Cancel
Save