File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1346,7 +1346,7 @@ async def ingest_blocks(
1346
1346
],
1347
1347
) -> None :
1348
1348
nonlocal fork_info
1349
- block_rate = 0
1349
+ block_rate = 0.0
1350
1350
block_rate_time = time .monotonic ()
1351
1351
block_rate_height = - 1
1352
1352
while True :
@@ -1377,12 +1377,13 @@ async def ingest_blocks(
1377
1377
raise ValueError (f"Failed to validate block batch { start_height } to { end_height } : { err } " )
1378
1378
if end_height - block_rate_height > 100 :
1379
1379
now = time .monotonic ()
1380
- block_rate = int (( end_height - block_rate_height ) // (now - block_rate_time ) )
1380
+ block_rate = ( end_height - block_rate_height ) / (now - block_rate_time )
1381
1381
block_rate_time = now
1382
1382
block_rate_height = end_height
1383
1383
1384
1384
self .log .info (
1385
- f"Added blocks { start_height } to { end_height } ({ block_rate } blocks/s) (from: { peer .peer_info .ip } )"
1385
+ "Added blocks {start_height} to {end_height} "
1386
+ f"({ block_rate :.3g} blocks/s) (from: { peer .peer_info .ip } )"
1386
1387
)
1387
1388
peak : Optional [BlockRecord ] = self .blockchain .get_peak ()
1388
1389
if state_change_summary is not None :
You can’t perform that action at this time.
0 commit comments