Discovery Nano the light version.
This commit is contained in:
@@ -33,10 +33,12 @@ const maxTTLSeconds = 86400 // 24h
|
||||
const tombstoneTTL = 10 * time.Minute
|
||||
|
||||
type PeerRecordPayload struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
DID string `json:"did"`
|
||||
PubKey []byte `json:"pub_key"`
|
||||
PubKey []byte `json:"public_key"`
|
||||
ExpiryDate time.Time `json:"expiry_date"`
|
||||
IsNano bool `json:"is_nano"`
|
||||
// TTLSeconds is the publisher's declared lifetime for this record in seconds.
|
||||
// 0 means "use the default (120 s)". Included in the signed payload so it
|
||||
// cannot be altered by an intermediary.
|
||||
@@ -45,6 +47,8 @@ type PeerRecordPayload struct {
|
||||
|
||||
type PeerRecord struct {
|
||||
PeerRecordPayload
|
||||
CreationDate time.Time `json:"creation_date"`
|
||||
UpdateDate time.Time `json:"update_date"`
|
||||
PeerID string `json:"peer_id"`
|
||||
APIUrl string `json:"api_url"`
|
||||
StreamAddress string `json:"stream_address"`
|
||||
@@ -184,7 +188,7 @@ func (ix *IndexerService) isPeerKnown(pid lpp.ID) bool {
|
||||
And: map[string][]dbs.Filter{
|
||||
"peer_id": {{Operator: dbs.EQUAL.String(), Value: pid.String()}},
|
||||
},
|
||||
}, pid.String(), false)
|
||||
}, pid.String(), false, 0, 1)
|
||||
for _, item := range results.Data {
|
||||
p, ok := item.(*pp.Peer)
|
||||
if !ok || p.PeerID != pid.String() {
|
||||
|
||||
Reference in New Issue
Block a user