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
listtransactions
with s
.
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=accounts
setting, specifying alabel
/account
/dummy
argument will return both outgoing and incoming transactions. Without the-deprecatedrpc=accounts
setting, 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=accounts
is 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.
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() != "*") {
Backport of PR 14411 to v0.17.
This change partially reverts #13075 and #14023.
Fixes #14382
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.