Commit 77e81da9 authored by Jeromy's avatar Jeromy Committed by Juan Batiz-Benet

better bitswap logging

parent 4d5b93fe
......@@ -288,7 +288,7 @@ func (bs *Bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
bs.dupBlocksRecvd++
}
bs.counterLk.Unlock()
log.Debugf("got block %s from %s (%d,%d)", block, p, bs.blocksRecvd, bs.dupBlocksRecvd)
log.Infof("got block %s from %s (%d,%d)", block, p, bs.blocksRecvd, bs.dupBlocksRecvd)
hasBlockCtx, cancel := context.WithTimeout(ctx, hasBlockTimeout)
if err := bs.HasBlock(hasBlockCtx, block); err != nil {
......
......@@ -66,6 +66,7 @@ type msgQueue struct {
}
func (pm *WantManager) WantBlocks(ks []u.Key) {
log.Infof("want blocks: %s", ks)
pm.addEntries(ks, false)
}
......@@ -97,6 +98,7 @@ func (pm *WantManager) SendBlock(ctx context.Context, env *engine.Envelope) {
msg := bsmsg.New(false)
msg.AddBlock(env.Block)
log.Infof("Sending block %s to %s", env.Peer, env.Block)
err := pm.network.SendMessage(ctx, env.Peer, msg)
if err != nil {
log.Error(err)
......@@ -143,8 +145,9 @@ func (pm *WantManager) runQueue(mq *msgQueue) {
err := pm.network.ConnectTo(pm.ctx, mq.p)
if err != nil {
log.Error(err)
log.Errorf("cant connect to peer %s: %s", mq.p, err)
// TODO: cant connect, what now?
continue
}
// grab outgoing message
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment