eth: conform better to the golint standards (#16783)

* eth: made changes to conform better to the golint standards

* eth: fix comment nit
This commit is contained in:
williambannas
2018-06-14 03:14:52 -07:00
committed by Péter Szilágyi
parent d0fd8d6fc2
commit 9402f96597
7 changed files with 27 additions and 26 deletions

View File

@ -596,21 +596,21 @@ func (q *queue) cancel(request *fetchRequest, taskQueue *prque.Prque, pendPool m
// Revoke cancels all pending requests belonging to a given peer. This method is
// meant to be called during a peer drop to quickly reassign owned data fetches
// to remaining nodes.
func (q *queue) Revoke(peerId string) {
func (q *queue) Revoke(peerID string) {
q.lock.Lock()
defer q.lock.Unlock()
if request, ok := q.blockPendPool[peerId]; ok {
if request, ok := q.blockPendPool[peerID]; ok {
for _, header := range request.Headers {
q.blockTaskQueue.Push(header, -float32(header.Number.Uint64()))
}
delete(q.blockPendPool, peerId)
delete(q.blockPendPool, peerID)
}
if request, ok := q.receiptPendPool[peerId]; ok {
if request, ok := q.receiptPendPool[peerID]; ok {
for _, header := range request.Headers {
q.receiptTaskQueue.Push(header, -float32(header.Number.Uint64()))
}
delete(q.receiptPendPool, peerId)
delete(q.receiptPendPool, peerID)
}
}