Repository navigation
Feat/coin selection strategies - #151
Conversation
e3ca307 to
f77c5cc
Compare
5417acb to
cf0c6e7
Compare
3d2e376 to
5dcb753
Compare
8238cc4 to
3165e06
Compare
|
Significant changes for this new version, trying to make it simpler :
|
e03df6f to
1efb1c5
Compare
sdmg15
left a comment
There was a problem hiding this comment.
tAck 1efb1c5#r4074784031.
Left few nits.
A question: Can we have a more straight function for users that just let them create the transaction but with defaults?
1efb1c5 to
8235f27
Compare
I think we can, but since a lot things will immediately change with introduction of psbt right after this PR I'd rather wait for things to settle before thinking of shortcuts and quality of life functions |
20958c6 to
4007508
Compare
4007508 to
33dcefe
Compare
72e4dca to
38dd6ab
Compare
ff02d6e to
143bbaa
Compare
143bbaa to
d7ab277
Compare
d7ab277 to
c34639f
Compare
44cf957 to
037d5dd
Compare
037d5dd to
aec4b3e
Compare
|
As discussed on another channel I rolled back the change on Strategy and InputSelection and kept the |
Introduce Changeless, LowestFee, and FeeRateCap BnB strategies with a Greedy fallback, plus a separate DrainSelection for spend-all.
Propose selections independently of building the unsigned transaction, and keep coin_select internals out of the crate's public API.
DATA_CARRIER_SIZE truncated weight estimates and rejected spends above 205 bytes. Drop it so selection and construction share the PushBytes bound. Co-authored-by: Cursor <cursoragent@cursor.com>
rename check_recipient_networks -> validate_recipient_networks rename prevouts -> validate_and_convert_to_txout rename candiate_from_txout -> validate_and_convert_to_candidate
aec4b3e to
dafc57c
Compare
| /// Wallet change amount (zero for drain / changeless selections). | ||
| pub change: Amount, | ||
| /// Index into `recipients` of the change output, if any. | ||
| pub change_index: Option<usize>, |
There was a problem hiding this comment.
These new fields have some data duplication. Instead of having a change field, can't we read the change amount using the change_index and the recipients fields? Also the fee can be read by subtracting the output_sum from the input_sum. Is there a reason for having these as separate fields?
There was a problem hiding this comment.
I'll make a separate PR for that to keep this PR untouched
dafc57c to
678d2de
Compare
Provide the available utxos as a hashmap rather than an array slice of tuples. This has 2 advantages: - We don't need to iterate over the entire list when looking for a txout associated with a selected outpoint, we can just use '.get' - It automatically guarantees that any outpoint is unique, since we can't have duplicate keys
This function is relatively straightforward and is only used in 1 place, so inline it instead.
Unless there is an interest to allow for custom hashers, just ignore this pedantic error.
678d2de to
3f2fa1c
Compare
No description provided.