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

Make a copy of the contact object

parent 63d29af2
No related branches found
No related tags found
3 merge requests!233Modify restore to call user-defined bindings callback. Add Sent requests to...,!231Revert "Update store to print changes to the partners list",!192Hotfix/improved restore
...@@ -24,6 +24,7 @@ import ( ...@@ -24,6 +24,7 @@ import (
"gitlab.com/elixxir/client/storage/versioned" "gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/elixxir/client/ud" "gitlab.com/elixxir/client/ud"
"gitlab.com/elixxir/crypto/contact" "gitlab.com/elixxir/crypto/contact"
"gitlab.com/elixxir/primitives/fact"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
) )
...@@ -235,9 +236,17 @@ func LookupContact(userID *id.ID, udManager *ud.Manager, ...@@ -235,9 +236,17 @@ func LookupContact(userID *id.ID, udManager *ud.Manager,
if myErr != nil { if myErr != nil {
err = myErr err = myErr
} }
result = &c newOwnership := make([]byte, len(c.OwnershipProof))
copy(newOwnership, c.OwnershipProof)
newFacts, _, _ := fact.UnstringifyFactList(c.Facts.Stringify())
result = &contact.Contact{
ID: c.ID.DeepCopy(),
DhPubKey: c.DhPubKey.DeepCopy(),
OwnershipProof: newOwnership,
Facts: newFacts,
}
waiter.Unlock() waiter.Unlock()
extLookupCB(c, myErr) extLookupCB(*result, myErr)
} }
// Take lock once to make sure I will wait // Take lock once to make sure I will wait
waiter.Lock() waiter.Lock()
......
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