aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrunoerg <brunoely.gc@gmail.com>2022-05-25 15:16:22 -0300
committerfanquake <fanquake@gmail.com>2022-06-09 12:05:04 +0100
commit7658055c4e97b998639b67fd6dca386c1cdc748a (patch)
tree9858bc35ac682188fc2e5de847fad1b597d1f25b /src
parentc3936cc53dabc5de531249b8097e1c25f41a4c3b (diff)
downloadbitcoin-7658055c4e97b998639b67fd6dca386c1cdc748a.tar.xz
rpc: fix inappropriate warning for address type p2sh-segwit in createmultisig and addmultisigaddress
Github-Pull: #25220 Rebased-From: eaf6f630c0190c634b5f1c85f749437f4209cc36
Diffstat (limited to 'src')
-rw-r--r--src/rpc/misc.cpp4
-rw-r--r--src/wallet/rpc/addresses.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp
index 8d7b48d697..2dace52777 100644
--- a/src/rpc/misc.cpp
+++ b/src/rpc/misc.cpp
@@ -169,11 +169,11 @@ static RPCHelpMan createmultisig()
result.pushKV("descriptor", descriptor->ToString());
UniValue warnings(UniValue::VARR);
- if (!request.params[2].isNull() && OutputTypeFromDestination(dest) != output_type) {
+ if (descriptor->GetOutputType() != output_type) {
// Only warns if the user has explicitly chosen an address type we cannot generate
warnings.push_back("Unable to make chosen address type, please ensure no uncompressed public keys are present.");
}
- if (warnings.size()) result.pushKV("warnings", warnings);
+ if (!warnings.empty()) result.pushKV("warnings", warnings);
return result;
},
diff --git a/src/wallet/rpc/addresses.cpp b/src/wallet/rpc/addresses.cpp
index 51587a64a3..bb9d2aea9b 100644
--- a/src/wallet/rpc/addresses.cpp
+++ b/src/wallet/rpc/addresses.cpp
@@ -302,11 +302,11 @@ RPCHelpMan addmultisigaddress()
result.pushKV("descriptor", descriptor->ToString());
UniValue warnings(UniValue::VARR);
- if (!request.params[3].isNull() && OutputTypeFromDestination(dest) != output_type) {
+ if (descriptor->GetOutputType() != output_type) {
// Only warns if the user has explicitly chosen an address type we cannot generate
warnings.push_back("Unable to make chosen address type, please ensure no uncompressed public keys are present.");
}
- if (warnings.size()) result.pushKV("warnings", warnings);
+ if (!warnings.empty()) result.pushKV("warnings", warnings);
return result;
},