Skip to content

Commit 8b9937f

Browse files
authored
chore(libs/header/p2p): Fixing some debug logs (#1741)
self explanatory boi
1 parent 4c98c20 commit 8b9937f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libs/header/p2p/exchange.go

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ func NewExchange[H header.Header](
6868

6969
func (ex *Exchange[H]) Start(context.Context) error {
7070
ex.ctx, ex.cancel = context.WithCancel(context.Background())
71+
log.Infow("client: starting client", "protocol ID", ex.protocolID)
7172

7273
for _, p := range ex.trustedPeers {
7374
// Try to pre-connect to trusted peers.

libs/header/p2p/session.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ func (s *session[H]) doRequest(
139139

140140
r, size, duration, err := sendMessage(ctx, s.host, stat.peerID, s.protocolID, req)
141141
if err != nil {
142-
log.Errorw("requesting headers from peer failed.", "failed peer", stat.peerID, "err", err)
142+
log.Errorw("requesting headers from peer failed", "failed peer", stat.peerID, "err", err)
143143
select {
144144
case <-s.ctx.Done():
145145
case s.reqCh <- req:
146146
stat.decreaseScore()
147-
log.Debug("Retrying the request from different peer")
147+
log.Debug("retrying the request from different peer")
148148
}
149149
return
150150
}
@@ -162,7 +162,7 @@ func (s *session[H]) doRequest(
162162
}
163163
return
164164
}
165-
log.Debugw("request headers from peer succeed ", "from", s.host.ID(), "pID", stat.peerID, "amount", req.Amount)
165+
log.Debugw("request headers from peer succeeded", "peer", stat.peerID, "amount", req.Amount)
166166
// send headers to the channel, update peer stats and return peer to the queue, so it can be
167167
// re-used in case if there are other requests awaiting
168168
headers <- h

0 commit comments

Comments
 (0)