Check transaction signature when adding to the queue (#3508)
This commit is contained in:
parent
2981a23880
commit
45d8fc9bf1
@ -21,6 +21,7 @@ use util::*;
|
|||||||
use util::using_queue::{UsingQueue, GetAction};
|
use util::using_queue::{UsingQueue, GetAction};
|
||||||
use account_provider::AccountProvider;
|
use account_provider::AccountProvider;
|
||||||
use views::{BlockView, HeaderView};
|
use views::{BlockView, HeaderView};
|
||||||
|
use header::Header;
|
||||||
use state::{State, CleanupMode};
|
use state::{State, CleanupMode};
|
||||||
use client::{MiningBlockChainClient, Executive, Executed, EnvInfo, TransactOptions, BlockID, CallAnalytics};
|
use client::{MiningBlockChainClient, Executive, Executed, EnvInfo, TransactOptions, BlockID, CallAnalytics};
|
||||||
use executive::contract_address;
|
use executive::contract_address;
|
||||||
@ -467,7 +468,15 @@ impl Miner {
|
|||||||
balance: chain.latest_balance(a),
|
balance: chain.latest_balance(a),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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) {
|
||||||
|
Ok(()) => true,
|
||||||
|
Err(e) => {
|
||||||
|
debug!(target: "miner", "Rejected tx {:?} with invalid signature: {:?}", tx.hash(), e);
|
||||||
|
false
|
||||||
|
}
|
||||||
|
})
|
||||||
.map(|tx| 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