Commit f9018750 authored by Jeromy's avatar Jeromy Committed by Juan Batiz-Benet

validator functions and ipns completion

parent 08fbaadb
......@@ -84,7 +84,10 @@ func NewDHT(ctx context.Context, p peer.Peer, ps peer.Peerstore, dialer inet.Dia
dht.routingTables[1] = kb.NewRoutingTable(20, kb.ConvertPeerID(p.ID()), time.Millisecond*1000)
dht.routingTables[2] = kb.NewRoutingTable(20, kb.ConvertPeerID(p.ID()), time.Hour)
dht.birth = time.Now()
dht.Validators = make(map[string]ValidatorFunc)
dht.Validators["ipns"] = ValidateIpnsRecord
dht.Validators["pk"] = ValidatePublicKeyRecord
if doPinging {
dht.Children().Add(1)
......
......@@ -69,3 +69,13 @@ func (dht *IpfsDHT) verifyRecord(r *pb.Record) error {
return fnc(u.Key(r.GetKey()), r.GetValue())
}
func ValidateIpnsRecord(k u.Key, val []byte) error {
// TODO:
return nil
}
func ValidatePublicKeyRecord(k u.Key, val []byte) error {
// TODO:
return nil
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment