Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Fix panic on importing own invalid transaction (#3550)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkpar committed Nov 25, 2016
1 parent d6df25e commit 1c45c91
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ethcore/src/miner/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,17 @@ impl Miner {

let best_block_header: Header = ::util::rlp::decode(&chain.best_block_header());
transactions.into_iter()
.filter(|tx| match self.engine.verify_transaction_basic(tx, &best_block_header) {
Ok(()) => true,
Err(e) => {
debug!(target: "miner", "Rejected tx {:?} with invalid signature: {:?}", tx.hash(), e);
false
.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);
Err(e)
},
Ok(()) => {
transaction_queue.add(tx, &fetch_account, origin)
},
}
})
.map(|tx| transaction_queue.add(tx, &fetch_account, origin))
.collect()
}

Expand Down

0 comments on commit 1c45c91

Please sign in to comment.