Skip to content

Commit 08b745e

Browse files
committed
doc(wallet): improve docs for Wallet::sent_and_received
1 parent 40f0765 commit 08b745e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

crates/bdk/src/wallet/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -914,12 +914,11 @@ impl<D> Wallet<D> {
914914
})
915915
}
916916

917-
/// Computes total input value going from script pubkeys in the index (sent) and the total output
918-
/// value going to script pubkeys in the index (received) in `tx`.
917+
/// Compute the `tx`'s sent and received amounts (in satoshis).
919918
///
920-
/// For the `sent` to be computed correctly, the outputs being spent must have already been
921-
/// scanned by the index. Calculating received just uses the [`Transaction`] outputs directly,
922-
/// so it will be correct even if it has not been scanned.
919+
/// This method returns a tuple `(sent, received)`. Sent is the sum of the txin amounts
920+
/// that spend from previous txouts tracked by this wallet. Received is the summation
921+
/// of this tx's outputs that send to script pubkeys tracked by this wallet.
923922
///
924923
/// # Examples
925924
///

0 commit comments

Comments
 (0)