Skip to content
Snippets Groups Projects
Commit 91132f85 authored by Josh Brooks's avatar Josh Brooks
Browse files

Add empty residue check to AddFirst

parent 306f1ed0
No related branches found
No related tags found
2 merge requests!510Release,!344Xx 4084/send e2e residue
......@@ -8,6 +8,7 @@
package partition
import (
"bytes"
"encoding/binary"
"encoding/json"
jww "github.com/spf13/jwalterweatherman"
......@@ -58,6 +59,12 @@ func (s *Store) AddFirst(partner *id.ID, mt catalog.MessageType,
mpm := s.load(partner, messageID)
mpm.AddFirst(mt, partNum, numParts, senderTimestamp, storageTimestamp, part)
if bytes.Equal(residue.Marshal(), []byte{}) {
// fixme: should this error or crash?
jww.WARN.Printf("Key reside from first message " +
"is empty, continuing...")
}
mpm.KeyResidue = residue
msg, ok := mpm.IsComplete(relationshipFingerprint)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment