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

Commit

Permalink
add eip155 validation
Browse files Browse the repository at this point in the history
  • Loading branch information
keorn committed Mar 30, 2017
1 parent e0d5eed commit ca76ae8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ethcore/src/engines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use account_provider::AccountProvider;
use block::ExecutedBlock;
use builtin::Builtin;
use env_info::EnvInfo;
use error::Error;
use error::{Error, TransactionError};
use spec::CommonParams;
use evm::Schedule;
use header::Header;
Expand Down Expand Up @@ -157,6 +157,13 @@ pub trait Engine : Sync + Send {
// TODO: consider including State in the params.
fn verify_transaction_basic(&self, t: &UnverifiedTransaction, _header: &Header) -> Result<(), Error> {
t.check_low_s()?;

if let Some(n) = t.network_id() {
if n != self.params().chain_id {
return Err(TransactionError::InvalidNetworkId.into());
}
}

Ok(())
}

Expand Down

0 comments on commit ca76ae8

Please sign in to comment.