@@ -34,7 +34,7 @@ use parking_lot::Mutex;
34
34
35
35
use sp_runtime:: {
36
36
generic:: BlockId ,
37
- traits:: { Block as BlockT , NumberFor , SimpleArithmetic } ,
37
+ traits:: { Block as BlockT , NumberFor , SimpleArithmetic , Extrinsic } ,
38
38
} ;
39
39
use sp_transaction_pool:: {
40
40
TransactionPool , PoolStatus , ImportNotificationStream ,
@@ -278,7 +278,7 @@ where
278
278
let block_number = match api. block_id_to_number ( & id) {
279
279
Ok ( Some ( number) ) => number,
280
280
_ => {
281
- log:: trace!( target: "txqueue" , "Skipping chain event - no numbrer for that block {:?}" , id) ;
281
+ log:: trace!( target: "txqueue" , "Skipping chain event - no number for that block {:?}" , id) ;
282
282
return Box :: pin ( ready ( ( ) ) ) ;
283
283
}
284
284
} ;
@@ -292,18 +292,21 @@ where
292
292
let retracted = retracted. to_vec ( ) ;
293
293
294
294
async move {
295
- let hashes = api. block_body ( & id) . await
296
- . unwrap_or_else ( |e| {
297
- log:: warn!( "Prune known transactions: error request {:?}!" , e) ;
298
- None
299
- } )
295
+ // We don't query block if we won't prune anything
296
+ if !pool. status ( ) . is_empty ( ) {
297
+ let hashes = api. block_body ( & id) . await
298
+ . unwrap_or_else ( |e| {
299
+ log:: warn!( "Prune known transactions: error request {:?}!" , e) ;
300
+ None
301
+ } )
300
302
. unwrap_or_default ( )
301
303
. into_iter ( )
302
304
. map ( |tx| pool. hash_of ( & tx) )
303
305
. collect :: < Vec < _ > > ( ) ;
304
306
305
- if let Err ( e) = pool. prune_known ( & id, & hashes) {
306
- log:: error!( "Cannot prune known in the pool {:?}!" , e) ;
307
+ if let Err ( e) = pool. prune_known ( & id, & hashes) {
308
+ log:: error!( "Cannot prune known in the pool {:?}!" , e) ;
309
+ }
307
310
}
308
311
309
312
if next_action. resubmit {
@@ -315,7 +318,9 @@ where
315
318
log:: warn!( "Failed to fetch block body {:?}!" , e) ;
316
319
None
317
320
} )
318
- . unwrap_or_default ( ) ;
321
+ . unwrap_or_default ( )
322
+ . into_iter ( )
323
+ . filter ( |tx| tx. is_signed ( ) . unwrap_or ( true ) ) ;
319
324
320
325
resubmit_transactions. extend ( block_transactions) ;
321
326
}
0 commit comments