@@ -111,11 +111,8 @@ struct SealingWork {
111
111
enabled : bool ,
112
112
}
113
113
114
- type TransactionListener = Box < dyn Fn ( & [ TxHash ] ) + Send + Sync > ;
115
-
116
114
pub struct Miner {
117
115
mem_pool : Arc < RwLock < MemPool > > ,
118
- transaction_listener : RwLock < Vec < TransactionListener > > ,
119
116
next_allowed_reseal : Mutex < Instant > ,
120
117
next_mandatory_reseal : RwLock < Instant > ,
121
118
sealing_block_last_request : Mutex < u64 > ,
@@ -173,7 +170,6 @@ impl Miner {
173
170
174
171
Self {
175
172
mem_pool,
176
- transaction_listener : RwLock :: new ( vec ! [ ] ) ,
177
173
next_allowed_reseal : Mutex :: new ( Instant :: now ( ) ) ,
178
174
next_mandatory_reseal : RwLock :: new ( Instant :: now ( ) + options. reseal_max_period ) ,
179
175
params : RwLock :: new ( AuthoringParams :: default ( ) ) ,
@@ -196,11 +192,6 @@ impl Miner {
196
192
self . mem_pool . write ( ) . recover_from_db ( client) ;
197
193
}
198
194
199
- /// Set a callback to be notified about imported transactions' hashes.
200
- pub fn add_transactions_listener ( & self , f : Box < dyn Fn ( & [ TxHash ] ) + Send + Sync > ) {
201
- self . transaction_listener . write ( ) . push ( f) ;
202
- }
203
-
204
195
/// Get `Some` `clone()` of the current pending block's state or `None` if we're not sealing.
205
196
pub fn pending_state ( & self , latest_block_number : BlockNumber ) -> Option < TopLevelState > {
206
197
self . map_pending_block ( |b| b. state ( ) . clone ( ) , latest_block_number)
@@ -355,7 +346,7 @@ impl Miner {
355
346
356
347
debug_assert_eq ! ( insertion_results. len( ) , intermediate_results. iter( ) . filter( |r| r. is_ok( ) ) . count( ) ) ;
357
348
let mut insertion_results_index = 0 ;
358
- let results = intermediate_results
349
+ intermediate_results
359
350
. into_iter ( )
360
351
. map ( |res| match res {
361
352
Err ( e) => Err ( e) ,
@@ -367,13 +358,7 @@ impl Miner {
367
358
Ok ( result)
368
359
}
369
360
} )
370
- . collect ( ) ;
371
-
372
- for listener in & * self . transaction_listener . read ( ) {
373
- listener ( & inserted) ;
374
- }
375
-
376
- results
361
+ . collect ( )
377
362
}
378
363
379
364
fn calculate_timelock < C : BlockChainTrait > ( & self , tx : & SignedTransaction , client : & C ) -> Result < TxTimelock , Error > {
0 commit comments