Skip to content

Commit 3f6160d

Browse files
authored
Merge branch 'main' into feat/jorm-tx
2 parents 7ab36ba + 1202a62 commit 3f6160d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

rust/cardano-chain-follower/examples/follow_chains.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ async fn start_sync_for(network: &Network, matches: ArgMatches) -> Result<(), Bo
111111
mithril_dl_connect_timeout = format!("{}", humantime::format_duration(connect_timeout));
112112
}
113113

114-
if let Some(data_timeout) = matches.get_one::<u64>("mithril-sync-data-timeout") {
114+
if let Some(data_timeout) = matches.get_one::<u64>("mithril-sync-data-read-timeout") {
115115
dl_config = dl_config.with_connection_timeout(Duration::from_secs(*data_timeout));
116116
}
117117
if let Some(data_timeout) = dl_config.data_read_timeout {

rust/cardano-chain-follower/src/follow.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,13 @@ impl ChainFollower {
109109
}
110110
}
111111

112-
if (self.mithril_tip.is_none() || current_mithril_tip > self.mithril_tip)
113-
&& self.current < self.mithril_tip
114-
{
112+
let roll_forward_condition = if let Some(mithril_tip) = &self.mithril_tip {
113+
current_mithril_tip > *mithril_tip && *mithril_tip > self.current
114+
} else {
115+
true
116+
};
117+
118+
if roll_forward_condition {
115119
let snapshot = MithrilSnapshot::new(self.chain);
116120
if let Some(block) = snapshot.read_block_at(&current_mithril_tip).await {
117121
// The Mithril Tip has moved forwards.

0 commit comments

Comments
 (0)