diff --git a/network/message/sendCmix.go b/network/message/sendCmix.go index 1a3c1b405e8bddad1285492ae4f73720cf932aed..bf47703943c1935030c9d0f31d1999e448c41b66 100644 --- a/network/message/sendCmix.go +++ b/network/message/sendCmix.go @@ -210,7 +210,6 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, recipient *id.ID } return result, false, err }) - jww.FATAL.Printf("TEST500") gwSlotResp := result.(*pb.GatewaySlotResponse) //if the comm errors or the message fails to send, continue retrying. diff --git a/network/node/register.go b/network/node/register.go index 881922c20ce3e98b0ebe0f94155bc53d0c4cc5c1..c89d2dd55371bef074a3d417f5ca05ae66d4e550 100644 --- a/network/node/register.go +++ b/network/node/register.go @@ -162,8 +162,7 @@ func requestNonce(sender *gateway.Sender, comms RegisterNodeCommsInterface, gwId } // Request nonce message from gateway - jww.INFO.Printf("Register: Requesting nonce from gateway %v", - gwId.Bytes()) + jww.INFO.Printf("Register: Requesting nonce from gateway %v", gwId.String()) result, err := sender.SendToAny(func(host *connect.Host) (interface{}, error) { nonceResponse, err := comms.SendRequestNonceMessage(host, diff --git a/network/polltracker.go b/network/polltracker.go index 48574c7d8e19eb4e1d73090af0c017e3c9b8187b..63739e19afbb1a959face8c7859f23c704a7cb66 100644 --- a/network/polltracker.go +++ b/network/polltracker.go @@ -13,7 +13,7 @@ func newPollTracker() *pollTracker { return &pt } -//tracks a single poll +// Track tracks a single poll func (pt *pollTracker) Track(ephID ephemeral.Id, source *id.ID) { if _, exists := (*pt)[*source]; !exists { (*pt)[*source] = make(map[int64]uint) @@ -25,7 +25,7 @@ func (pt *pollTracker) Track(ephID ephemeral.Id, source *id.ID) { } } -//reports all resent polls +// Report reports all recent polls func (pt *pollTracker) Report() string { report := "" numReports := uint(0) diff --git a/network/rounds/retrieve.go b/network/rounds/retrieve.go index 7d4bcd43e55b0811ad4dfc0fe478740c7d987585..0d90355c64bb2adaff003442737e09468a5b05f8 100644 --- a/network/rounds/retrieve.go +++ b/network/rounds/retrieve.go @@ -83,7 +83,7 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round, identity reception.Id // Send to the gateways using backup proxies result, err := m.sender.SendToPreferred(gwIds, func(host *connect.Host, target *id.ID) (interface{}, error) { - jww.DEBUG.Printf("Trying to get messages for round %v for ephmeralID %d (%v) "+ + jww.DEBUG.Printf("Trying to get messages for round %v for ephemeralID %d (%v) "+ "via Gateway: %s", roundID, identity.EphId.Int64(), identity.Source.String(), host.GetId()) // send the request @@ -93,7 +93,13 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round, identity reception.Id Target: target.Marshal(), } - return comms.RequestMessages(host, msgReq) + // If the gateway doesnt have the round, return an error + msgResp, err := comms.RequestMessages(host, msgReq) + if err == nil && !msgResp.GetHasRound() { + return message.Bundle{}, errors.Errorf(noRoundError) + } + + return msgResp, err }) // Fail the round if an error occurs so it can be tried again later @@ -102,10 +108,6 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round, identity reception.Id "request messages for round %d", roundID) } msgResp := result.(*pb.GetMessagesResponse) - // if the gateway doesnt have the round, return an error - if !msgResp.GetHasRound() { - return message.Bundle{}, errors.Errorf(noRoundError) - } // If there are no messages print a warning. Due to the probabilistic nature // of the bloom filters, false positives will happen some times