-
Notifications
You must be signed in to change notification settings - Fork 38.8k
getrawtransaction should take a bool for verbose #9025
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
Conversation
|
utACK, but please remove the deprecation warning. We may want to repurpose the ints as 'verbosity level' in the future, if an even more verbose mode is added. See #8704 (comment) . There's zero overhead in simply accepting both without warnings or complaints. Maybe add a |
|
Seems if we're going to do a verbosity level for getblock, we should just make that the "preferred" form here too? |
NACK. There are several other RPCs which take a bool for a more verbose output: getrawmempool, getmempoolancestors, getmempooldescendants, getblockheader, getblock, gettxout (where the option is includemempool). As far as I can tell, getrawtransaction is the only call which currently takes a num. It's less disruptive to change one RPC to use a bool than change all the others to use nums. |
9ecd900 to
837c06f
Compare
|
@laanwj - warning removed and commits squashed. |
src/rpc/rawtransaction.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.
maybe s/or set to 0/or set to false/?
src/rpc/rawtransaction.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.
maybe simplify with s/(request.params[1].isBool() && request.params[1].get_bool())/request.params[1].isTrue()/
|
utACK 837c06fe22a08d49f480ae629767c1ed8b7b9246, maybe consider nits/simplifications. |
837c06f to
0f3f86f
Compare
|
Thanks @jonasschnelli . Nits fixed and squashed. |
0f3f86f to
719f7e3
Compare
src/rpc/rawtransaction.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.
Note that isTrue doesn't fail if the value is not a bool, so this also accepts non-bool and non-int values. E.g.:
src/bitcoin-cli -regtest getrawtransaction 0000000000000000000000000000000000000000000000000000000000000000 '"b"'
error code: -5
error message:
No information available about transaction
Same for {} [] etc. Should probably raise an error in that case.
|
@jnewbery this just needs my above comment fixed and it can be merged. |
|
Thanks @laanwj . I've made the suggested change. I want to write some additional test cases to cover the new code and then I'll push the new commits. |
719f7e3 to
240189b
Compare
|
@laanwj - as requested, |
|
utACK 240189b |
Github-Pull: bitcoin#9025 Rebased-From: ce2bb23
Github-Pull: bitcoin#9025 Rebased-From: 240189b
As suggested by @gmaxwell in #9024 .
getrawtransaction now takes a bool for verbose. It will still take an int for verbose for back-compatibility, but issue a warning to the user.