Skip to content

Commit

Permalink
fix uid verifing bug. (#16)
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Wang <wangyi@storswift.com>
  • Loading branch information
yeewang authored and coder-lb committed Apr 15, 2019
1 parent a7cfc19 commit 86ba7eb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cluster.go
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

0 comments on commit 86ba7eb

Please sign in to comment.