Fix panic on importing own invalid transaction (#3550)
This commit is contained in:
parent
d6df25e871
commit
1c45c910cc
@ -470,14 +470,17 @@ impl Miner {
|
|||||||
|
|
||||||
let best_block_header: Header = ::util::rlp::decode(&chain.best_block_header());
|
let best_block_header: Header = ::util::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(()) => {
|
||||||
|
transaction_queue.add(tx, &fetch_account, origin)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.map(|tx| transaction_queue.add(tx, &fetch_account, origin))
|
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user