mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
cmd/geth, cmd/utils: Updated flag to use boolean
This commit is contained in:
parent
eeaef14de9
commit
41ebfe2d3c
2 changed files with 2 additions and 3 deletions
|
|
@ -333,7 +333,7 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
|||
}
|
||||
}()
|
||||
|
||||
if exitWhenSynced := ctx.GlobalDuration(utils.ExitWhenSyncedFlag.Name); exitWhenSynced >= 0 {
|
||||
if exitWhenSynced := ctx.GlobalDuration(utils.ExitWhenSyncedFlag.Name); exitWhenSynced == true {
|
||||
go func() {
|
||||
if ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
|
||||
var lightEthereum *les.LightEthereum
|
||||
|
|
@ -357,7 +357,6 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
|||
latest :=headers.Data.(*types.Header).Time
|
||||
if 600 >= time.Now().Unix()-latest.Int64() {
|
||||
log.Info("Synchronisation completed, checking", "check", exitWhenSynced)
|
||||
time.Sleep(exitWhenSynced)
|
||||
stack.Stop()
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ var (
|
|||
Usage: "Document Root for HTTPClient file scheme",
|
||||
Value: DirectoryString{homeDir()},
|
||||
}
|
||||
ExitWhenSyncedFlag = cli.DurationFlag{
|
||||
ExitWhenSyncedFlag = cli.BoolFlag{
|
||||
Name: "exitwhensynced",
|
||||
Usage: "Exists syncing by given time (default 0) after block synchronisation",
|
||||
Value: -1,
|
||||
|
|
|
|||
Loading…
Reference in a new issue