pull/4024/head
Lutty 3 years ago committed by Leo Chen
parent 3634c43812
commit 55f8c769a0
  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)
if blockInfo == nil {
return true
}
err := bp.deleteBlockInfo(blockInfo)
if err != nil {
utils.Logger().Error().

@ -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
}

Loading…
Cancel
Save