diff options
-rw-r--r-- | doc/release-notes-17578.md | 2 | ||||
-rw-r--r-- | src/wallet/rpcwallet.cpp | 5 | ||||
-rwxr-xr-x | test/functional/rpc_getaddressinfo_labels_purpose_deprecation.py | 4 |
3 files changed, 5 insertions, 6 deletions
diff --git a/doc/release-notes-17578.md b/doc/release-notes-17578.md index 1b07436bb1..90156d6081 100644 --- a/doc/release-notes-17578.md +++ b/doc/release-notes-17578.md @@ -4,5 +4,5 @@ Deprecated or removed RPCs - The `getaddressinfo` RPC `labels` field now returns an array of label name strings. Previously, it returned an array of JSON objects containing `name` and `purpose` key/value pairs, which is now deprecated and will be removed in - 0.21. To re-enable the previous behavior, launch bitcoind with + 0.21. To re-enable the previous behavior, launch with `-deprecatedrpc=labelspurpose`. diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 85793ef180..e14e9157ca 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3843,12 +3843,11 @@ UniValue getaddressinfo(const JSONRPCRequest& request) // associated with an address, but we return an array so the API remains // stable if we allow multiple labels to be associated with an address in // the future. - // - // DEPRECATED: The previous behavior of returning an array containing a JSON - // object of `name` and `purpose` key/value pairs has been deprecated. UniValue labels(UniValue::VARR); std::map<CTxDestination, CAddressBookData>::iterator mi = pwallet->mapAddressBook.find(dest); if (mi != pwallet->mapAddressBook.end()) { + // DEPRECATED: The previous behavior of returning an array containing a + // JSON object of `name` and `purpose` key/value pairs is deprecated. if (pwallet->chain().rpcEnableDeprecated("labelspurpose")) { labels.push_back(AddressBookDataToJSON(mi->second, true)); } else { diff --git a/test/functional/rpc_getaddressinfo_labels_purpose_deprecation.py b/test/functional/rpc_getaddressinfo_labels_purpose_deprecation.py index 1049440d49..903f5536b9 100755 --- a/test/functional/rpc_getaddressinfo_labels_purpose_deprecation.py +++ b/test/functional/rpc_getaddressinfo_labels_purpose_deprecation.py @@ -4,8 +4,8 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Test deprecation of RPC getaddressinfo `labels` returning an array -containing a JSON hash of `name` and purpose` key-value pairs. It now -returns an array of label names. +containing a JSON object of `name` and purpose` key-value pairs. It now +returns an array containing only the label name. """ from test_framework.test_framework import BitcoinTestFramework |