Skip to content

Commit

Permalink
historysegment: add testnet&mainnet hard code;
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbundler committed Dec 8, 2023
1 parent 62a15c9 commit 64fb34f
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,19 +736,18 @@ func exportSegment(ctx *cli.Context) error {
boundStartBlock = params.BoundStartBlock
historySegmentLength = params.HistorySegmentLength
)
// TODO(0xbundler): for testing
//switch genesisHash {
//case params.BSCGenesisHash, params.ChapelGenesisHash, params.RialtoGenesisHash:
// boundStartBlock = params.BoundStartBlock
// historySegmentLength = params.HistorySegmentLength
//default:
if ctx.IsSet(utils.BoundStartBlockFlag.Name) {
boundStartBlock = ctx.Uint64(utils.BoundStartBlockFlag.Name)
}
if ctx.IsSet(utils.HistorySegmentLengthFlag.Name) {
historySegmentLength = ctx.Uint64(utils.HistorySegmentLengthFlag.Name)
}
//}
switch genesisHash {
case params.BSCGenesisHash, params.ChapelGenesisHash, params.RialtoGenesisHash:
boundStartBlock = params.BoundStartBlock
historySegmentLength = params.HistorySegmentLength
default:
if ctx.IsSet(utils.BoundStartBlockFlag.Name) {
boundStartBlock = ctx.Uint64(utils.BoundStartBlockFlag.Name)
}
if ctx.IsSet(utils.HistorySegmentLengthFlag.Name) {
historySegmentLength = ctx.Uint64(utils.HistorySegmentLengthFlag.Name)
}
}
if boundStartBlock == 0 || historySegmentLength == 0 {
return fmt.Errorf("wrong params, boundStartBlock: %v, historySegmentLength: %v", boundStartBlock, historySegmentLength)
}
Expand Down

0 comments on commit 64fb34f

Please sign in to comment.