@@ -297,33 +297,6 @@ impl BankWithScheduler {
297
297
self . inner . scheduler . read ( ) . unwrap ( ) . is_some ( )
298
298
}
299
299
300
- #[ must_use]
301
- pub fn wait_for_completed_scheduler ( & self ) -> Option < ResultWithTimings > {
302
- BankWithSchedulerInner :: wait_for_scheduler (
303
- & self . inner . bank ,
304
- & self . inner . scheduler ,
305
- WaitReason :: TerminatedToFreeze ,
306
- )
307
- }
308
-
309
- pub ( crate ) fn wait_for_paused_scheduler ( bank : & Bank , scheduler : & InstalledSchedulerRwLock ) {
310
- let maybe_result_with_timings = BankWithSchedulerInner :: wait_for_scheduler (
311
- bank,
312
- scheduler,
313
- WaitReason :: PausedForRecentBlockhash ,
314
- ) ;
315
- assert ! (
316
- maybe_result_with_timings. is_none( ) ,
317
- "Premature result was returned from scheduler after paused"
318
- ) ;
319
- }
320
-
321
- // take needless &mut only to communicate its semantic mutability to humans...
322
- #[ cfg( feature = "dev-context-only-utils" ) ]
323
- pub fn drop_scheduler ( & mut self ) {
324
- self . inner . drop_scheduler ( ) ;
325
- }
326
-
327
300
// 'a is needed; anonymous_lifetime_in_impl_trait isn't stabilized yet...
328
301
pub fn schedule_transaction_executions < ' a > (
329
302
& self ,
@@ -342,12 +315,48 @@ impl BankWithScheduler {
342
315
}
343
316
}
344
317
318
+ // take needless &mut only to communicate its semantic mutability to humans...
319
+ #[ cfg( feature = "dev-context-only-utils" ) ]
320
+ pub fn drop_scheduler ( & mut self ) {
321
+ self . inner . drop_scheduler ( ) ;
322
+ }
323
+
324
+ pub ( crate ) fn wait_for_paused_scheduler ( bank : & Bank , scheduler : & InstalledSchedulerRwLock ) {
325
+ let maybe_result_with_timings = BankWithSchedulerInner :: wait_for_scheduler (
326
+ bank,
327
+ scheduler,
328
+ WaitReason :: PausedForRecentBlockhash ,
329
+ ) ;
330
+ assert ! (
331
+ maybe_result_with_timings. is_none( ) ,
332
+ "Premature result was returned from scheduler after paused"
333
+ ) ;
334
+ }
335
+
336
+ #[ must_use]
337
+ pub fn wait_for_completed_scheduler ( & self ) -> Option < ResultWithTimings > {
338
+ BankWithSchedulerInner :: wait_for_scheduler (
339
+ & self . inner . bank ,
340
+ & self . inner . scheduler ,
341
+ WaitReason :: TerminatedToFreeze ,
342
+ )
343
+ }
344
+
345
345
pub const fn no_scheduler_available ( ) -> InstalledSchedulerRwLock {
346
346
RwLock :: new ( None )
347
347
}
348
348
}
349
349
350
350
impl BankWithSchedulerInner {
351
+ #[ must_use]
352
+ fn wait_for_completed_scheduler_from_drop ( & self ) -> Option < ResultWithTimings > {
353
+ Self :: wait_for_scheduler (
354
+ & self . bank ,
355
+ & self . scheduler ,
356
+ WaitReason :: DroppedFromBankForks ,
357
+ )
358
+ }
359
+
351
360
#[ must_use]
352
361
fn wait_for_scheduler (
353
362
bank : & Bank ,
@@ -383,16 +392,6 @@ impl BankWithSchedulerInner {
383
392
result_with_timings
384
393
}
385
394
386
- #[ must_use]
387
- fn wait_for_completed_scheduler_from_drop ( & self ) -> Option < Result < ( ) > > {
388
- let maybe_result_with_timings = Self :: wait_for_scheduler (
389
- & self . bank ,
390
- & self . scheduler ,
391
- WaitReason :: DroppedFromBankForks ,
392
- ) ;
393
- maybe_result_with_timings. map ( |( result, _timings) | result)
394
- }
395
-
396
395
fn drop_scheduler ( & self ) {
397
396
if std:: thread:: panicking ( ) {
398
397
error ! (
@@ -403,7 +402,10 @@ impl BankWithSchedulerInner {
403
402
}
404
403
405
404
// There's no guarantee ResultWithTimings is available or not at all when being dropped.
406
- if let Some ( Err ( err) ) = self . wait_for_completed_scheduler_from_drop ( ) {
405
+ if let Some ( Err ( err) ) = self
406
+ . wait_for_completed_scheduler_from_drop ( )
407
+ . map ( |( result, _timings) | result)
408
+ {
407
409
warn ! (
408
410
"BankWithSchedulerInner::drop(): slot: {} discarding error from scheduler: {:?}" ,
409
411
self . bank. slot( ) ,
0 commit comments