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 authored and simonjiao committed May 31, 2024
1 parent 79e7a06 commit 0ed3a57
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 0ed3a57

Please sign in to comment.