Backport of PR #14411 to v0.17.
This change partially reverts #13075 and #14023.
Fixes #14382
70 | @@ -71,7 +71,17 @@ Notable changes 71 | 0.17.x change log 72 | ================= 73 | 74 | -... 75 | +`listtransaction` label support
Should be listtransactions with s.
fixed
76 | +------------------------------- 77 | + 78 | +The `listtransactions` RPC `account` parameter which was deprecated in 0.17.0 79 | +and renamed to `dummy` has been un-deprecated and renamed again to `label`. 80 | + 81 | +The behavior of the `label` argument is identical to previous behavior of the
This paragraph doesn't really make sense when both behaviors are present in the same release. I'd maybe change it to:
When bitcoin is configured with the
-deprecatedrpc=accountssetting, specifying alabel/account/dummyargument will return both outgoing and incoming transactions. Without the-deprecatedrpc=accountssetting, it will only return incoming transactions (because it used to be possible to create transactions spending from specific accounts, but this is no longer possible with labels).
I think it'd be good to document the empty string change. Maybe:
Also for backwards compatibility when
-deprecatedrpc=accountsis set, it's possible to pass an empty string label""to list transactions that aren't labeled. Without-deprecatedrpc=accounts, passing the empty string is an error because returning only non-labeled transactions isn't actually very useful, and can be confusing.
Both are good changes. Thanks!
2016 | @@ -2010,10 +2017,10 @@ UniValue listtransactions(const JSONRPCRequest& request) 2017 | pwallet->BlockUntilSyncedToCurrentChain(); 2018 | 2019 | std::string strAccount = "*"; 2020 | - if (!request.params[0].isNull()) { 2021 | + if (!request.params[0].isNull() && request.params[0].get_str() != "*") {
I don't see how the new check for "*" here changes anything. Maybe drop for clarity (unless I'm missing something).
No, you're right. It's better without. The behaviour would be identical with or without the check for "*". I've removed it.
utACK c8d1f1513fb39d80cebbc32e1b5327209485e085
Backport of PR 14411 to v0.17.
This change partially reverts #13075 and #14023.
Fixes #14382
Thanks for the review @ryanofsky! I've updated the PR with your changes.
utACK 89306ab0df93bfdf5630910bc20b1eccb7379172. Only changes since last review were code simplification and release notes updates suggested above.
utACK 89306ab.
utACK https://github.com/bitcoin/bitcoin/pull/14441/commits/89306ab0df93bfdf5630910bc20b1eccb7379172
This is slightly different from other backport PRs because the changes to src/wallet/rpcwallet.cpp are significantly different from the original PR to achieve the same functionality. The tests are basically a clean backport though.
Milestone
0.17.1