Skip to content

Commit 278210b

Browse files
committed
docs(bdk): clarify insert_txout docs
Inserted txouts will not be shown in `list_unspent` or `list_output`.
1 parent 6fb45d8 commit 278210b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

crates/bdk/src/wallet/mod.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,15 +814,20 @@ impl<D> Wallet<D> {
814814
}
815815

816816
/// Inserts a [`TxOut`] at [`OutPoint`] into the wallet's transaction graph.
817-
/// Any inserted TxOuts are not persisted until [`commit`] is called.
818817
///
819-
/// This can be used to add a `TxOut` that the wallet doesn't own but is used as an input to
820-
/// a [`Transaction`] passed to the [`calculate_fee`] or [`calculate_fee_rate`] functions.
818+
/// This is used for providing a previous output's value so that we can use [`calculate_fee`]
819+
/// or [`calculate_fee_rate`] on a given transaction. Outputs inserted with this method will
820+
/// not be returned in [`list_unspent`] or [`list_output`].
821821
///
822-
/// Only insert TxOuts you trust the values for!
822+
/// Any inserted `TxOut`s are not persisted until [`commit`] is called.
823+
///
824+
/// **WARNING:** This should only be used to add `TxOut`s that the wallet does not own. Only
825+
/// insert `TxOut`s that you trust the values for!
823826
///
824827
/// [`calculate_fee`]: Self::calculate_fee
825828
/// [`calculate_fee_rate`]: Self::calculate_fee_rate
829+
/// [`list_unspent`]: Self::list_unspent
830+
/// [`list_output`]: Self::list_output
826831
/// [`commit`]: Self::commit
827832
pub fn insert_txout(&mut self, outpoint: OutPoint, txout: TxOut)
828833
where

0 commit comments

Comments
 (0)