eth, les: reject light client connection is server is not synced (#19616)

* eth, les: reject light client connection is server is not synced

* eth, les: rename function and variables

* les: format
This commit is contained in:
gary rong
2019-05-27 00:15:05 +08:00
committed by Péter Szilágyi
parent 922e757f19
commit 4e0c1a1a6b
8 changed files with 71 additions and 31 deletions

View File

@ -480,6 +480,7 @@ func (s *Ethereum) IsListening() bool { return true } // Always
func (s *Ethereum) EthVersion() int { return int(s.protocolManager.SubProtocols[0].Version) }
func (s *Ethereum) NetVersion() uint64 { return s.networkID }
func (s *Ethereum) Downloader() *downloader.Downloader { return s.protocolManager.downloader }
func (s *Ethereum) Synced() bool { return atomic.LoadUint32(&s.protocolManager.acceptTxs) == 1 }
// Protocols implements node.Service, returning all the currently configured
// network protocols to start.