@@ -279,12 +279,21 @@ impl SignerCoordinator {
279
279
}
280
280
}
281
281
282
+ // build a BTreeMap of the various timeout steps
283
+ let mut block_rejection_timeout_steps = BTreeMap :: < u64 , Duration > :: new ( ) ;
284
+ for ( percentage, duration) in self . block_rejection_timeout_steps . iter ( ) {
285
+ let rejections_amount =
286
+ ( ( f64:: from ( self . total_weight ) / 100.0 ) * f64:: from ( * percentage) ) as u64 ;
287
+ block_rejection_timeout_steps. insert ( rejections_amount, * duration) ;
288
+ }
289
+
282
290
self . get_block_status (
283
291
& block. header . signer_signature_hash ( ) ,
284
292
& block. block_id ( ) ,
285
293
chain_state,
286
294
sortdb,
287
295
counters,
296
+ & block_rejection_timeout_steps,
288
297
)
289
298
}
290
299
@@ -300,15 +309,8 @@ impl SignerCoordinator {
300
309
chain_state : & mut StacksChainState ,
301
310
sortdb : & SortitionDB ,
302
311
counters : & Counters ,
312
+ block_rejection_timeout_steps : & BTreeMap < u64 , Duration > ,
303
313
) -> Result < Vec < MessageSignature > , NakamotoNodeError > {
304
- // build a BTreeMap of the various timeout steps
305
- let mut block_rejection_timeout_steps = BTreeMap :: < u64 , Duration > :: new ( ) ;
306
- for ( percentage, duration) in self . block_rejection_timeout_steps . iter ( ) {
307
- let rejections_amount =
308
- ( ( f64:: from ( self . total_weight ) / 100.0 ) * f64:: from ( * percentage) ) as u64 ;
309
- block_rejection_timeout_steps. insert ( rejections_amount, * duration) ;
310
- }
311
-
312
314
// the amount of current rejections (used to eventually modify the timeout)
313
315
let mut rejections: u64 = 0 ;
314
316
// default timeout (the 0 entry must be always present)
0 commit comments