diff options
author | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-12-09 16:03:22 +0800 |
---|---|---|
committer | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-12-10 16:53:25 +0800 |
commit | c57c54ce96628aeb6345776310123a80593f0143 (patch) | |
tree | 1d590f2f0aee32179a57eba5a4886f4296ab1196 /eth/handler.go | |
parent | c8130df1d9dcc504244a49cbb12aa4c2848e5de2 (diff) | |
download | dexon-c57c54ce96628aeb6345776310123a80593f0143.tar dexon-c57c54ce96628aeb6345776310123a80593f0143.tar.gz dexon-c57c54ce96628aeb6345776310123a80593f0143.tar.bz2 dexon-c57c54ce96628aeb6345776310123a80593f0143.tar.lz dexon-c57c54ce96628aeb6345776310123a80593f0143.tar.xz dexon-c57c54ce96628aeb6345776310123a80593f0143.tar.zst dexon-c57c54ce96628aeb6345776310123a80593f0143.zip |
eth, les: defer starting LES service until ETH initial sync is finished
Diffstat (limited to 'eth/handler.go')
-rw-r--r-- | eth/handler.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/eth/handler.go b/eth/handler.go index 8f05cc5b1..771e69b8d 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -87,6 +87,8 @@ type ProtocolManager struct { quitSync chan struct{} noMorePeers chan struct{} + lesServer LesServer + // wait group is used for graceful shutdowns during downloading // and processing wg sync.WaitGroup @@ -171,7 +173,7 @@ func NewProtocolManager(config *params.ChainConfig, fastSync bool, networkId int return blockchain.CurrentBlock().NumberU64() } inserter := func(blocks types.Blocks) (int, error) { - atomic.StoreUint32(&manager.synced, 1) // Mark initial sync done on any fetcher import + manager.setSynced() // Mark initial sync done on any fetcher import return manager.insertChain(blocks) } manager.fetcher = fetcher.New(blockchain.GetBlockByHash, validator, manager.BroadcastBlock, heighter, inserter, manager.removePeer) |