diff --git a/network/rounds/retrieve.go b/network/rounds/retrieve.go index 23249c50599e1b9439ab4775d7aa391286c1692d..646b9be11f978c538926ec18223f2d651968b86c 100644 --- a/network/rounds/retrieve.go +++ b/network/rounds/retrieve.go @@ -156,8 +156,10 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round, // If the gateway doesnt have the round, return an error msgResp, err := comms.RequestMessages(host, msgReq) + if err!=nil{ - return nil, err + //you need to default to a retryable errors because otherwise we cannot enumerate all errors + return nil, errors.WithMessage(err, gateway.RetryableError) } if !msgResp.GetHasRound() { @@ -165,7 +167,7 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round, return message.Bundle{}, errors.WithMessage(errRtn, gateway.RetryableError) } - return msgResp, err + return msgResp, nil }, stop) jww.INFO.Printf("Received message for round %d, processing...", roundID) // Fail the round if an error occurs so it can be tried again later diff --git a/storage/rounds/uncheckedRounds.go b/storage/rounds/uncheckedRounds.go index d8082628eb0536b9cb1663f14ef0b82dbee2b193..aa5e57497d36c21f970d3dcb599708ba78bf5650 100644 --- a/storage/rounds/uncheckedRounds.go +++ b/storage/rounds/uncheckedRounds.go @@ -326,7 +326,7 @@ func (s *UncheckedRoundStore) marshal() ([]byte, error) { // Write number of rounds the buffer b := make([]byte, 8) - binary.PutVarint(b, int64(len(s.list))) + binary.BigEndian.PutUint32(b, uint32(len(s.list))) buf.Write(b) for rid, rnd := range s.list { @@ -348,7 +348,7 @@ func (s *UncheckedRoundStore) unmarshal(data []byte) error { buff := bytes.NewBuffer(data) // Get number of rounds in list - length, _ := binary.Varint(buff.Next(8)) + length := binary.BigEndian.Uint32(buff.Next(8)) for i := 0; i < int(length); i++ { rnd := UncheckedRound{}