Skip to content
Snippets Groups Projects
Commit 80812f2e authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Modify LoadContact to always try to unmarshal the v0 contact object

parent 9ef4717c
No related branches found
No related tags found
2 merge requests!510Release,!282Auth Store Fixes
......@@ -10,6 +10,7 @@ package utility
import (
"fmt"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/elixxir/crypto/contact"
"gitlab.com/xx_network/primitives/id"
......@@ -32,6 +33,15 @@ func StoreContact(kv *versioned.KV, c contact.Contact) error {
func LoadContact(kv *versioned.KV, cid *id.ID) (contact.Contact, uint64, error) {
vo, err := kv.Get(makeContactKey(cid), currentContactVersion)
if err != nil {
vo2, err2 := kv.Get(makeContactKey(cid), 0)
if err2 == nil {
err = nil
vo = vo2
} else {
jww.DEBUG.Printf("LoadContact: %+v", err2)
}
}
if err != nil {
return contact.Contact{}, 0, err
}
......
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