diff --git a/cmd/lightclient/lightclient/checkpoint.go b/cmd/lightclient/lightclient/checkpoint.go index b9c0e438f..2960dde52 100644 --- a/cmd/lightclient/lightclient/checkpoint.go +++ b/cmd/lightclient/lightclient/checkpoint.go @@ -17,10 +17,28 @@ func (l *LightClient) BootstrapCheckpoint(ctx context.Context, finalized [32]byt logInterval := time.NewTicker(10 * time.Second) defer logInterval.Stop() + + doneLogCh := make(chan struct{}) var ( b *cltypes.LightClientBootstrap 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 { b, err = l.rpc.SendLightClientBootstrapReqV1(finalized)