Applied comments from PR and minor cleanup

This commit is contained in:
Jasmina Malicevic
2022-05-23 23:59:19 +02:00
parent 70dc94456f
commit 7d8fc400b7
3 changed files with 25 additions and 22 deletions
+1 -1
View File
@@ -238,7 +238,7 @@ func (pool *BlockPool) PopRequest() {
// to smooth the block sync rate and the unit represents the number of blocks per second.
// -1 because the start height is assumed to be 1 @jmalicevic ToDo, verify it is still OK when
// starting height is not 1
if (pool.height-pool.startHeight-1)%100 == 0 && pool.height != pool.startHeight {
if (pool.height-pool.startHeight+1)%100 == 0 {
newSyncRate := 100 / time.Since(pool.lastHundredBlockTimeStamp).Seconds()
if pool.lastSyncRate == 0 {
pool.lastSyncRate = newSyncRate