Skip to content

Commit

Permalink
Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sanchez committed Jan 16, 2025
1 parent 2fd91e5 commit 7775b9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions eth/protocols/eth/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ func handleGetBTCBlocks(backend Backend, msg Decoder, peer *Peer) error {
return fmt.Errorf("%w: message %v: %v", errDecode, msg, err)
}
response := ServiceGetBTCBlocksQuery(backend.Chain(), query.GetBTCBlocksRequest)

for i := 0; i < len(response); i++ {
log.Info(fmt.Sprintf("BTC response[%d] length: %d", i, len(response[i])))
}

return peer.ReplyBTCBlocksRLP(query.RequestId, response)
}

Expand Down
2 changes: 2 additions & 0 deletions p2p/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"bytes"
"errors"
"fmt"
"github.com/ethereum/go-ethereum/log"
"io"
"sync/atomic"
"time"
Expand Down Expand Up @@ -101,6 +102,7 @@ func Send(w MsgWriter, msgcode uint64, data interface{}) error {
if err != nil {
return err
}
log.Info("Sending bytes to peer", "bytes", size)
return w.WriteMsg(Msg{Code: msgcode, Size: uint32(size), Payload: r})
}

Expand Down

0 comments on commit 7775b9c

Please sign in to comment.