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 080828f commit 39bf075
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 15 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
Loading

0 comments on commit 39bf075

Please sign in to comment.