aboutsummaryrefslogtreecommitdiffstats
path: root/les
diff options
context:
space:
mode:
authorFurkan KAMACI <furkankamaci@gmail.com>2018-01-03 20:14:47 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-03 20:14:47 +0800
commitb8caba97099ee5eed33c3b80dd4ea540722e7d8f (patch)
tree36c3661d083d81bc52676ff9a030f6e02c91b29c /les
parent9d48dbf5c2d0401042134d94997be1850bf8499b (diff)
downloaddexon-b8caba97099ee5eed33c3b80dd4ea540722e7d8f.tar
dexon-b8caba97099ee5eed33c3b80dd4ea540722e7d8f.tar.gz
dexon-b8caba97099ee5eed33c3b80dd4ea540722e7d8f.tar.bz2
dexon-b8caba97099ee5eed33c3b80dd4ea540722e7d8f.tar.lz
dexon-b8caba97099ee5eed33c3b80dd4ea540722e7d8f.tar.xz
dexon-b8caba97099ee5eed33c3b80dd4ea540722e7d8f.tar.zst
dexon-b8caba97099ee5eed33c3b80dd4ea540722e7d8f.zip
various: remove redundant parentheses (#15793)
Diffstat (limited to 'les')
-rw-r--r--les/handler.go4
-rw-r--r--les/serverpool.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/les/handler.go b/les/handler.go
index f8cf63952..e310942ba 100644
--- a/les/handler.go
+++ b/les/handler.go
@@ -454,14 +454,14 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
case query.Reverse:
// Number based traversal towards the genesis block
if query.Origin.Number >= query.Skip+1 {
- query.Origin.Number -= (query.Skip + 1)
+ query.Origin.Number -= query.Skip + 1
} else {
unknown = true
}
case !query.Reverse:
// Number based traversal towards the leaf block
- query.Origin.Number += (query.Skip + 1)
+ query.Origin.Number += query.Skip + 1
}
}
diff --git a/les/serverpool.go b/les/serverpool.go
index dc1ea6bf0..a84c29c3a 100644
--- a/les/serverpool.go
+++ b/les/serverpool.go
@@ -618,7 +618,7 @@ func (e *knownEntry) Weight() int64 {
if e.state != psNotConnected || !e.known || e.delayedRetry {
return 0
}
- return int64(1000000000 * e.connectStats.recentAvg() * math.Exp(-float64(e.lastConnected.fails)*failDropLn-e.responseStats.recentAvg()/float64(responseScoreTC)-e.delayStats.recentAvg()/float64(delayScoreTC)) * math.Pow((1-e.timeoutStats.recentAvg()), timeoutPow))
+ return int64(1000000000 * e.connectStats.recentAvg() * math.Exp(-float64(e.lastConnected.fails)*failDropLn-e.responseStats.recentAvg()/float64(responseScoreTC)-e.delayStats.recentAvg()/float64(delayScoreTC)) * math.Pow(1-e.timeoutStats.recentAvg(), timeoutPow))
}
// poolEntryAddress is a separate object because currently it is necessary to remember