Formatting
This commit is contained in:
parent
c6bfb4d945
commit
f1dd3185b4
|
@ -44,7 +44,7 @@ func NewMessageData(nodeId string, messageId string, gossip bool) *p2p.MessageDa
|
|||
|
||||
// Node type - implements one or more p2p protocols
|
||||
type Node struct {
|
||||
host host.Host // lib-p2p host
|
||||
host host.Host // lib-p2p host
|
||||
*PingProtocol // ping protocol impl
|
||||
*EchoProtocol // echo protocol impl
|
||||
}
|
||||
|
|
|
@ -26,10 +26,10 @@ type PingProtocol struct {
|
|||
}
|
||||
|
||||
func NewPingProtocol(host host.Host, done chan bool) *PingProtocol {
|
||||
p := PingProtocol{host: host, requests: make(map[string]*p2p.PingRequest), done: done}
|
||||
p := &PingProtocol{host: host, requests: make(map[string]*p2p.PingRequest), done: done}
|
||||
host.SetStreamHandler(pingRequest, p.onPingRequest)
|
||||
host.SetStreamHandler(pingResponse, p.onPingResponse)
|
||||
return &p
|
||||
return p
|
||||
}
|
||||
|
||||
// remote peer requests handler
|
||||
|
|
Loading…
Reference in New Issue