@@ -3,18 +3,16 @@ package p2pd
33import (
44 "context"
55 "fmt"
6- "io"
7- "net"
8- "time"
96 "github.com/libp2p/go-libp2p/core/network"
107 "github.com/libp2p/go-libp2p/core/peer"
118 "github.com/libp2p/go-libp2p/core/protocol"
12-
9+ "io"
10+ "net"
11+ "time"
1312
1413 "github.com/learning-at-home/go-libp2p-daemon/internal/utils"
1514 pb "github.com/learning-at-home/go-libp2p-daemon/pb"
1615
17-
1816 ggio "github.com/gogo/protobuf/io"
1917 ma "github.com/multiformats/go-multiaddr"
2018)
@@ -124,7 +122,7 @@ func (d *Daemon) handleConn(c net.Conn) {
124122 log .Debugw ("error writing response" , "error" , err )
125123 return
126124 }
127-
125+
128126 case pb .Request_BANDWIDTH_METRICS :
129127 res := d .doBandwidthMetrics (& req )
130128 err := w .WriteMsg (res )
@@ -351,8 +349,8 @@ func (d *Daemon) doBandwidthMetrics(req *pb.Request) *pb.Response {
351349 selfRateOut = stats .RateOut
352350 }
353351 res := okResponse ()
354- res .Bwr = & pb.BandwidthMetricsResponse {
355- SelfRateIn : & selfRateIn ,
352+ res .Bwr = & pb.BandwidthMetricsResponse {
353+ SelfRateIn : & selfRateIn ,
356354 SelfRateOut : & selfRateOut ,
357355 }
358356
@@ -391,7 +389,7 @@ func (d *Daemon) doBandwidthMetrics(req *pb.Request) *pb.Response {
391389 }
392390 res .Bwr .Peers = peers
393391 }
394-
392+
395393 return res
396394}
397395
0 commit comments