refactor: inline
This commit is contained in:
1 parent
582b582b98
commit
6cda74d49f
1 file changed
+2
-5
+2
-5
@@ -201,7 +201,8 @@ func (c *GossipChannel) sendGossipDown(conn Connection, data GossipData) {
|
|||||||
sender, found := c.senders[conn]
|
sender, found := c.senders[conn]
|
||||||
if !found {
|
if !found {
|
||||||
sender = NewGossipSender(func(pending GossipData) {
|
sender = NewGossipSender(func(pending GossipData) {
|
||||||
conn.(ProtocolSender).SendProtocolMsg(c.gossipMsg(pending.Encode()))
|
protocolMsg := ProtocolMsg{ProtocolGossip, GobEncode(c.hash, c.ourself.Name, pending.Encode())}
|
||||||
|
conn.(ProtocolSender).SendProtocolMsg(protocolMsg)
|
||||||
})
|
})
|
||||||
c.senders[conn] = sender
|
c.senders[conn] = sender
|
||||||
sender.Start()
|
sender.Start()
|
||||||
@@ -209,10 +210,6 @@ func (c *GossipChannel) sendGossipDown(conn Connection, data GossipData) {
|
|||||||
sender.Send(data)
|
sender.Send(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *GossipChannel) gossipMsg(buf []byte) ProtocolMsg {
|
|
||||||
return ProtocolMsg{ProtocolGossip, GobEncode(c.hash, c.ourself.Name, buf)}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *GossipChannel) GossipUnicast(dstPeerName PeerName, buf []byte) error {
|
func (c *GossipChannel) GossipUnicast(dstPeerName PeerName, buf []byte) error {
|
||||||
return c.relayGossipUnicast(dstPeerName, GobEncode(c.hash, c.ourself.Name, dstPeerName, buf))
|
return c.relayGossipUnicast(dstPeerName, GobEncode(c.hash, c.ourself.Name, dstPeerName, buf))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user