mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
define String() on bzzProtocol for debug logging
This commit is contained in:
parent
e030b2153a
commit
0206ad78ad
1 changed files with 5 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ registering peers with the DHT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -350,6 +351,10 @@ func (self *bzzProtocol) LastActive() time.Time {
|
||||||
func (self *bzzProtocol) Drop() {
|
func (self *bzzProtocol) Drop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (self *bzzProtocol) String() string {
|
||||||
|
return fmt.Sprintf("%4x: %v\n", self.node.Sha().Bytes()[:4], self.Url())
|
||||||
|
}
|
||||||
|
|
||||||
func newPeerAddrFromNode(node *discover.Node) *peerAddr {
|
func newPeerAddrFromNode(node *discover.Node) *peerAddr {
|
||||||
return &peerAddr{
|
return &peerAddr{
|
||||||
ID: node.ID[:],
|
ID: node.ID[:],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue