check up if peer is sourced.

This commit is contained in:
mr
2026-02-20 15:01:01 +01:00
parent 3eae5791a1
commit 572da29fd4
2 changed files with 8 additions and 23 deletions

View File

@@ -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
//}
}