mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf: use final paris difficulty if configured (#2969)
This commit is contained in:
@ -94,6 +94,12 @@ impl<'this, TX: DbTx<'this>> HeaderProvider for DatabaseProvider<'this, TX> {
|
||||
}
|
||||
|
||||
fn header_td_by_number(&self, number: BlockNumber) -> Result<Option<U256>> {
|
||||
if let Some(td) = self.chain_spec.final_paris_difficulty(number) {
|
||||
// if this block is higher than the final paris(merge) block, return the final paris
|
||||
// difficulty
|
||||
return Ok(Some(td))
|
||||
}
|
||||
|
||||
Ok(self.tx.get::<tables::HeaderTD>(number)?.map(|td| td.0))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user