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 gas_required = |tx: &SignedTransaction| tx.gas_required(&schedule).into();
|
||||||
let best_block_header: Header = ::rlp::decode(&chain.best_block_header());
|
let best_block_header: Header = ::rlp::decode(&chain.best_block_header());
|
||||||
transactions.into_iter()
|
transactions.into_iter()
|
||||||
.filter(|tx| match self.engine.verify_transaction_basic(tx, &best_block_header) {
|
.map(|tx| {
|
||||||
Ok(()) => true,
|
match self.engine.verify_transaction_basic(&tx, &best_block_header) {
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
debug!(target: "miner", "Rejected tx {:?} with invalid signature: {:?}", tx.hash(), e);
|
debug!(target: "miner", "Rejected tx {:?} with invalid signature: {:?}", tx.hash(), e);
|
||||||
false
|
Err(e)
|
||||||
}
|
},
|
||||||
}
|
Ok(()) => {
|
||||||
)
|
|
||||||
.map(|tx| {
|
|
||||||
let origin = accounts.as_ref().and_then(|accounts| {
|
let origin = accounts.as_ref().and_then(|accounts| {
|
||||||
tx.sender().ok().and_then(|sender| match accounts.contains(&sender) {
|
tx.sender().ok().and_then(|sender| match accounts.contains(&sender) {
|
||||||
true => Some(TransactionOrigin::Local),
|
true => Some(TransactionOrigin::Local),
|
||||||
@ -604,6 +602,8 @@ impl Miner {
|
|||||||
transaction_queue.add_with_banlist(tx, &fetch_account, &gas_required)
|
transaction_queue.add_with_banlist(tx, &fetch_account, &gas_required)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user