Fix panic on importing own invalid transaction (#3550)
This commit is contained in:
parent
cbeb2dc3f9
commit
a969c008d1
@ -580,15 +580,13 @@ impl Miner {
|
||||
let gas_required = |tx: &SignedTransaction| tx.gas_required(&schedule).into();
|
||||
let best_block_header: Header = ::rlp::decode(&chain.best_block_header());
|
||||
transactions.into_iter()
|
||||
.filter(|tx| match self.engine.verify_transaction_basic(tx, &best_block_header) {
|
||||
Ok(()) => true,
|
||||
.map(|tx| {
|
||||
match self.engine.verify_transaction_basic(&tx, &best_block_header) {
|
||||
Err(e) => {
|
||||
debug!(target: "miner", "Rejected tx {:?} with invalid signature: {:?}", tx.hash(), e);
|
||||
false
|
||||
}
|
||||
}
|
||||
)
|
||||
.map(|tx| {
|
||||
Err(e)
|
||||
},
|
||||
Ok(()) => {
|
||||
let origin = accounts.as_ref().and_then(|accounts| {
|
||||
tx.sender().ok().and_then(|sender| match accounts.contains(&sender) {
|
||||
true => Some(TransactionOrigin::Local),
|
||||
@ -604,6 +602,8 @@ impl Miner {
|
||||
transaction_queue.add_with_banlist(tx, &fetch_account, &gas_required)
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user