Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix uid verifing bug. #16

Merged
merged 1 commit into from
Apr 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1432,14 +1432,16 @@ func (c *Cluster) FindKey(uid string) (api.UIDKey, error) {

// SyncKey finds the Key of the member of this Cluster.
func (c *Cluster) SyncKey(uid string) error {

// check local key
ks, err := localKeystore()
if err != nil {
logger.Error(err)
return err
}

_, err = ks.Has(uid)
if err == nil {
isExist, err := ks.Has(uid)
if err == nil && isExist {
return nil
}

Expand Down Expand Up @@ -1478,8 +1480,8 @@ func (c *Cluster) SyncKey(uid string) error {
return err
}

logger.Info("SyncKey uid: " + peersUIDKey[i].UID)
logger.Info("SyncKey Key: <<hidden>>")
logger.Info("SyncKey uid: " + peersUIDKey[i].UID)
logger.Info("SyncKey Key: <<hidden>>")
logger.Info("SyncKey root: " + peersUIDKey[i].Root)

err = ks.Put(peersUIDKey[i].UID, priKey)
Expand Down