Skip to content

Commit 631bf36

Browse files
committed
p2p/discover: remove unused lastLookup field
1 parent b437443 commit 631bf36

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

p2p/discover/table.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ type transport interface {
8888

8989
// bucket contains nodes, ordered by their last activity. the entry
9090
// that was most recently active is the first element in entries.
91-
type bucket struct {
92-
lastLookup time.Time
93-
entries []*Node
94-
}
91+
type bucket struct{ entries []*Node }
9592

9693
func newTable(t transport, ourID NodeID, ourAddr *net.UDPAddr, nodeDBPath string) *Table {
9794
// If no node database was given, use an in-memory one
@@ -218,8 +215,6 @@ func (tab *Table) Lookup(targetID NodeID) []*Node {
218215
asked[tab.self.ID] = true
219216

220217
tab.mutex.Lock()
221-
// update last lookup stamp (for refresh logic)
222-
tab.buckets[logdist(tab.self.sha, target)].lastLookup = time.Now()
223218
// generate initial result set
224219
result := tab.closest(target, bucketSize)
225220
tab.mutex.Unlock()

0 commit comments

Comments
 (0)