From 31c25d5ee254d95b232e04f45f5042c4fd910590 Mon Sep 17 00:00:00 2001 From: Joao Sa Sousa Date: Wed, 11 Mar 2020 17:00:52 +0100 Subject: [PATCH] Removed unecessary if condition when sending empty structs --- protocols/collective_aggregation_protocol.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/protocols/collective_aggregation_protocol.go b/protocols/collective_aggregation_protocol.go index c53fd7d..9a3f21c 100644 --- a/protocols/collective_aggregation_protocol.go +++ b/protocols/collective_aggregation_protocol.go @@ -136,9 +136,7 @@ func NewCollectiveAggregationProtocol(n *onet.TreeNodeInstance) (onet.ProtocolIn // Start is called at the root to begin the execution of the protocol. func (p *CollectiveAggregationProtocol) Start() error { log.Lvl1(p.ServerIdentity(), " started a Colective Aggregation Protocol") - if err := p.SendToChildren(&DataReferenceMessage{}); err != nil { - return errors.New("Error sending :" + err.Error()) - } + p.SendToChildren(&DataReferenceMessage{}) return nil } @@ -199,9 +197,7 @@ func (p *CollectiveAggregationProtocol) aggregationAnnouncementPhase() error { select { case dataReferenceMessage := <-p.DataReferenceChannel: if !p.IsLeaf() { - if err := p.SendToChildren(&dataReferenceMessage.DataReferenceMessage); err != nil { - return errors.New("Error sending :" + err.Error()) - } + p.SendToChildren(&dataReferenceMessage.DataReferenceMessage) } case <-time.After(libunlynx.TIMEOUT): return errors.New(p.ServerIdentity().String() + " didn't get the on time.")