aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/message.go
diff options
context:
space:
mode:
Diffstat (limited to 'p2p/message.go')
-rw-r--r--p2p/message.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/p2p/message.go b/p2p/message.go
index ffa2ef86a..a4eac54d3 100644
--- a/p2p/message.go
+++ b/p2p/message.go
@@ -270,15 +270,15 @@ func newMsgEventer(rw MsgReadWriter, feed *event.Feed, peerID discover.NodeID, p
// ReadMsg reads a message from the underlying MsgReadWriter and emits a
// "message received" event
-func (self *msgEventer) ReadMsg() (Msg, error) {
- msg, err := self.MsgReadWriter.ReadMsg()
+func (ev *msgEventer) ReadMsg() (Msg, error) {
+ msg, err := ev.MsgReadWriter.ReadMsg()
if err != nil {
return msg, err
}
- self.feed.Send(&PeerEvent{
+ ev.feed.Send(&PeerEvent{
Type: PeerEventTypeMsgRecv,
- Peer: self.peerID,
- Protocol: self.Protocol,
+ Peer: ev.peerID,
+ Protocol: ev.Protocol,
MsgCode: &msg.Code,
MsgSize: &msg.Size,
})
@@ -287,15 +287,15 @@ func (self *msgEventer) ReadMsg() (Msg, error) {
// WriteMsg writes a message to the underlying MsgReadWriter and emits a
// "message sent" event
-func (self *msgEventer) WriteMsg(msg Msg) error {
- err := self.MsgReadWriter.WriteMsg(msg)
+func (ev *msgEventer) WriteMsg(msg Msg) error {
+ err := ev.MsgReadWriter.WriteMsg(msg)
if err != nil {
return err
}
- self.feed.Send(&PeerEvent{
+ ev.feed.Send(&PeerEvent{
Type: PeerEventTypeMsgSend,
- Peer: self.peerID,
- Protocol: self.Protocol,
+ Peer: ev.peerID,
+ Protocol: ev.Protocol,
MsgCode: &msg.Code,
MsgSize: &msg.Size,
})
@@ -304,8 +304,8 @@ func (self *msgEventer) WriteMsg(msg Msg) error {
// Close closes the underlying MsgReadWriter if it implements the io.Closer
// interface
-func (self *msgEventer) Close() error {
- if v, ok := self.MsgReadWriter.(io.Closer); ok {
+func (ev *msgEventer) Close() error {
+ if v, ok := ev.MsgReadWriter.(io.Closer); ok {
return v.Close()
}
return nil