mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 21:34:33 +00:00
[FIX] Add missing gas used validation (#740)
This commit is contained in:
parent
02afb27e47
commit
32e57a6aa1
@ -180,6 +180,9 @@ proc validateHeader(db: BaseChainDB; header, parentHeader: BlockHeader;
|
|||||||
if header.gasUsed == 0 and 0 < numTransactions:
|
if header.gasUsed == 0 and 0 < numTransactions:
|
||||||
return err("zero gasUsed but tranactions present");
|
return err("zero gasUsed but tranactions present");
|
||||||
|
|
||||||
|
if header.gasUsed < 0 or header.gasUsed > header.gasLimit:
|
||||||
|
return err("gasUsed should be non negative and smaller or equal gasLimit")
|
||||||
|
|
||||||
if header.blockNumber != parentHeader.blockNumber + 1:
|
if header.blockNumber != parentHeader.blockNumber + 1:
|
||||||
return err("Blocks must be numbered consecutively")
|
return err("Blocks must be numbered consecutively")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user