doc(wallet): improve docs for Wallet::sent_and_received

This commit is contained in:
vmammal 2024-01-17 13:00:27 -05:00
parent 40f0765d30
commit 08b745ec9f
No known key found for this signature in database

View File

@ -914,12 +914,11 @@ impl<D> Wallet<D> {
}) })
} }
/// Computes total input value going from script pubkeys in the index (sent) and the total output /// Compute the `tx`'s sent and received amounts (in satoshis).
/// value going to script pubkeys in the index (received) in `tx`.
/// ///
/// For the `sent` to be computed correctly, the outputs being spent must have already been /// This method returns a tuple `(sent, received)`. Sent is the sum of the txin amounts
/// scanned by the index. Calculating received just uses the [`Transaction`] outputs directly, /// that spend from previous txouts tracked by this wallet. Received is the summation
/// so it will be correct even if it has not been scanned. /// of this tx's outputs that send to script pubkeys tracked by this wallet.
/// ///
/// # Examples /// # Examples
/// ///