diff options
-rw-r--r-- | cmd/geth/chaincmd.go | 7 | ||||
-rw-r--r-- | eth/handler.go | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 876b8c6ba..c42045918 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -115,17 +115,16 @@ func exportChain(ctx *cli.Context) { } func removeDB(ctx *cli.Context) { - confirm, err := utils.PromptConfirm("Remove local databases?") + confirm, err := utils.PromptConfirm("Remove local database?") if err != nil { utils.Fatalf("%v", err) } if confirm { - fmt.Println("Removing chain and state databases...") + fmt.Println("Removing chaindata...") start := time.Now() - os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "blockchain")) - os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "state")) + os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "chaindata")) fmt.Printf("Removed in %v\n", time.Since(start)) } else { diff --git a/eth/handler.go b/eth/handler.go index 2bd369901..5d233dd96 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -413,10 +413,12 @@ func (pm *ProtocolManager) handleMsg(p *peer) error { pm.fetcher.Enqueue(p.id, request.Block) - // TODO: Schedule a sync to cover potential gaps (this needs proto update) + // Update the peers total difficulty if needed, schedule a download if gapped if request.TD.Cmp(p.Td()) > 0 { p.SetTd(request.TD) - go pm.synchronise(p) + if request.TD.Cmp(new(big.Int).Add(pm.chainman.Td(), request.Block.Difficulty())) > 0 { + go pm.synchronise(p) + } } case TxMsg: |