feat: add peer count to logs (#4648)

This commit is contained in:
richΛrd 2024-01-30 12:42:26 -04:00 committed by GitHub
parent 1f0fc2935c
commit e2341248b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -1020,7 +1020,8 @@ func (w *Waku) broadcast() {
}
} else {
fn = func(env *protocol.Envelope, logger *zap.Logger) error {
logger.Info("publishing message via relay")
peerCnt := len(w.node.Relay().PubSub().ListPeers(env.PubsubTopic()))
logger.Info("publishing message via relay", zap.Int("peerCnt", peerCnt))
_, err := w.node.Relay().Publish(w.ctx, env.Message(), relay.WithPubSubTopic(env.PubsubTopic()))
return err
}