Remove unnecessary ListIR. Removes complexity.

This commit is contained in:
Kleissner
2021-04-21 02:49:31 +02:00
parent 0dd9ef028b
commit 8a33f19986
2 changed files with 3 additions and 56 deletions

View File

@@ -12,7 +12,6 @@ import (
"bytes"
"errors"
"sort"
"sync"
"time"
)
@@ -24,10 +23,6 @@ type DHT struct {
// The alpha amount of nodes will be contacted in parallel for finding the target.
alpha int
// ListIR keeps track of all active information requests.
ListIR map[string]*InformationRequest
listIRmutex sync.RWMutex
// Functions below must be set and provided by the caller.
// ShouldEvict determines whether the given node shall be evicted
@@ -52,7 +47,6 @@ func NewDHT(self *Node, bits, bucketSize, alpha int) *DHT {
ht: newHashTable(self, bits, bucketSize),
alpha: alpha,
TMsgTimeout: 2 * time.Second,
ListIR: make(map[string]*InformationRequest),
}
}