-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[wallet] sendtoaddress output type argument #11489
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
[wallet] sendtoaddress output type argument #11489
Conversation
b3cebac to
a742bcb
Compare
promag
left a comment
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.
Concept ACK.
src/wallet/rpcwallet.cpp
Outdated
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.
Should be change_style?
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.
Should default to GetArg("-changestyle")?
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.
Makes sense.
src/wallet/rpcwallet.cpp
Outdated
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.
I think it is preferable to add m_change_style to coin control so that a new key is consumed only when necessary. It can also helps in other send/fund calls. This should be used in:
Line 2679 in f74459d
| scriptChange = GetScriptForDestination(vchPubKey.GetID()); |
src/wallet/rpcwallet.cpp
Outdated
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.
Nit, replace ' with \". See:
bitcoin/src/wallet/rpcdump.cpp
Line 87 in f74459d
| "2. \"label\" (string, optional, default=\"\") An optional label\n" |
a742bcb to
56a0314
Compare
|
@promag Thanks for the review! Very good points. I've updated the code according to your suggestions. |
480a988 to
3e0e821
Compare
|
Closing this as I'm not sure of a good way to stay up to date with the other PR. Will reopen once merged instead. Edit: Reopened post-merge of dependent PR. |
e82ae08 to
6ac76db
Compare
6ac76db to
676b58d
Compare
|
Tend to NACK here. If you really want to control the change type on a per-call basis, maybe you should use createrawtransaction. It is not our goal to support every edge use-case. I doubt the option in sendtoaddress will still be useful two releases in the future and we'd have to deprecate it with way too much effort. Other than that, you could set the change type on the command line or use a more intelligent solution such as #12119 (not yet merged). |
|
I agree with @MarcoFalke. |
|
The next step "down" from |
|
I can understand the motivation to add an option to set the fee explicitly, but I fail to see any reason to support setting the change type. |
This is an attempt at fixing #11134.
It basically adds the output type flag as is, which is then used to generate the change destination.