swarm/network/stream: Simplify code (#303)

This commit is contained in:
Balint Gabor 2018-03-06 11:00:34 +01:00 committed by GitHub
parent cdca257402
commit 5c57cbaebc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,11 +71,7 @@ type RequestSubscriptionMsg struct {
func (p *Peer) handleRequestSubscription(req *RequestSubscriptionMsg) (err error) { func (p *Peer) handleRequestSubscription(req *RequestSubscriptionMsg) (err error) {
log.Debug(fmt.Sprintf("handleRequestSubscription: streamer %s to subscribe to %s with stream %s", p.streamer.addr.ID(), p.ID(), req.Stream)) log.Debug(fmt.Sprintf("handleRequestSubscription: streamer %s to subscribe to %s with stream %s", p.streamer.addr.ID(), p.ID(), req.Stream))
err = p.streamer.Subscribe(p.ID(), req.Stream, req.History, req.Priority) return p.streamer.Subscribe(p.ID(), req.Stream, req.History, req.Priority)
if err != nil {
return err
}
return nil
} }
func (p *Peer) handleSubscribeMsg(req *SubscribeMsg) (err error) { func (p *Peer) handleSubscribeMsg(req *SubscribeMsg) (err error) {