mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-24 22:32:13 +00:00
Bump deps, revert protobuf
This commit is contained in:
parent
30d43d22e0
commit
9b3d1b5661
13
dht.go
13
dht.go
@ -22,6 +22,7 @@ import (
|
||||
providers "github.com/libp2p/go-libp2p-kad-dht/providers"
|
||||
kb "github.com/libp2p/go-libp2p-kbucket"
|
||||
record "github.com/libp2p/go-libp2p-record"
|
||||
recpb "github.com/libp2p/go-libp2p-record/pb"
|
||||
routing "github.com/libp2p/go-libp2p-routing"
|
||||
host "github.com/libp2p/go-libp2p/p2p/host"
|
||||
protocol "github.com/libp2p/go-libp2p/p2p/protocol"
|
||||
@ -102,7 +103,7 @@ func NewDHT(ctx context.Context, h host.Host, dstore ds.Batching) *IpfsDHT {
|
||||
|
||||
// putValueToPeer stores the given key/value pair at the peer 'p'
|
||||
func (dht *IpfsDHT) putValueToPeer(ctx context.Context, p peer.ID,
|
||||
key key.Key, rec *pb.Record) error {
|
||||
key key.Key, rec *recpb.Record) error {
|
||||
|
||||
pmes := pb.NewMessage(pb.Message_PUT_VALUE, string(key), 0)
|
||||
pmes.Record = rec
|
||||
@ -134,7 +135,7 @@ var errInvalidRecord = errors.New("received invalid record")
|
||||
// NOTE: It will update the dht's peerstore with any new addresses
|
||||
// it finds for the given peer.
|
||||
func (dht *IpfsDHT) getValueOrPeers(ctx context.Context, p peer.ID,
|
||||
key key.Key) (*pb.Record, []pstore.PeerInfo, error) {
|
||||
key key.Key) (*recpb.Record, []pstore.PeerInfo, error) {
|
||||
|
||||
pmes, err := dht.getValueSingle(ctx, p, key)
|
||||
if err != nil {
|
||||
@ -154,7 +155,7 @@ func (dht *IpfsDHT) getValueOrPeers(ctx context.Context, p peer.ID,
|
||||
log.Info("Received invalid record! (discarded)")
|
||||
// return a sentinal to signify an invalid record was received
|
||||
err = errInvalidRecord
|
||||
record = new(pb.Record)
|
||||
record = new(recpb.Record)
|
||||
}
|
||||
return record, peers, err
|
||||
}
|
||||
@ -187,7 +188,7 @@ func (dht *IpfsDHT) getValueSingle(ctx context.Context, p peer.ID,
|
||||
}
|
||||
|
||||
// getLocal attempts to retrieve the value from the datastore
|
||||
func (dht *IpfsDHT) getLocal(key key.Key) (*pb.Record, error) {
|
||||
func (dht *IpfsDHT) getLocal(key key.Key) (*recpb.Record, error) {
|
||||
|
||||
log.Debug("getLocal %s", key)
|
||||
v, err := dht.datastore.Get(key.DsKey())
|
||||
@ -200,7 +201,7 @@ func (dht *IpfsDHT) getLocal(key key.Key) (*pb.Record, error) {
|
||||
if !ok {
|
||||
return nil, errors.New("value stored in datastore not []byte")
|
||||
}
|
||||
rec := new(pb.Record)
|
||||
rec := new(recpb.Record)
|
||||
err = proto.Unmarshal(byt, rec)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -227,7 +228,7 @@ func (dht *IpfsDHT) getOwnPrivateKey() (ci.PrivKey, error) {
|
||||
}
|
||||
|
||||
// putLocal stores the key value pair in the datastore
|
||||
func (dht *IpfsDHT) putLocal(key key.Key, rec *pb.Record) error {
|
||||
func (dht *IpfsDHT) putLocal(key key.Key, rec *recpb.Record) error {
|
||||
data, err := proto.Marshal(rec)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -8,9 +8,10 @@ import (
|
||||
ggio "github.com/gogo/protobuf/io"
|
||||
peer "github.com/ipfs/go-libp2p-peer"
|
||||
ctxio "github.com/jbenet/go-context/io"
|
||||
pb "github.com/libp2p/go-libp2p-kad-dht/pb"
|
||||
inet "github.com/libp2p/go-libp2p/p2p/net"
|
||||
context "golang.org/x/net/context"
|
||||
|
||||
pb "github.com/libp2p/go-libp2p-kad-dht/pb"
|
||||
)
|
||||
|
||||
var dhtReadMessageTimeout = time.Minute
|
||||
@ -141,7 +142,7 @@ func (ms *messageSender) prep() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
nstr, err := ms.dht.host.NewStream(ms.dht.ctx, ProtocolDHT, ms.p)
|
||||
nstr, err := ms.dht.host.NewStream(ms.dht.ctx, ms.p, ProtocolDHT)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -12,12 +12,13 @@ import (
|
||||
u "github.com/ipfs/go-ipfs-util"
|
||||
key "github.com/ipfs/go-key"
|
||||
pstore "github.com/ipfs/go-libp2p-peerstore"
|
||||
pb "github.com/libp2p/go-libp2p-kad-dht/pb"
|
||||
record "github.com/libp2p/go-libp2p-record"
|
||||
routing "github.com/libp2p/go-libp2p-routing"
|
||||
inet "github.com/libp2p/go-libp2p/p2p/net"
|
||||
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
|
||||
context "golang.org/x/net/context"
|
||||
|
||||
pb "github.com/libp2p/go-libp2p-kad-dht/pb"
|
||||
)
|
||||
|
||||
func TestGetFailures(t *testing.T) {
|
||||
@ -117,7 +118,7 @@ func TestGetFailures(t *testing.T) {
|
||||
Record: rec,
|
||||
}
|
||||
|
||||
s, err := hosts[1].NewStream(context.Background(), ProtocolDHT, hosts[0].ID())
|
||||
s, err := hosts[1].NewStream(context.Background(), hosts[0].ID(), ProtocolDHT)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import (
|
||||
peer "github.com/ipfs/go-libp2p-peer"
|
||||
pstore "github.com/ipfs/go-libp2p-peerstore"
|
||||
pb "github.com/libp2p/go-libp2p-kad-dht/pb"
|
||||
recpb "github.com/libp2p/go-libp2p-record/pb"
|
||||
context "golang.org/x/net/context"
|
||||
)
|
||||
|
||||
@ -81,7 +82,7 @@ func (dht *IpfsDHT) handleGetValue(ctx context.Context, p peer.ID, pmes *pb.Mess
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (dht *IpfsDHT) checkLocalDatastore(k key.Key) (*pb.Record, error) {
|
||||
func (dht *IpfsDHT) checkLocalDatastore(k key.Key) (*recpb.Record, error) {
|
||||
log.Debugf("%s handleGetValue looking into ds", dht.self)
|
||||
dskey := k.DsKey()
|
||||
iVal, err := dht.datastore.Get(dskey)
|
||||
@ -104,7 +105,7 @@ func (dht *IpfsDHT) checkLocalDatastore(k key.Key) (*pb.Record, error) {
|
||||
return nil, fmt.Errorf("datastore had non byte-slice value for %v", dskey)
|
||||
}
|
||||
|
||||
rec := new(pb.Record)
|
||||
rec := new(recpb.Record)
|
||||
err = proto.Unmarshal(byts, rec)
|
||||
if err != nil {
|
||||
log.Debug("failed to unmarshal DHT record from datastore")
|
||||
|
55
package.json
55
package.json
@ -8,20 +8,15 @@
|
||||
},
|
||||
"gxDependencies": [
|
||||
{
|
||||
"hash": "QmNQynaz7qfriSUJkiEZUrm2Wen1u3Kj9goZzWtrPyu7XR",
|
||||
"hash": "QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52",
|
||||
"name": "go-log",
|
||||
"version": "1.1.2"
|
||||
},
|
||||
{
|
||||
"hash": "QmVCe3SNMjkcPgnpFhZs719dheq6xE7gJwjzV7aWcUM4Ms",
|
||||
"name": "go-libp2p",
|
||||
"version": "3.3.7"
|
||||
"version": "1.2.0"
|
||||
},
|
||||
{
|
||||
"author": "whyrusleeping",
|
||||
"hash": "QmUWER4r4qMvaCnX5zREcfyiWN7cXN9g3a7fkRqNz8qWPP",
|
||||
"hash": "QmVoi5es8D5fNHZDqoW6DgDAEPEV5hQp8GBz161vZXiwpQ",
|
||||
"name": "go-libp2p-crypto",
|
||||
"version": "1.0.3"
|
||||
"version": "1.0.4"
|
||||
},
|
||||
{
|
||||
"author": "whyrusleeping",
|
||||
@ -40,9 +35,9 @@
|
||||
"version": "0.0.0"
|
||||
},
|
||||
{
|
||||
"hash": "Qmd5GW4ypC53YfF378JCHEmsQfGEDbtXpa5N5jPtoK2x4N",
|
||||
"hash": "QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV",
|
||||
"name": "gogo-protobuf",
|
||||
"version": "0.3.1"
|
||||
"version": "0.0.0"
|
||||
},
|
||||
{
|
||||
"author": "cheggaaa",
|
||||
@ -58,9 +53,9 @@
|
||||
},
|
||||
{
|
||||
"author": "jbenet",
|
||||
"hash": "QmTxLSvdhwg68WJimdS6icLPhZi28aTp6b7uihC2Yb47Xk",
|
||||
"hash": "QmbzuUusHqaLLoNTDEVLcSF6vZDHZDLPC7p4bztRvvkXxU",
|
||||
"name": "go-datastore",
|
||||
"version": "0.2.0"
|
||||
"version": "1.0.0"
|
||||
},
|
||||
{
|
||||
"author": "hashicorp",
|
||||
@ -82,9 +77,9 @@
|
||||
},
|
||||
{
|
||||
"author": "whyrusleeping",
|
||||
"hash": "QmVvJ27GcLaLSXvcB4auk3Gn3xuWK5ti5ENkZ2pCoJEYW4",
|
||||
"hash": "QmSp3diFRRv4zR25nHU4MWNCdhT4R6cxrTPLx12MCi1TZb",
|
||||
"name": "autobatch",
|
||||
"version": "0.2.0"
|
||||
"version": "0.2.2"
|
||||
},
|
||||
{
|
||||
"author": "kubuxu",
|
||||
@ -94,33 +89,33 @@
|
||||
},
|
||||
{
|
||||
"author": "whyrusleeping",
|
||||
"hash": "QmXhU58jbgCbuAvo3Eq6VXg67yGSNArpzJwk3g54NuYVfx",
|
||||
"hash": "Qmce4Y4zg3sYr7xKM5UueS67vhNni6EeWgCRnb7MbLJMew",
|
||||
"name": "go-key",
|
||||
"version": "1.0.1"
|
||||
"version": "1.0.2"
|
||||
},
|
||||
{
|
||||
"author": "whyrusleeping",
|
||||
"hash": "QmawCBGLXch5o1wpiGxZ7zERDUwmaVWLXeVuLBNCjFGSoe",
|
||||
"hash": "QmYpVUnnedgGrp6cX2pBii5HRQgcSr778FiKVe7o7nF5Z3",
|
||||
"name": "go-testutil",
|
||||
"version": "1.0.1"
|
||||
"version": "1.0.2"
|
||||
},
|
||||
{
|
||||
"author": "whyrusleeping",
|
||||
"hash": "QmXrtCbBHacZAqRofuWY1M8TChGtiddF5xQrQ2Wy9rMSmA",
|
||||
"hash": "Qme7D9iKHYxwq28p6PzCymywsYSRBx9uyGzW7qNB3s9VbC",
|
||||
"name": "go-libp2p-record",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
{
|
||||
"author": "whyrusleeping",
|
||||
"hash": "QmawBtuW8XoahofVAyAnTvWz3RaHzZ4ftsMH1wZP5j8zqj",
|
||||
"name": "go-libp2p-kbucket",
|
||||
"version": "1.0.1"
|
||||
},
|
||||
{
|
||||
"author": "whyrusleeping",
|
||||
"hash": "QmQ3MsUtakFm2htqYr1S2WGyA6A3jmiRa6yUuxiZJNwK42",
|
||||
"hash": "Qmc5r13R4j3V75ucMkGzHimsQDgkg4aUanX5upcUWns7XM",
|
||||
"name": "go-libp2p-kbucket",
|
||||
"version": "1.0.2"
|
||||
},
|
||||
{
|
||||
"author": "whyrusleeping",
|
||||
"hash": "QmYQadj3iegqmRPWjaWMRc8DG52hZa2HMkmyPkto5chDvs",
|
||||
"name": "go-libp2p-routing",
|
||||
"version": "1.0.0"
|
||||
"version": "1.0.2"
|
||||
},
|
||||
{
|
||||
"author": "whyrusleeping",
|
||||
@ -130,9 +125,9 @@
|
||||
},
|
||||
{
|
||||
"author": "whyrusleeping",
|
||||
"hash": "Qmf4ETeAWXuThBfWwonVyFqGFSgTWepUDEr1txcctvpTXS",
|
||||
"hash": "QmUEtj7KAkoLULwUHm4KA4pbRAcziPLHpHDRQsvn9g1i6t",
|
||||
"name": "go-libp2p",
|
||||
"version": "3.4.1"
|
||||
"version": "3.4.2"
|
||||
}
|
||||
],
|
||||
"gxVersion": "0.4.0",
|
||||
|
49
pb/dht.pb.go
49
pb/dht.pb.go
@ -16,16 +16,13 @@ package dht_pb
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import record_pb "github.com/libp2p/go-libp2p-record/pb"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
const _ = proto.GoGoProtoPackageIsVersion1
|
||||
|
||||
type Message_MessageType int32
|
||||
|
||||
const (
|
||||
@ -70,7 +67,6 @@ func (x *Message_MessageType) UnmarshalJSON(data []byte) error {
|
||||
*x = Message_MessageType(value)
|
||||
return nil
|
||||
}
|
||||
func (Message_MessageType) EnumDescriptor() ([]byte, []int) { return fileDescriptorDht, []int{0, 0} }
|
||||
|
||||
type Message_ConnectionType int32
|
||||
|
||||
@ -115,7 +111,6 @@ func (x *Message_ConnectionType) UnmarshalJSON(data []byte) error {
|
||||
*x = Message_ConnectionType(value)
|
||||
return nil
|
||||
}
|
||||
func (Message_ConnectionType) EnumDescriptor() ([]byte, []int) { return fileDescriptorDht, []int{0, 1} }
|
||||
|
||||
type Message struct {
|
||||
// defines what type of message it is.
|
||||
@ -137,10 +132,9 @@ type Message struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Message) Reset() { *m = Message{} }
|
||||
func (m *Message) String() string { return proto.CompactTextString(m) }
|
||||
func (*Message) ProtoMessage() {}
|
||||
func (*Message) Descriptor() ([]byte, []int) { return fileDescriptorDht, []int{0} }
|
||||
func (m *Message) Reset() { *m = Message{} }
|
||||
func (m *Message) String() string { return proto.CompactTextString(m) }
|
||||
func (*Message) ProtoMessage() {}
|
||||
|
||||
func (m *Message) GetType() Message_MessageType {
|
||||
if m != nil && m.Type != nil {
|
||||
@ -194,10 +188,9 @@ type Message_Peer struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Message_Peer) Reset() { *m = Message_Peer{} }
|
||||
func (m *Message_Peer) String() string { return proto.CompactTextString(m) }
|
||||
func (*Message_Peer) ProtoMessage() {}
|
||||
func (*Message_Peer) Descriptor() ([]byte, []int) { return fileDescriptorDht, []int{0, 0} }
|
||||
func (m *Message_Peer) Reset() { *m = Message_Peer{} }
|
||||
func (m *Message_Peer) String() string { return proto.CompactTextString(m) }
|
||||
func (*Message_Peer) ProtoMessage() {}
|
||||
|
||||
func (m *Message_Peer) GetId() string {
|
||||
if m != nil && m.Id != nil {
|
||||
@ -226,31 +219,3 @@ func init() {
|
||||
proto.RegisterEnum("dht.pb.Message_MessageType", Message_MessageType_name, Message_MessageType_value)
|
||||
proto.RegisterEnum("dht.pb.Message_ConnectionType", Message_ConnectionType_name, Message_ConnectionType_value)
|
||||
}
|
||||
|
||||
var fileDescriptorDht = []byte{
|
||||
// 372 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x90, 0x4d, 0x8f, 0x9a, 0x50,
|
||||
0x14, 0x86, 0xcb, 0x87, 0x56, 0x0e, 0x8a, 0x78, 0xe2, 0x82, 0xd8, 0xa4, 0x31, 0xae, 0xec, 0x86,
|
||||
0x26, 0x2e, 0xba, 0xe8, 0xa2, 0x09, 0x01, 0x6a, 0x4c, 0xec, 0xc5, 0xdc, 0xa2, 0x5d, 0x12, 0x85,
|
||||
0x9b, 0x0e, 0x19, 0x22, 0x06, 0x18, 0x27, 0xfe, 0xc2, 0xf9, 0x5b, 0x73, 0x01, 0x99, 0x41, 0x17,
|
||||
0xb3, 0xba, 0xef, 0x39, 0xf7, 0x79, 0xcf, 0x17, 0x28, 0xd1, 0x43, 0x61, 0x9e, 0xb2, 0xb4, 0x48,
|
||||
0xb1, 0x5b, 0xc9, 0xc3, 0xa4, 0x9f, 0xb1, 0x30, 0xcd, 0xa2, 0x3a, 0x3b, 0x7b, 0x91, 0xe1, 0xf3,
|
||||
0x1f, 0x96, 0xe7, 0xfb, 0xff, 0x0c, 0xbf, 0x83, 0x5c, 0x5c, 0x4e, 0xcc, 0x10, 0xa6, 0xc2, 0x5c,
|
||||
0x5b, 0x7c, 0x31, 0x6b, 0x83, 0x79, 0xfd, 0x6e, 0x5e, 0x9f, 0x23, 0xb4, 0x02, 0x71, 0x0e, 0xc3,
|
||||
0x30, 0x79, 0xca, 0x0b, 0x96, 0xad, 0xd9, 0x99, 0x25, 0x74, 0xff, 0x6c, 0x00, 0xf7, 0x76, 0xe8,
|
||||
0x7d, 0x1a, 0x75, 0x90, 0x1e, 0xd9, 0xc5, 0x10, 0xf9, 0xaf, 0x42, 0x4b, 0x89, 0xdf, 0xa0, 0x5b,
|
||||
0x0f, 0x62, 0x48, 0x3c, 0xa9, 0x2e, 0x46, 0x66, 0x33, 0xd7, 0xc1, 0xa4, 0x95, 0xa2, 0x57, 0x00,
|
||||
0x7f, 0x80, 0x1a, 0x26, 0x69, 0xce, 0xb2, 0x0d, 0x63, 0x59, 0x6e, 0xf4, 0xa6, 0x12, 0xe7, 0xc7,
|
||||
0xf7, 0xe3, 0x95, 0x9f, 0xb4, 0x0d, 0xe2, 0x4f, 0x18, 0xf0, 0x25, 0xcf, 0x71, 0xd4, 0x38, 0x95,
|
||||
0x0f, 0x9c, 0xb7, 0xe8, 0x24, 0x01, 0xb9, 0x14, 0xa8, 0x81, 0x18, 0x47, 0xd5, 0x45, 0x14, 0xca,
|
||||
0x15, 0x8e, 0xa1, 0xb3, 0x8f, 0x22, 0x5e, 0x4b, 0xe4, 0xb5, 0xfa, 0xb4, 0x0e, 0xf0, 0x17, 0x40,
|
||||
0x98, 0x1e, 0x8f, 0x2c, 0x2c, 0xe2, 0xf4, 0x58, 0x2d, 0xa4, 0x2d, 0xbe, 0xde, 0xb7, 0xb1, 0xdf,
|
||||
0x88, 0xea, 0x84, 0x2d, 0xc7, 0x2c, 0x06, 0xb5, 0x75, 0x5d, 0x1c, 0x80, 0xb2, 0xd9, 0xfa, 0xc1,
|
||||
0xce, 0x5a, 0x6f, 0x5d, 0xfd, 0x53, 0x19, 0x2e, 0xdd, 0x26, 0x14, 0xf8, 0x2d, 0xfb, 0x96, 0xe3,
|
||||
0x04, 0x1b, 0xea, 0xed, 0x56, 0x8e, 0x4b, 0x75, 0x11, 0x47, 0x30, 0x28, 0x81, 0x26, 0xf3, 0x57,
|
||||
0x97, 0x4a, 0xcf, 0xef, 0x15, 0x71, 0x02, 0xe2, 0x39, 0xae, 0x2e, 0x63, 0x8f, 0xaf, 0xb3, 0x22,
|
||||
0x4b, 0xbd, 0x33, 0xfb, 0x07, 0xda, 0xed, 0x20, 0xa5, 0x9b, 0x78, 0x7e, 0x60, 0x7b, 0x84, 0xb8,
|
||||
0xb6, 0xef, 0x3a, 0x75, 0xc7, 0xf7, 0x50, 0xc0, 0x21, 0xa8, 0xb6, 0x45, 0x1a, 0x82, 0x37, 0x44,
|
||||
0x5e, 0xc4, 0x22, 0x2d, 0x97, 0x2e, 0xbd, 0x06, 0x00, 0x00, 0xff, 0xff, 0x2a, 0x4c, 0x62, 0x25,
|
||||
0x6b, 0x02, 0x00, 0x00,
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
package dht_pb
|
||||
|
||||
import (
|
||||
ma "github.com/jbenet/go-multiaddr"
|
||||
|
||||
key "github.com/ipfs/go-key"
|
||||
peer "github.com/ipfs/go-libp2p-peer"
|
||||
pstore "github.com/ipfs/go-libp2p-peerstore"
|
||||
logging "github.com/ipfs/go-log"
|
||||
ma "github.com/jbenet/go-multiaddr"
|
||||
inet "github.com/libp2p/go-libp2p/p2p/net"
|
||||
)
|
||||
|
||||
|
@ -7,8 +7,8 @@ import (
|
||||
ci "github.com/ipfs/go-libp2p-crypto"
|
||||
peer "github.com/ipfs/go-libp2p-peer"
|
||||
ctxfrac "github.com/jbenet/go-context/frac"
|
||||
pb "github.com/libp2p/go-libp2p-kad-dht/pb"
|
||||
record "github.com/libp2p/go-libp2p-record"
|
||||
recpb "github.com/libp2p/go-libp2p-record/pb"
|
||||
routing "github.com/libp2p/go-libp2p-routing"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
@ -106,7 +106,7 @@ func (dht *IpfsDHT) getPublicKeyFromNode(ctx context.Context, p peer.ID) (ci.Pub
|
||||
|
||||
// verifyRecordLocally attempts to verify a record. if we do not have the public
|
||||
// key, we fail. we do not search the dht.
|
||||
func (dht *IpfsDHT) verifyRecordLocally(r *pb.Record) error {
|
||||
func (dht *IpfsDHT) verifyRecordLocally(r *recpb.Record) error {
|
||||
|
||||
if len(r.Signature) > 0 {
|
||||
// First, validate the signature
|
||||
@ -129,7 +129,7 @@ func (dht *IpfsDHT) verifyRecordLocally(r *pb.Record) error {
|
||||
// retrieving arbitrary public keys from the DHT as a result of passively
|
||||
// receiving records (e.g. through a PUT_VALUE or ADD_PROVIDER) can cause a
|
||||
// massive amplification attack on the dht. Use with care.
|
||||
func (dht *IpfsDHT) verifyRecordOnline(ctx context.Context, r *pb.Record) error {
|
||||
func (dht *IpfsDHT) verifyRecordOnline(ctx context.Context, r *recpb.Record) error {
|
||||
|
||||
if len(r.Signature) > 0 {
|
||||
// get the public key, search for it if necessary.
|
||||
|
Loading…
x
Reference in New Issue
Block a user