We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
TxGraph::try_filter_chain_unspents
1 parent 96b1075 commit fb75aa9Copy full SHA for fb75aa9
crates/chain/src/tx_graph.rs
@@ -865,7 +865,12 @@ impl<A: Anchor> TxGraph<A> {
865
outpoints: impl IntoIterator<Item = (S, OutPoint)> + 'a,
866
) -> impl Iterator<Item = Result<(S, FullTxOut<ObservedAs<A>>), C::Error>> + 'a {
867
self.try_filter_chain_txouts(chain, chain_tip, outpoints)
868
- .filter(|r| !matches!(r, Ok((_, full_txo)) if full_txo.spent_by.is_some()))
+ .filter(|r| match r {
869
+ // keep unspents, drop spents
870
+ Ok((_, full_txo)) => full_txo.spent_by.is_none(),
871
+ // keep errors
872
+ Err(_) => true,
873
+ })
874
}
875
876
/// Get a filtered list of unspent outputs (UTXOs) from the given `outpoints` that are in
0 commit comments