Added more peer count logs (#6865)

This commit is contained in:
Giulio rebuffo 2023-02-13 21:51:50 +01:00 committed by GitHub
parent cb6878cd7d
commit 7fb6d94a64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,10 +17,28 @@ func (l *LightClient) BootstrapCheckpoint(ctx context.Context, finalized [32]byt
logInterval := time.NewTicker(10 * time.Second) logInterval := time.NewTicker(10 * time.Second)
defer logInterval.Stop() defer logInterval.Stop()
doneLogCh := make(chan struct{})
var ( var (
b *cltypes.LightClientBootstrap b *cltypes.LightClientBootstrap
err error err error
) )
// Start log go routine.
go func() {
for {
select {
case <-logInterval.C:
peers, err := l.rpc.Peers()
if err != nil {
continue
}
log.Info("[Checkpoint Sync] P2P", "peers", peers)
case <-doneLogCh:
return
}
}
}()
for b == nil { for b == nil {
b, err = l.rpc.SendLightClientBootstrapReqV1(finalized) b, err = l.rpc.SendLightClientBootstrapReqV1(finalized)