Skip to content

Commit

Permalink
chore: log PeerId for peer that provided block
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Jun 17, 2024
1 parent cea5eae commit c017832
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/p2p/bitswap/sessions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,16 +376,17 @@ impl Stream for WantSession {
};
}
WantSessionState::PutBlock { from_peer_id, fut } => {
let peer_id = *from_peer_id;
match ready!(fut.poll_unpin(cx)) {
Ok(cid) => {
tracing::info!(session = %self.cid, block = %cid, name = "want_session", "block stored in block store");
tracing::info!(session = %self.cid, %peer_id, block = %cid, name = "want_session", "block stored in block store");
self.state = WantSessionState::Complete;
return Poll::Ready(Some(WantSessionEvent::BlockStored));
}
Err(e) => {
tracing::error!(session = %cid, error = %e, name = "want_session", "error storing block in store");
tracing::error!(session = %cid, %peer_id, error = %e, name = "want_session", "error storing block in store");
this.state = WantSessionState::NextBlock {
previous_peer_id: Some(*from_peer_id),
previous_peer_id: Some(peer_id),
};
}
}
Expand Down

0 comments on commit c017832

Please sign in to comment.