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

View file

@ -158,7 +158,7 @@ var (
Value: DirectoryString{homeDir()},
}
ExitWhenSyncedFlag = cli.DurationFlag{
Name: "exitwhensynced",
Name: "exitwhensynced",
Usage: "Exists syncing by given time (default 0) after block synchronisation",
Value: -1,
}

View file

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