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() {
|
go func() {
|
||||||
if ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
|
if ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
|
||||||
var lightEthereum *les.LightEthereum
|
var lightEthereum *les.LightEthereum
|
||||||
|
|
@ -357,7 +357,6 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
||||||
latest :=headers.Data.(*types.Header).Time
|
latest :=headers.Data.(*types.Header).Time
|
||||||
if 600 >= time.Now().Unix()-latest.Int64() {
|
if 600 >= time.Now().Unix()-latest.Int64() {
|
||||||
log.Info("Synchronisation completed, checking", "check", exitWhenSynced)
|
log.Info("Synchronisation completed, checking", "check", exitWhenSynced)
|
||||||
time.Sleep(exitWhenSynced)
|
|
||||||
stack.Stop()
|
stack.Stop()
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ var (
|
||||||
Usage: "Document Root for HTTPClient file scheme",
|
Usage: "Document Root for HTTPClient file scheme",
|
||||||
Value: DirectoryString{homeDir()},
|
Value: DirectoryString{homeDir()},
|
||||||
}
|
}
|
||||||
ExitWhenSyncedFlag = cli.DurationFlag{
|
ExitWhenSyncedFlag = cli.BoolFlag{
|
||||||
Name: "exitwhensynced",
|
Name: "exitwhensynced",
|
||||||
Usage: "Exists syncing by given time (default 0) after block synchronisation",
|
Usage: "Exists syncing by given time (default 0) after block synchronisation",
|
||||||
Value: -1,
|
Value: -1,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue