Skip to content

Commit

Permalink
Add TTD for mainnet.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdee committed Aug 28, 2022
1 parent 7332982 commit 4aa6207
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cmd/blockinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ func outputTimeToMerge(ctx context.Context,
ttds := map[uint64]*big.Int{
3: big.NewInt(50000000000000000),
11155111: big.NewInt(17000000000000000),
5: big.NewInt(10790000),
}
ttds[1], _ = new(big.Int).SetString("58750000000000000000000", 10)

if difficulty <= 0 {
return
Expand All @@ -195,8 +197,10 @@ func outputTimeToMerge(ctx context.Context,
left := new(big.Int).Sub(ttd, totalDifficulty)
blocksLeft := new(big.Int).Div(left, big.NewInt(int64(difficulty))).Int64()
timeLeft := time.Duration(blocksLeft*13) * time.Second
when := time.Now().Add(timeLeft)
builder.WriteString(fmt.Sprintf("Approximate merge time: %s (%v to go)\n", when.Format(time.RFC3339), timeLeft))
if timeLeft > 0 {
when := time.Now().Add(timeLeft)
builder.WriteString(fmt.Sprintf("Approximate merge time: %s (%v to go)\n", when.Format(time.RFC3339), timeLeft))
}
}

func outputUncles(builder *strings.Builder, uncles []types.Hash, verbose bool) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var versionCmd = &cobra.Command{
ethereal version.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("2.8.3")
fmt.Println("2.8.4")
if viper.GetBool("verbose") {
buildInfo, ok := dbg.ReadBuildInfo()
if ok {
Expand Down

0 comments on commit 4aa6207

Please sign in to comment.