check up if peer is sourced.
This commit is contained in:
@@ -214,7 +214,12 @@ func (d *Node) claimInfo(
|
||||
if endPoint == "" {
|
||||
return nil, errors.New("no endpoint found for peer")
|
||||
}
|
||||
peerID := uuid.New().String()
|
||||
did := uuid.New().String()
|
||||
|
||||
peers := oclib.NewRequestAdmin(oclib.LibDataEnum(oclib.PEER), nil).Search(nil, fmt.Sprintf("%v", peer.SELF), false)
|
||||
if len(peers.Data) > 0 {
|
||||
did = peers.Data[0].GetID() // if already existing set up did as made
|
||||
}
|
||||
priv, err := tools.LoadKeyFromFilePrivate()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -233,7 +238,7 @@ func (d *Node) claimInfo(
|
||||
|
||||
rec := &indexer.PeerRecord{
|
||||
Name: name,
|
||||
DID: peerID, // REAL PEER ID
|
||||
DID: did, // REAL PEER ID
|
||||
PubKey: pubBytes,
|
||||
}
|
||||
|
||||
@@ -261,7 +266,7 @@ func (d *Node) claimInfo(
|
||||
fmt.Println("Verify")
|
||||
return nil, err
|
||||
} else {*/
|
||||
_, p, err := rec.ExtractPeer(peerID, peerID, pub)
|
||||
_, p, err := rec.ExtractPeer(did, did, pub)
|
||||
return p, err
|
||||
//}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user