diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-04-11 16:26:52 +0800 |
---|---|---|
committer | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-05-10 18:26:30 +0800 |
commit | 993b145f25845e50e8af41ffb1116eaee381d693 (patch) | |
tree | 47a88eec27f66b7237512c862d7ab2f8e9f314d3 /p2p/protocols | |
parent | 996755c4a832afce8629a771cab8879c88c98355 (diff) | |
download | go-tangerine-993b145f25845e50e8af41ffb1116eaee381d693.tar go-tangerine-993b145f25845e50e8af41ffb1116eaee381d693.tar.gz go-tangerine-993b145f25845e50e8af41ffb1116eaee381d693.tar.bz2 go-tangerine-993b145f25845e50e8af41ffb1116eaee381d693.tar.lz go-tangerine-993b145f25845e50e8af41ffb1116eaee381d693.tar.xz go-tangerine-993b145f25845e50e8af41ffb1116eaee381d693.tar.zst go-tangerine-993b145f25845e50e8af41ffb1116eaee381d693.zip |
swarm/storage/localstore: fix export db.Put signature
cmd/swarm/swarm-smoke: improve smoke tests (#1337)
swarm/network: remove dead code (#1339)
swarm/network: remove FetchStore and SyncChunkStore in favor of NetStore (#1342)
Diffstat (limited to 'p2p/protocols')
-rw-r--r-- | p2p/protocols/protocol.go | 4 | ||||
-rw-r--r-- | p2p/protocols/protocol_test.go | 2 |
2 files changed, 3 insertions, 3 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: |