mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-11 05:20:05 +00:00
Added removeStreamHandler again (#6996)
This commit is contained in:
parent
c4ba26107e
commit
d6ba1b65c8
@ -94,7 +94,6 @@ func (l *LightClient) Start() {
|
||||
defer tx.Rollback()
|
||||
logPeers := time.NewTicker(time.Minute)
|
||||
|
||||
updateStatusSentinel := time.NewTicker(2 * time.Minute)
|
||||
go l.chainTip.StartLoop()
|
||||
for {
|
||||
start := time.Now()
|
||||
@ -219,14 +218,6 @@ func (l *LightClient) Start() {
|
||||
continue
|
||||
}
|
||||
log.Info("[LightClient] P2P", "peers", peers)
|
||||
case <-updateStatusSentinel.C:
|
||||
if err := l.updateStatus(); err != nil {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
return
|
||||
}
|
||||
log.Error("Could not update sentinel status", "err", err)
|
||||
return
|
||||
}
|
||||
case <-l.ctx.Done():
|
||||
return
|
||||
}
|
||||
@ -275,15 +266,3 @@ func (l *LightClient) importBlockIfPossible() {
|
||||
l.highestSeen = eth1Number
|
||||
}
|
||||
}
|
||||
|
||||
func (l *LightClient) updateStatus() error {
|
||||
finalizedRoot, err := l.store.finalizedHeader.HashSSZ()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
headRoot, err := l.store.optimisticHeader.HashSSZ()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return l.rpc.SetStatus(finalizedRoot, l.store.finalizedHeader.Slot/32, headRoot, l.store.optimisticHeader.Slot)
|
||||
}
|
||||
|
@ -208,6 +208,8 @@ func New(
|
||||
|
||||
s.handshaker = handshake.New(ctx, cfg.GenesisConfig, cfg.BeaconConfig, host, rule)
|
||||
|
||||
// removed IdDelta in recent version of libp2p
|
||||
host.RemoveStreamHandler("/p2p/id/delta/1.0.0")
|
||||
s.host = host
|
||||
s.peers = peers.New(s.host)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user