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

@ -74,7 +74,7 @@ func NewLesServer(eth *eth.Ethereum, config *eth.Config) (*LesServer, error) {
nil,
quitSync,
new(sync.WaitGroup),
config.ULC)
config.ULC, eth.Synced)
if err != nil {
return nil, err
}
@ -243,6 +243,7 @@ func (s *LesServer) Stop() {
s.protocolManager.Stop()
}
// todo(rjl493456442) separate client and server implementation.
func (pm *ProtocolManager) blockLoop() {
pm.wg.Add(1)
headCh := make(chan core.ChainHeadEvent, 10)