Skip to content

Commit 02b26ba

Browse files
committed
Merge #19200: rpc: remove deprecated getaddressinfo fields
bc01f7a doc: release note for rpc getaddressinfo removals (Jon Atack) 90e9893 rpc: getaddressinfo RPCResult fixup (Jon Atack) a8507c9 rpc: remove deprecated getaddressinfo `labels: purpose` (Jon Atack) 645a865 rpc: remove deprecated getaddressinfo `label` field (Jon Atack) Pull request description: These were deprecated in #17578 and #17585, with expected 0.21 removal notified in the 0.20 release notes. ``` - The `getaddressinfo` RPC has had its `label` field deprecated (re-enable for this release using the configuration parameter `-deprecatedrpc=label`). The `labels` field is altered from returning JSON objects to returning a JSON array of label names (re-enable previous behavior for this release using the configuration parameter `-deprecatedrpc=labelspurpose`). Backwards compatibility using the deprecated configuration parameters is expected to be dropped in the 0.21 release. (#17585, #17578) ``` ACKs for top commit: Sjors: utACK bc01f7a adamjonas: utACK bc01f7a meshcollider: utACK bc01f7a Tree-SHA512: ae1af381e32c4c3bde8b061a56382838513a9a82c88767843cdeae3a2ab8aa7d8c2e66e106d2b31ea07d74bb80c191a2f842c9aaecc7c5438ad9a9bc66d1b251
2 parents 6bb5f6d + bc01f7a commit 02b26ba

File tree

5 files changed

+12
-118
lines changed

5 files changed

+12
-118
lines changed

doc/release-notes-19200.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Wallet
2+
3+
- Backwards compatibility has been dropped for two `getaddressinfo` RPC
4+
deprecations, as notified in the 0.20 release notes. The deprecated `label`
5+
field has been removed as well as the deprecated `labels` behavior of
6+
returning a JSON object containing `name` and `purpose` key-value pairs. Since
7+
0.20, the `labels` field returns a JSON array of label names. (#19200)

src/wallet/rpcwallet.cpp

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3631,25 +3631,18 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
36313631
{RPCResult::Type::STR_HEX, "pubkey", /* optional */ true, "The hex value of the raw public key for single-key addresses (possibly embedded in P2SH or P2WSH)."},
36323632
{RPCResult::Type::OBJ, "embedded", /* optional */ true, "Information about the address embedded in P2SH or P2WSH, if relevant and known.",
36333633
{
3634-
{RPCResult::Type::ELISION, "", "Includes all\n"
3635-
" getaddressinfo output fields for the embedded address, excluding metadata (timestamp, hdkeypath,\n"
3636-
"hdseedid) and relation to the wallet (ismine, iswatchonly)."},
3634+
{RPCResult::Type::ELISION, "", "Includes all getaddressinfo output fields for the embedded address, excluding metadata (timestamp, hdkeypath, hdseedid)\n"
3635+
"and relation to the wallet (ismine, iswatchonly)."},
36373636
}},
36383637
{RPCResult::Type::BOOL, "iscompressed", /* optional */ true, "If the pubkey is compressed."},
3639-
{RPCResult::Type::STR, "label", "DEPRECATED. The label associated with the address. Defaults to \"\". Replaced by the labels array below."},
36403638
{RPCResult::Type::NUM_TIME, "timestamp", /* optional */ true, "The creation time of the key, if available, expressed in " + UNIX_EPOCH_TIME + "."},
36413639
{RPCResult::Type::STR, "hdkeypath", /* optional */ true, "The HD keypath, if the key is HD and available."},
36423640
{RPCResult::Type::STR_HEX, "hdseedid", /* optional */ true, "The Hash160 of the HD seed."},
36433641
{RPCResult::Type::STR_HEX, "hdmasterfingerprint", /* optional */ true, "The fingerprint of the master key."},
36443642
{RPCResult::Type::ARR, "labels", "Array of labels associated with the address. Currently limited to one label but returned\n"
36453643
"as an array to keep the API stable if multiple labels are enabled in the future.",
36463644
{
3647-
{RPCResult::Type::STR, "label name", "The label name. Defaults to \"\"."},
3648-
{RPCResult::Type::OBJ, "", "label data, DEPRECATED, will be removed in 0.21. To re-enable, launch bitcoind with `-deprecatedrpc=labelspurpose`",
3649-
{
3650-
{RPCResult::Type::STR, "name", "The label name. Defaults to \"\"."},
3651-
{RPCResult::Type::STR, "purpose", "The purpose of the associated address (send or receive)."},
3652-
}},
3645+
{RPCResult::Type::STR, "label name", "Label name (defaults to \"\")."},
36533646
}},
36543647
}
36553648
},
@@ -3695,14 +3688,6 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
36953688
UniValue detail = DescribeWalletAddress(pwallet, dest);
36963689
ret.pushKVs(detail);
36973690

3698-
// DEPRECATED: Return label field if existing. Currently only one label can
3699-
// be associated with an address, so the label should be equivalent to the
3700-
// value of the name key/value pair in the labels array below.
3701-
const auto* address_book_entry = pwallet->FindAddressBookEntry(dest);
3702-
if (pwallet->chain().rpcEnableDeprecated("label") && address_book_entry) {
3703-
ret.pushKV("label", address_book_entry->GetLabel());
3704-
}
3705-
37063691
ret.pushKV("ischange", pwallet->IsChange(scriptPubKey));
37073692

37083693
ScriptPubKeyMan* spk_man = pwallet->GetScriptPubKeyMan(scriptPubKey);
@@ -3723,14 +3708,9 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
37233708
// stable if we allow multiple labels to be associated with an address in
37243709
// the future.
37253710
UniValue labels(UniValue::VARR);
3711+
const auto* address_book_entry = pwallet->FindAddressBookEntry(dest);
37263712
if (address_book_entry) {
3727-
// DEPRECATED: The previous behavior of returning an array containing a
3728-
// JSON object of `name` and `purpose` key/value pairs is deprecated.
3729-
if (pwallet->chain().rpcEnableDeprecated("labelspurpose")) {
3730-
labels.push_back(AddressBookDataToJSON(*address_book_entry, true));
3731-
} else {
3732-
labels.push_back(address_book_entry->GetLabel());
3733-
}
3713+
labels.push_back(address_book_entry->GetLabel());
37343714
}
37353715
ret.pushKV("labels", std::move(labels));
37363716

test/functional/rpc_getaddressinfo_label_deprecation.py

Lines changed: 0 additions & 43 deletions
This file was deleted.

test/functional/rpc_getaddressinfo_labels_purpose_deprecation.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

test/functional/test_runner.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@
242242
'p2p_permissions.py',
243243
'feature_blocksdir.py',
244244
'feature_config_args.py',
245-
'rpc_getaddressinfo_labels_purpose_deprecation.py',
246-
'rpc_getaddressinfo_label_deprecation.py',
247245
'rpc_getdescriptorinfo.py',
248246
'rpc_help.py',
249247
'feature_help.py',

0 commit comments

Comments
 (0)