Skip to content

Commit

Permalink
use FlexiDagConfig when reading dag fork height if G_TEST_DAG_FORK_ST…
Browse files Browse the repository at this point in the history
…ATE_KEY is not set
  • Loading branch information
jackzhhuang committed May 31, 2024
1 parent a66f951 commit c119a02
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2360,15 +2360,10 @@ impl BlockChain {
if result.is_ok() {
Ok(Some(G_TEST_DAG_FORK_HEIGHT))
} else {
let result = self.dag.get_dag_state(self.current_header().id());
if result.is_ok() {
Ok(Some(G_TEST_DAG_FORK_HEIGHT))
} else {
Ok(self
.statedb
.get_on_chain_config::<FlexiDagConfig>()?
.map(|c| c.effective_height))
}
Ok(self
.statedb
.get_on_chain_config::<FlexiDagConfig>()?
.map(|c| c.effective_height))
}
} else {
Ok(self
Expand Down

0 comments on commit c119a02

Please sign in to comment.