aboutsummaryrefslogtreecommitdiffstats
path: root/p2p
diff options
context:
space:
mode:
Diffstat (limited to 'p2p')
-rw-r--r--p2p/protocols/protocol.go4
-rw-r--r--p2p/protocols/protocol_test.go2
-rw-r--r--p2p/testing/peerpool.go2
3 files changed, 4 insertions, 4 deletions
diff --git a/p2p/protocols/protocol.go b/p2p/protocols/protocol.go
index 1600a11f9..164e3fa4b 100644
--- a/p2p/protocols/protocol.go
+++ b/p2p/protocols/protocol.go
@@ -243,7 +243,7 @@ func (p *Peer) Run(handler func(ctx context.Context, msg interface{}) error) err
// Drop disconnects a peer.
// TODO: may need to implement protocol drop only? don't want to kick off the peer
// if they are useful for other protocols
-func (p *Peer) Drop(err error) {
+func (p *Peer) Drop() {
p.Disconnect(p2p.DiscSubprotocolError)
}
@@ -291,7 +291,7 @@ func (p *Peer) Send(ctx context.Context, msg interface{}) error {
if p.spec.Hook != nil {
err := p.spec.Hook.Send(p, wmsg.Size, msg)
if err != nil {
- p.Drop(err)
+ p.Drop()
return err
}
}
diff --git a/p2p/protocols/protocol_test.go b/p2p/protocols/protocol_test.go
index 9ac76ea2f..6d5ea8b92 100644
--- a/p2p/protocols/protocol_test.go
+++ b/p2p/protocols/protocol_test.go
@@ -126,7 +126,7 @@ func newProtocol(pp *p2ptest.TestPeerPool) func(*p2p.Peer, p2p.MsgReadWriter) er
case *kill:
// demonstrates use of peerPool, killing another peer connection as a response to a message
id := msg.C
- pp.Get(id).Drop(errors.New("killed"))
+ pp.Get(id).Drop()
return nil
case *drop:
diff --git a/p2p/testing/peerpool.go b/p2p/testing/peerpool.go
index 01ccce67e..09db4b246 100644
--- a/p2p/testing/peerpool.go
+++ b/p2p/testing/peerpool.go
@@ -26,7 +26,7 @@ import (
type TestPeer interface {
ID() enode.ID
- Drop(error)
+ Drop()
}
// TestPeerPool is an example peerPool to demonstrate registration of peer connections