Skip to content

Commit ab33b90

Browse files
TO BE SQUASHED: cargo fmt on the previous commit
1 parent 019fa4c commit ab33b90

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

crates/chain/src/tx_graph.rs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,25 +1047,37 @@ impl<A> ChangeSet<A> {
10471047
/// confirm or exclude these anchors.
10481048
///
10491049
/// See also: [`Self::missing_heights`]
1050-
pub fn relevant_heights(&self) -> impl Iterator<Item=u32> + '_ where A: Anchor {
1050+
pub fn relevant_heights(&self) -> impl Iterator<Item = u32> + '_
1051+
where
1052+
A: Anchor,
1053+
{
10511054
let mut dedup = None;
1052-
self.anchors.iter().map(|(a, _)| a.anchor_block().height).filter(move |height| {
1053-
let duplicate = dedup == Some(*height);
1054-
dedup = Some(*height);
1055-
!duplicate
1056-
})
1055+
self.anchors
1056+
.iter()
1057+
.map(|(a, _)| a.anchor_block().height)
1058+
.filter(move |height| {
1059+
let duplicate = dedup == Some(*height);
1060+
dedup = Some(*height);
1061+
!duplicate
1062+
})
10571063
}
10581064

1059-
10601065
/// Returns an iterator for the [`relevant_heights`] in this changeset that are not included in
10611066
/// `local_chain`. This tells you which heights you need to include in `local_chain` in order
10621067
/// for it to conclusively act as a [`ChainOracle`] for the transaction anchors this changeset
10631068
/// will add.
10641069
///
10651070
/// [`ChainOracle`]: crate::ChainOracle
10661071
/// [`relevant_heights`]: Self::relevant_heights
1067-
pub fn missing_heights_from<'a>(&'a self, local_chain: &'a LocalChain) -> impl Iterator<Item=u32> + 'a where A: Anchor {
1068-
self.relevant_heights().filter(move |height| !local_chain.blocks().contains_key(height))
1072+
pub fn missing_heights_from<'a>(
1073+
&'a self,
1074+
local_chain: &'a LocalChain,
1075+
) -> impl Iterator<Item = u32> + 'a
1076+
where
1077+
A: Anchor,
1078+
{
1079+
self.relevant_heights()
1080+
.filter(move |height| !local_chain.blocks().contains_key(height))
10691081
}
10701082
}
10711083

0 commit comments

Comments
 (0)