Refactoring removing invalid transactions from queue
This commit is contained in:
parent
c4021a77ca
commit
fece330ca4
@ -133,19 +133,14 @@ impl MinerService for Miner {
|
||||
transactions,
|
||||
);
|
||||
|
||||
match b {
|
||||
None => {
|
||||
*self.sealing_block.lock().unwrap() = None
|
||||
},
|
||||
Some((block, invalid_transactions)) => {
|
||||
*self.sealing_block.lock().unwrap() = b.map(|(block, invalid_transactions)| {
|
||||
let mut queue = self.transaction_queue.lock().unwrap();
|
||||
queue.remove_all(
|
||||
&invalid_transactions.into_iter().collect::<Vec<H256>>(),
|
||||
|a: &Address| chain.nonce(a)
|
||||
);
|
||||
*self.sealing_block.lock().unwrap() = Some(block)
|
||||
}
|
||||
}
|
||||
block
|
||||
});
|
||||
}
|
||||
|
||||
fn sealing_block(&self, chain: &BlockChainClient) -> &Mutex<Option<ClosedBlock>> {
|
||||
|
Loading…
Reference in New Issue
Block a user