Skip to content

Commit b7da752

Browse files
committed
docs: Improve SRD section
A None match indicates that either some error happened or no match was found. Expand the section to enumerate the possible reasons for returning None.
1 parent f2ec3e2 commit b7da752

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/single_random_draw.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ use crate::{WeightedUtxo, CHANGE_LOWER};
2626
/// An empty vec signifies that all possibilities where explored successfully and no match
2727
/// could be found with the given parameters. The first element of the tuple is a u32 which
2828
/// represents the number of iterations needed to find a solution.
29-
/// * `None` un-expected results during search. A future implementation can replace all `None`
30-
/// returns with a more informative error. Example of error: iteration limit hit, overflow
31-
/// when summing the UTXO space, Not enough potential amount to meet the target, etc.
29+
/// * `None` un-expected results OR no match found. A future implementation may add Error types
30+
/// which will differentiate between an unexpected error and no match found. Currently, a None
31+
/// type occurs when one or more of the following criteria are met:
32+
/// - Overflow when summing available UTXOs
33+
/// - Not enough potential amount to meet the target
34+
/// - Target Amount is zero (no match possible)
35+
/// - Search was successful yet no match found
3236
pub fn select_coins_srd<'a, R: rand::Rng + ?Sized, Utxo: WeightedUtxo>(
3337
target: Amount,
3438
fee_rate: FeeRate,

0 commit comments

Comments
 (0)