aboutsummaryrefslogtreecommitdiffstats
path: root/les
diff options
context:
space:
mode:
authorferhat elmas <elmas.ferhat@gmail.com>2017-11-08 18:45:52 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-11-08 18:45:52 +0800
commit9619a610248e9630968ba1d9be8e214b645c9c55 (patch)
tree5844cfbee9a0ac5750dcc803cea461f75969f74e /les
parentbfdc0fa3622d7c3b421d2f5a6dda5746be41bfde (diff)
downloaddexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar.gz
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar.bz2
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar.lz
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar.xz
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.tar.zst
dexon-9619a610248e9630968ba1d9be8e214b645c9c55.zip
all: gofmt -w -s (#15419)
Diffstat (limited to 'les')
-rw-r--r--les/bloombits.go2
-rw-r--r--les/distributor.go2
-rw-r--r--les/distributor_test.go2
-rw-r--r--les/odr.go18
4 files changed, 12 insertions, 12 deletions
diff --git a/les/bloombits.go b/les/bloombits.go
index dff83d349..de233d751 100644
--- a/les/bloombits.go
+++ b/les/bloombits.go
@@ -56,7 +56,7 @@ func (eth *LightEthereum) startBloomHandlers() {
task.Bitsets = make([][]byte, len(task.Sections))
compVectors, err := light.GetBloomBits(task.Context, eth.odr, task.Bit, task.Sections)
if err == nil {
- for i, _ := range task.Sections {
+ for i := range task.Sections {
if blob, err := bitutil.DecompressBytes(compVectors[i], int(light.BloomTrieFrequency/8)); err == nil {
task.Bitsets[i] = blob
} else {
diff --git a/les/distributor.go b/les/distributor.go
index e8ef5b02e..159fa4c73 100644
--- a/les/distributor.go
+++ b/les/distributor.go
@@ -191,7 +191,7 @@ func (d *requestDistributor) nextRequest() (distPeer, *distReq, time.Duration) {
for (len(d.peers) > 0 || elem == d.reqQueue.Front()) && elem != nil {
req := elem.Value.(*distReq)
canSend := false
- for peer, _ := range d.peers {
+ for peer := range d.peers {
if _, ok := checkedPeers[peer]; !ok && peer.canQueue() && req.canSend(peer) {
canSend = true
cost := req.getCost(peer)
diff --git a/les/distributor_test.go b/les/distributor_test.go
index 4e7f8bd29..55defb69b 100644
--- a/les/distributor_test.go
+++ b/les/distributor_test.go
@@ -124,7 +124,7 @@ func testRequestDistributor(t *testing.T, resend bool) {
dist := newRequestDistributor(nil, stop)
var peers [testDistPeerCount]*testDistPeer
- for i, _ := range peers {
+ for i := range peers {
peers[i] = &testDistPeer{}
go peers[i].worker(t, !resend, stop)
dist.registerTestPeer(peers[i])
diff --git a/les/odr.go b/les/odr.go
index 986630dbf..f8412aaad 100644
--- a/les/odr.go
+++ b/les/odr.go
@@ -27,20 +27,20 @@ import (
// LesOdr implements light.OdrBackend
type LesOdr struct {
- db ethdb.Database
+ db ethdb.Database
chtIndexer, bloomTrieIndexer, bloomIndexer *core.ChainIndexer
- retriever *retrieveManager
- stop chan struct{}
+ retriever *retrieveManager
+ stop chan struct{}
}
func NewLesOdr(db ethdb.Database, chtIndexer, bloomTrieIndexer, bloomIndexer *core.ChainIndexer, retriever *retrieveManager) *LesOdr {
return &LesOdr{
- db: db,
- chtIndexer: chtIndexer,
- bloomTrieIndexer: bloomTrieIndexer,
- bloomIndexer: bloomIndexer,
- retriever: retriever,
- stop: make(chan struct{}),
+ db: db,
+ chtIndexer: chtIndexer,
+ bloomTrieIndexer: bloomTrieIndexer,
+ bloomIndexer: bloomIndexer,
+ retriever: retriever,
+ stop: make(chan struct{}),
}
}