Skip to content

Commit 7f16781

Browse files
committed
doc(tx_builder): add info about manually selected UTxOs priority
1 parent a7a5888 commit 7f16781

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

wallet/src/wallet/tx_builder.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ impl<'a, Cs> TxBuilder<'a, Cs> {
276276
///
277277
/// These have priority over the "unspendable" utxos, meaning that if a utxo is present both in
278278
/// the "utxos" and the "unspendable" list, it will be spent.
279+
///
280+
/// If a UTxO is inserted multiple times, only the final insertion will take effect.
279281
pub fn add_utxos(&mut self, outpoints: &[OutPoint]) -> Result<&mut Self, AddUtxoError> {
280282
for recv_outpoint in outpoints {
281283
let output = self
@@ -313,6 +315,10 @@ impl<'a, Cs> TxBuilder<'a, Cs> {
313315

314316
/// Add a foreign UTXO i.e. a UTXO not known by this wallet.
315317
///
318+
/// Foreign UTxOs do not take priority over local UTxOs. If a local UTxO is added to the
319+
/// manually selected list, it will replace any conflicting foreign UTxOs. However, a foreign
320+
/// UTxO cannot replace a conflicting local UTxO.
321+
///
316322
/// There might be cases where the UTxO belongs to the wallet but it doesn't have knowledge of
317323
/// it. This is possible if the wallet is not synced or its not being use to track
318324
/// transactions. In those cases is the responsibility of the user to add any possible local

0 commit comments

Comments
 (0)