Commit bd5c6706 authored by Jeromy's avatar Jeromy

clean up merge of bren2010's crypto branch and merge into master

parent 0b02834c
......@@ -648,7 +648,10 @@ func (dht *IpfsDHT) peerFromInfo(pbp *PBDHTMessage_PBPeer) (*peer.Peer, error) {
}
func (dht *IpfsDHT) loadProvidableKeys() error {
kl := dht.datastore.KeyList()
kl, err := dht.datastore.KeyList()
if err != nil {
return err
}
for _, k := range kl {
dht.providers.AddProvider(u.Key(k.Bytes()), dht.self)
}
......
......@@ -29,7 +29,7 @@ func setupDHTS(n int, t *testing.T) ([]*ma.Multiaddr, []*peer.Peer, []*IpfsDHT)
for i := 0; i < 4; i++ {
p := new(peer.Peer)
p.AddAddress(addrs[i])
sk, pk, err := ci.GenerateKeyPair(ci.RSA, 256)
sk, pk, err := ci.GenerateKeyPair(ci.RSA, 512)
if err != nil {
panic(err)
}
......@@ -61,7 +61,7 @@ func setupDHTS(n int, t *testing.T) ([]*ma.Multiaddr, []*peer.Peer, []*IpfsDHT)
func makePeer(addr *ma.Multiaddr) *peer.Peer {
p := new(peer.Peer)
p.AddAddress(addr)
sk, pk, err := ci.GenerateKeyPair(ci.RSA, 256)
sk, pk, err := ci.GenerateKeyPair(ci.RSA, 512)
if err != nil {
panic(err)
}
......
......@@ -189,7 +189,6 @@ func TestNotFound(t *testing.T) {
// Reply with random peers to every message
fn.AddHandler(func(mes *swarm.Message) *swarm.Message {
t.Log("Handling message...")
pmes := new(PBDHTMessage)
err := proto.Unmarshal(mes.Data, pmes)
if err != nil {
......@@ -252,7 +251,6 @@ func TestLessThanKResponses(t *testing.T) {
// Reply with random peers to every message
fn.AddHandler(func(mes *swarm.Message) *swarm.Message {
t.Log("Handling message...")
pmes := new(PBDHTMessage)
err := proto.Unmarshal(mes.Data, pmes)
if err != 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