Skip to content

Commit c7654af

Browse files
committed
1 parent 6196e93 commit c7654af

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

doc/release-notes-17578.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Deprecated or removed RPCs
44
- The `getaddressinfo` RPC `labels` field now returns an array of label name
55
strings. Previously, it returned an array of JSON objects containing `name` and
66
`purpose` key/value pairs, which is now deprecated and will be removed in
7-
0.21. To re-enable the previous behavior, launch bitcoind with
7+
0.21. To re-enable the previous behavior, launch with
88
`-deprecatedrpc=labelspurpose`.

src/wallet/rpcwallet.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3843,12 +3843,11 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
38433843
// associated with an address, but we return an array so the API remains
38443844
// stable if we allow multiple labels to be associated with an address in
38453845
// the future.
3846-
//
3847-
// DEPRECATED: The previous behavior of returning an array containing a JSON
3848-
// object of `name` and `purpose` key/value pairs has been deprecated.
38493846
UniValue labels(UniValue::VARR);
38503847
std::map<CTxDestination, CAddressBookData>::iterator mi = pwallet->mapAddressBook.find(dest);
38513848
if (mi != pwallet->mapAddressBook.end()) {
3849+
// DEPRECATED: The previous behavior of returning an array containing a
3850+
// JSON object of `name` and `purpose` key/value pairs is deprecated.
38523851
if (pwallet->chain().rpcEnableDeprecated("labelspurpose")) {
38533852
labels.push_back(AddressBookDataToJSON(mi->second, true));
38543853
} else {

test/functional/rpc_getaddressinfo_labels_purpose_deprecation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""
66
Test deprecation of RPC getaddressinfo `labels` returning an array
7-
containing a JSON hash of `name` and purpose` key-value pairs. It now
8-
returns an array of label names.
7+
containing a JSON object of `name` and purpose` key-value pairs. It now
8+
returns an array containing only the label name.
99
1010
"""
1111
from test_framework.test_framework import BitcoinTestFramework

0 commit comments

Comments
 (0)