Disallow unsigned transactions in case EIP-86 is disabled

This commit is contained in:
tomusdrw 2018-06-06 00:33:16 +08:00 committed by Wei Tang
parent f468d705ad
commit 6e7efb5fef

View File

@ -392,6 +392,10 @@ impl UnverifiedTransaction {
if check_low_s && !(allow_empty_signature && self.is_unsigned()) { if check_low_s && !(allow_empty_signature && self.is_unsigned()) {
self.check_low_s()?; self.check_low_s()?;
} }
// Disallow unsigned transactions in case EIP-86 is disabled.
if !allow_empty_signature && self.is_unsigned() {
return Err(ethkey::Error::InvalidSignature.into());
}
// EIP-86: Transactions of this form MUST have gasprice = 0, nonce = 0, value = 0, and do NOT increment the nonce of account 0. // EIP-86: Transactions of this form MUST have gasprice = 0, nonce = 0, value = 0, and do NOT increment the nonce of account 0.
if allow_empty_signature && self.is_unsigned() && !(self.gas_price.is_zero() && self.value.is_zero() && self.nonce.is_zero()) { if allow_empty_signature && self.is_unsigned() && !(self.gas_price.is_zero() && self.value.is_zero() && self.nonce.is_zero()) {
return Err(ethkey::Error::InvalidSignature.into()) return Err(ethkey::Error::InvalidSignature.into())