-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dcr: Add send all. #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested, but LGTM.
Both of these should be per byte I think, changed https://github.com/decred/libwallet/compare/8b3c43115468c4d8ec3f3d701696d3eb5deef5fc..bf70ab203d9352826f02fc5b5f2310581d803e94 |
does this respect the maximum tx size, or even the mempool policy for max accepted tx size it will relay? |
Also, why not use |
I wasn't sure how to deal with the fee in this case. We want to send all and not leave anything, so would we need to calculate the fee when using |
Just rebased. |
Respecting max tx size, I think https://github.com/decred/libwallet/compare/3dd5a92659ffd25c14a78de2f4ed574d0624d5a5..533ca6d0995f30e04c6620336f727b7414277e3f |
The method takes a fee rate (per kB), not an absolute fee. No matter what fee rate you provide, it shouldn't change the input selection, only the amount that is eventually sent. |
Ok, do we just set the output value to max value? I'll try. |
The wallet method hangs when setting the output value to the max int64. May be something to do with cgo, unsure.
|
Is the "OutputSelectionAlgorithm" argument completely ignored if we include an input source? It's convenient for use to choose the inputs because in cake users can choose to "freeze" or use certain inputs. Perhaps it is more correct for us to lock and unlock inputs in wallet? That would require alot of changes presently that I would rather not make at this time. I don't think the OutputSelectionAlgorithm argument is great for us atm. Maybe I am still missing something though. |
Input source must be nil to use OutputSelectionAlgorithmAll. If you want to sweep all value, you need to provide only a change address source and no other outputs. This will result in paying the total input value, minus any fee, to the single change address. |
If you want to control which inputs are used, return them all from the first call to the input source you provide, and again, specify only a change address source and no other outputs. This should have the same effect as OutputSelectionAlgorithmAll but lets you select which outputs are used. |
Thank you for the change source advice, that is working. https://github.com/decred/libwallet/compare/533ca6d0995f30e04c6620336f727b7414277e3f..fd79c8ee74c8db29c284116795c65afc96624857 |
No description provided.