diff --git a/crates/chain/src/indexed_tx_graph.rs b/crates/chain/src/indexed_tx_graph.rs index 28b95adf..f50f454b 100644 --- a/crates/chain/src/indexed_tx_graph.rs +++ b/crates/chain/src/indexed_tx_graph.rs @@ -190,7 +190,7 @@ impl IndexedTxGraph { } } - pub fn filter_and_insert_txs<'t, T>( + pub fn insert_relevant_txs<'t, T>( &mut self, txs: T, observation: ObservedAs, diff --git a/crates/chain/src/local_chain.rs b/crates/chain/src/local_chain.rs index fb7d008d..e1b24ad0 100644 --- a/crates/chain/src/local_chain.rs +++ b/crates/chain/src/local_chain.rs @@ -82,16 +82,16 @@ impl LocalChain { }; // the first block's height to invalidate in the local chain - let invalidate_from = self.blocks.range(invalidate_lb..).next().map(|(&h, _)| h); + let invalidate_from_height = self.blocks.range(invalidate_lb..).next().map(|(&h, _)| h); // the first block of height to invalidate (if any) should be represented in the update - if let Some(first_invalid) = invalidate_from { - if !update.contains_key(&first_invalid) { - return Err(UpdateError::NotConnected(first_invalid)); + if let Some(first_invalid_height) = invalidate_from_height { + if !update.contains_key(&first_invalid_height) { + return Err(UpdateError::NotConnected(first_invalid_height)); } } - let invalidated_heights = invalidate_from + let invalidated_heights = invalidate_from_height .into_iter() .flat_map(|from_height| self.blocks.range(from_height..).map(|(h, _)| h)); diff --git a/crates/chain/src/tx_graph.rs b/crates/chain/src/tx_graph.rs index c502d038..0959456d 100644 --- a/crates/chain/src/tx_graph.rs +++ b/crates/chain/src/tx_graph.rs @@ -21,7 +21,7 @@ //! # use bitcoin::Transaction; //! # let tx_a = tx_from_hex(RAW_TX_1); //! # let tx_b = tx_from_hex(RAW_TX_2); -//! let mut graph = TxGraph::::default(); +//! let mut graph: TxGraph = TxGraph::default(); //! //! // preview a transaction insertion (not actually inserted) //! let additions = graph.insert_tx_preview(tx_a);