Minor comments from PR

This commit is contained in:
Jasmina Malicevic
2022-05-12 14:31:53 +02:00
parent 26e864c7ff
commit 47bd5cc65d
2 changed files with 9 additions and 5 deletions
+6 -2
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 {
if (pool.height-pool.startHeight)%100 == 0 && pool.height != pool.startHeight {
newSyncRate := 100 / time.Since(pool.lastHundredBlockTimeStamp).Seconds()
if pool.lastSyncRate == 0 {
pool.lastSyncRate = newSyncRate
@@ -558,11 +558,15 @@ func (peer *bpPeer) onTimeout() {
//-------------------------------------
type BlockResponse struct {
// Trusted Block data stores the last block verified by blocksync
// along with the commit used to verify it.
type TrustedBlockData struct {
block *types.Block
commit *types.Commit
}
//-------------------------------------
type bpRequester struct {
service.BaseService
logger log.Logger