mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-09 22:28:51 +02:00
rpc: deprecate "warning" field in {create,load,unload,restore}wallet
This string field has been replaced in these four RPCs by a "warnings" field returning a JSON array of strings.
This commit is contained in:
@@ -1903,7 +1903,7 @@ RPCHelpMan restorewallet()
|
||||
RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::STR, "name", "The wallet name if restored successfully."},
|
||||
{RPCResult::Type::STR, "warning", "Warning messages, if any, related to restoring the wallet. Multiple messages will be delimited by newlines."},
|
||||
{RPCResult::Type::STR, "warning", /*optional=*/true, "Warning messages, if any, related to restoring the wallet. Multiple messages will be delimited by newlines. (DEPRECATED, returned only if config option -deprecatedrpc=walletwarningfield is passed.)"},
|
||||
{RPCResult::Type::ARR, "warnings", /*optional=*/true, "Warning messages, if any, related to restoring the wallet.",
|
||||
{
|
||||
{RPCResult::Type::STR, "", ""},
|
||||
@@ -1937,7 +1937,9 @@ RPCHelpMan restorewallet()
|
||||
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.pushKV("name", wallet->GetName());
|
||||
obj.pushKV("warning", Join(warnings, Untranslated("\n")).original);
|
||||
if (wallet->chain().rpcEnableDeprecated("walletwarningfield")) {
|
||||
obj.pushKV("warning", Join(warnings, Untranslated("\n")).original);
|
||||
}
|
||||
PushWarnings(warnings, obj);
|
||||
|
||||
return obj;
|
||||
|
||||
Reference in New Issue
Block a user