Skip to content
Permalink
Browse files

fix uid verifing bug. (#16)

Signed-off-by: Yi Wang <wangyi@storswift.com>
  • Loading branch information...
yeewang authored and coder-lb committed Apr 15, 2019
1 parent a7cfc19 commit 86ba7ebd3334ed81c949d414b24cca48f65b0904
Showing with 6 additions and 4 deletions.
  1. +6 −4 cluster.go
@@ -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
}

@@ -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)

0 comments on commit 86ba7eb

Please sign in to comment.
You can’t perform that action at this time.