@@ -536,25 +536,23 @@ impl NakamotoBlockBuilder {
536
536
. mempool_settings
537
537
. tenure_cost_limit_per_block_percentage
538
538
{
539
- if ( 1 ..100 ) . contains ( & percentage) {
540
- let mut remaining_limit = block_limit. clone ( ) ;
541
- let cost_so_far = tenure_tx. cost_so_far ( ) ;
542
- if remaining_limit. sub ( & cost_so_far) . is_ok ( ) {
543
- if remaining_limit. divide ( 100 ) . is_ok ( ) {
544
- remaining_limit. multiply ( percentage. into ( ) ) . expect (
545
- "BUG: failed to multiply by {percentage} when previously divided by 100" ,
546
- ) ;
547
- remaining_limit. add ( & cost_so_far) . expect ( "BUG: unexpected overflow when adding cost_so_far, which was previously checked" ) ;
548
- debug ! (
549
- "Setting soft limit for clarity cost to {percentage}% of remaining block limit" ;
550
- "remaining_limit" => %remaining_limit,
551
- "cost_so_far" => %cost_so_far,
552
- "block_limit" => %block_limit,
553
- ) ;
554
- soft_limit = Some ( remaining_limit) ;
555
- }
556
- } ;
557
- }
539
+ let mut remaining_limit = block_limit. clone ( ) ;
540
+ let cost_so_far = tenure_tx. cost_so_far ( ) ;
541
+ if remaining_limit. sub ( & cost_so_far) . is_ok ( ) {
542
+ if remaining_limit. divide ( 100 ) . is_ok ( ) {
543
+ remaining_limit. multiply ( percentage. into ( ) ) . expect (
544
+ "BUG: failed to multiply by {percentage} when previously divided by 100" ,
545
+ ) ;
546
+ remaining_limit. add ( & cost_so_far) . expect ( "BUG: unexpected overflow when adding cost_so_far, which was previously checked" ) ;
547
+ debug ! (
548
+ "Setting soft limit for clarity cost to {percentage}% of remaining block limit" ;
549
+ "remaining_limit" => %remaining_limit,
550
+ "cost_so_far" => %cost_so_far,
551
+ "block_limit" => %block_limit,
552
+ ) ;
553
+ soft_limit = Some ( remaining_limit) ;
554
+ }
555
+ } ;
558
556
}
559
557
560
558
builder. soft_limit = soft_limit;
0 commit comments