diff --git a/crates/chain/src/tx_graph.rs b/crates/chain/src/tx_graph.rs index f6144e7a2..565ef5d0d 100644 --- a/crates/chain/src/tx_graph.rs +++ b/crates/chain/src/tx_graph.rs @@ -516,12 +516,12 @@ impl TxGraph { /// Inserts the given transaction into [`TxGraph`]. /// /// The [`ChangeSet`] returned will be empty if `tx` already exists. - pub fn insert_tx(&mut self, tx: Transaction) -> ChangeSet { + pub fn insert_tx>>(&mut self, tx: T) -> ChangeSet { + let tx = tx.into(); let mut update = Self::default(); - update.txs.insert( - tx.txid(), - (TxNodeInternal::Whole(tx.into()), BTreeSet::new(), 0), - ); + update + .txs + .insert(tx.txid(), (TxNodeInternal::Whole(tx), BTreeSet::new(), 0)); self.apply_update(update) }