0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00
Jon Atack 2020-01-09 17:11:54 +01:00
parent 6196e93001
commit c7654af6f8
No known key found for this signature in database
GPG key ID: 4F5721B3D0E3921D
3 changed files with 5 additions and 6 deletions

View file

@ -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`.

View file

@ -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 {

View file

@ -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