diff --git a/crates/chain/src/indexed_tx_graph.rs b/crates/chain/src/indexed_tx_graph.rs index 91ecd571..4245e57d 100644 --- a/crates/chain/src/indexed_tx_graph.rs +++ b/crates/chain/src/indexed_tx_graph.rs @@ -22,6 +22,7 @@ pub struct TxOutInChain<'a, I, A> { pub txout: FullTxOut>, } +#[must_use] pub struct IndexedAdditions { pub graph_additions: Additions, pub index_delta: D, @@ -83,8 +84,17 @@ impl IndexedTxGraph { graph_additions, index_delta, } = additions; - self.graph.apply_additions(graph_additions); + self.index.apply_additions(index_delta); + + for tx in &graph_additions.tx { + self.index.index_tx(tx); + } + for (&outpoint, txout) in &graph_additions.txout { + self.index.index_txout(outpoint, txout); + } + + self.graph.apply_additions(graph_additions); } /// Insert a `txout` that exists in `outpoint` with the given `observation`.