Install trigger for DAO-rescue soft-fork.
Soft-fork should only be primed to trigger if the gas-limit of block #1760000 is at most 4,000,000. To accomplish this we pass in the gas limit of that block to EnvInfo so it can inform Schedule. This gets marshalled through `OpenBlock`/`ClosedBlock` and the `enact` functions much like `last_hashes`. `block.rs`'s `env_info()` takes care to ensure that if the current block happens to be #1760000, then we populate with the current `gas_limit`.
This commit is contained in:
@@ -42,7 +42,7 @@ use header::{BlockNumber, Header};
|
||||
use transaction::{LocalizedTransaction, SignedTransaction};
|
||||
use log_entry::LocalizedLogEntry;
|
||||
use filter::Filter;
|
||||
use views::BlockView;
|
||||
use views::{HeaderView, BlockView};
|
||||
use error::{ImportResult, ExecutionError};
|
||||
use receipt::LocalizedReceipt;
|
||||
use trace::LocalizedTrace;
|
||||
@@ -221,6 +221,13 @@ pub trait BlockChainClient : Sync + Send {
|
||||
Err(())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Get `Some` gas limit of block 1_760_000, or `None` if chain is not yet that long.
|
||||
fn dao_rescue_block_gas_limit(&self) -> Option<U256> {
|
||||
self.block_header(BlockID::Number(1_760_000))
|
||||
.map(|header| HeaderView::new(&header).gas_limit())
|
||||
}
|
||||
}
|
||||
|
||||
/// Extended client interface used for mining
|
||||
|
||||
Reference in New Issue
Block a user