diff options
author | kiel barry <kiel.j.barry@gmail.com> | 2018-05-08 19:08:43 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-05-08 19:08:43 +0800 |
commit | 864e80a48fd18fda89b80b11f9116c4e11cb835d (patch) | |
tree | 1eb9aa6bbae718b9505e67f4464c6750c08e51eb /p2p/discv5/topic.go | |
parent | a42be3b78dcb70ea3c44ba46c277cf41ef0bba23 (diff) | |
download | dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.gz dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.bz2 dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.lz dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.xz dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.tar.zst dexon-864e80a48fd18fda89b80b11f9116c4e11cb835d.zip |
p2p: fix some golint warnings (#16577)
Diffstat (limited to 'p2p/discv5/topic.go')
-rw-r--r-- | p2p/discv5/topic.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/p2p/discv5/topic.go b/p2p/discv5/topic.go index e7a7f8e02..609a41297 100644 --- a/p2p/discv5/topic.go +++ b/p2p/discv5/topic.go @@ -271,15 +271,15 @@ func (t *topicTable) useTicket(node *Node, serialNo uint32, topics []Topic, idx return false } -func (topictab *topicTable) getTicket(node *Node, topics []Topic) *ticket { - topictab.collectGarbage() +func (t *topicTable) getTicket(node *Node, topics []Topic) *ticket { + t.collectGarbage() now := mclock.Now() - n := topictab.getOrNewNode(node) + n := t.getOrNewNode(node) n.lastIssuedTicket++ - topictab.storeTicketCounters(node) + t.storeTicketCounters(node) - t := &ticket{ + tic := &ticket{ issueTime: now, topics: topics, serial: n.lastIssuedTicket, @@ -287,15 +287,15 @@ func (topictab *topicTable) getTicket(node *Node, topics []Topic) *ticket { } for i, topic := range topics { var waitPeriod time.Duration - if topic := topictab.topics[topic]; topic != nil { + if topic := t.topics[topic]; topic != nil { waitPeriod = topic.wcl.waitPeriod } else { waitPeriod = minWaitPeriod } - t.regTime[i] = now + mclock.AbsTime(waitPeriod) + tic.regTime[i] = now + mclock.AbsTime(waitPeriod) } - return t + return tic } const gcInterval = time.Minute |