File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -358,10 +358,13 @@ impl Node {
358
358
}
359
359
CpuTaskType :: IBBlockGenerated ( _) => vec ! [ cpu_times. ib_generation] ,
360
360
CpuTaskType :: IBHeaderValidated ( _, _, _) => vec ! [ cpu_times. ib_head_validation] ,
361
- CpuTaskType :: IBBlockValidated ( _, ib) => vec ! [
362
- cpu_times. ib_body_validation_constant
363
- + ( cpu_times. ib_body_validation_per_byte * ib. bytes( ) as u32 ) ,
364
- ] ,
361
+ CpuTaskType :: IBBlockValidated ( _, ib) => {
362
+ let total_tx_bytes: u64 = ib. transactions . iter ( ) . map ( |tx| tx. bytes ) . sum ( ) ;
363
+ vec ! [
364
+ cpu_times. ib_body_validation_constant
365
+ + ( cpu_times. ib_body_validation_per_byte * total_tx_bytes as u32 ) ,
366
+ ]
367
+ }
365
368
CpuTaskType :: EBBlockGenerated ( _) => vec ! [ cpu_times. eb_generation] ,
366
369
CpuTaskType :: EBBlockValidated ( _, _) => vec ! [ cpu_times. eb_validation] ,
367
370
CpuTaskType :: VTBundleGenerated ( votes) => votes
You can’t perform that action at this time.
0 commit comments