From cf4bac4a1500989bece80b065a45df86f764839e Mon Sep 17 00:00:00 2001 From: Attila Gazso Date: Sun, 14 Oct 2018 11:28:58 +0200 Subject: [PATCH] swarm/network/stream: assign error and check in one line --- swarm/network/stream/messages.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/swarm/network/stream/messages.go b/swarm/network/stream/messages.go index 8520d53435..68503fe1f0 100644 --- a/swarm/network/stream/messages.go +++ b/swarm/network/stream/messages.go @@ -76,8 +76,7 @@ type RequestSubscriptionMsg struct { func (p *Peer) handleRequestSubscription(ctx context.Context, req *RequestSubscriptionMsg) (err error) { log.Debug(fmt.Sprintf("handleRequestSubscription: streamer %s to subscribe to %s with stream %s", p.streamer.addr, p.ID(), req.Stream)) - err = p.streamer.Subscribe(p.ID(), req.Stream, req.History, req.Priority) - if err != nil { + if err = p.streamer.Subscribe(p.ID(), req.Stream, req.History, req.Priority); err != nil { // The error will be sent as a subscribe error message // and will not be returned as it will prevent any new message // exchange between peers over p2p. Instead, error will be returned