cmd, eth, les: Performed gofmt to update formatting

This commit is contained in:
Lucas Hendren 2018-09-03 13:14:40 -04:00
parent 6d1305bdd9
commit c22c3825c2
4 changed files with 24 additions and 25 deletions

View file

@ -85,7 +85,7 @@ var (
utils.TxPoolGlobalQueueFlag, utils.TxPoolGlobalQueueFlag,
utils.TxPoolLifetimeFlag, utils.TxPoolLifetimeFlag,
utils.FastSyncFlag, utils.FastSyncFlag,
utils.ExitWhenSyncedFlag, utils.ExitWhenSyncedFlag,
utils.LightModeFlag, utils.LightModeFlag,
utils.SyncModeFlag, utils.SyncModeFlag,
@ -335,27 +335,26 @@ 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 >= 0 {
go func() { go func() {
if ctx.GlobalBool(utils.LightModeFlag.Name) || ctx.GlobalString(utils.SyncModeFlag.Name) == "light" { if ctx.GlobalBool(utils.LightModeFlag.Name) || ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
var lightEthereum *les.LightEthereum var lightEthereum *les.LightEthereum
if err := stack.Service(&lightEthereum); err != nil { if err := stack.Service(&lightEthereum); err != nil {
utils.Fatalf("LightEthereum service not running: %v", err) utils.Fatalf("LightEthereum service not running: %v", err)
} }
<-lightEthereum.Downloader().syncedCh <-lightEthereum.Downloader().syncedCh
log.Info("Synchronisation completed, exitting", "countdown", exitWhenSynced) log.Info("Synchronisation completed, exitting", "countdown", exitWhenSynced)
time.Sleep(exitWhenSynced) time.Sleep(exitWhenSynced)
stack.Stop() stack.Stop()
} else {
} else { var ethereum *eth.Ethereum
var ethereum *eth.Ethereum if err := stack.Service(&ethereum); err != nil {
if err := stack.Service(&ethereum); err != nil { utils.Fatalf("Ethereum service not running: %v", err)
utils.Fatalf("Ethereum service not running: %v", err) }
} <-ethereum.Downloader().syncedCh
<-ethereum.Downloader().syncedCh log.Info("Synchronisation completed, exitting", "countdown", exitWhenSynced)
log.Info("Synchronisation completed, exitting", "countdown", exitWhenSynced) time.Sleep(exitWhenSynced)
time.Sleep(exitWhenSynced) stack.Stop()
stack.Stop() }
}
}() }()
} }

View file

@ -158,7 +158,7 @@ var (
Value: DirectoryString{homeDir()}, Value: DirectoryString{homeDir()},
} }
ExitWhenSyncedFlag = cli.DurationFlag{ ExitWhenSyncedFlag = cli.DurationFlag{
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,
} }

View file

@ -227,7 +227,7 @@ func New(mode SyncMode, stateDb ethdb.Database, mux *event.TypeMux, chain BlockC
syncStatsState: stateSyncStats{ syncStatsState: stateSyncStats{
processed: rawdb.ReadFastTrieProgress(stateDb), processed: rawdb.ReadFastTrieProgress(stateDb),
}, },
syncedCh: make(chan bool, 1), syncedCh: make(chan bool, 1),
trackStateReq: make(chan *stateReq), trackStateReq: make(chan *stateReq),
} }
go dl.qosTuner() go dl.qosTuner()
@ -321,7 +321,7 @@ func (d *Downloader) Synchronise(id string, head common.Hash, td *big.Int, mode
case nil: case nil:
select { select {
case d.syncedCh <- true: case d.syncedCh <- true:
default: default:
} }
case errBusy: case errBusy: