Skip to content

Commit e8c331e

Browse files
Fix Download & Registrations (#875)
Fix Registrations and Downloads
1 parent 8fa9d3b commit e8c331e

File tree

19 files changed

+249
-224
lines changed

19 files changed

+249
-224
lines changed

p2p/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Client interface {
2323
Store(ctx context.Context, data []byte, typ int) (string, error)
2424

2525
// StoreBatch will store a batch of values with their SHA256 hash as the key
26-
StoreBatch(ctx context.Context, values [][]byte, typ int) error
26+
StoreBatch(ctx context.Context, values [][]byte, typ int, taskID string) error
2727

2828
// Delete a key, value
2929
Delete(ctx context.Context, key string) error

p2p/kademlia/banlist.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const (
1313
banDuration = 3 * time.Hour
1414

1515
// threshold - threshold
16-
threshold = 2
16+
threshold = 3
1717
)
1818

1919
// BanNode is the over-the-wire representation of a node

p2p/kademlia/common.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import (
44
"fmt"
55
"strconv"
66
"strings"
7-
8-
"github.com/vmihailenco/msgpack/v5"
9-
10-
"github.com/pastelnetwork/gonode/common/utils"
117
)
128

139
// generateKeyFromNode to generate a key from a node object.
@@ -43,6 +39,7 @@ func getNodeFromKey(key string) (*Node, error) {
4339
return &Node{ID: id, IP: ip, Port: port}, nil
4440
}
4541

42+
/*
4643
func compressKeysStr(keys []string) ([]byte, error) {
4744
buf, err := msgpack.Marshal(keys)
4845
if err != nil {

p2p/kademlia/common_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package kademlia
22

33
import (
44
"fmt"
5-
"reflect"
65
"testing"
76
)
87

@@ -82,6 +81,7 @@ func TestGetNodeFromKey(t *testing.T) {
8281
}
8382
}
8483

84+
/*
8585
func TestCompressAndDecompressKeysStr(t *testing.T) {
8686
tests := []struct {
8787
name string

0 commit comments

Comments
 (0)