Skip to content

Commit 7658055

Browse files
brunoergfanquake
authored andcommitted
rpc: fix inappropriate warning for address type p2sh-segwit in createmultisig and addmultisigaddress
Github-Pull: #25220 Rebased-From: eaf6f63
1 parent c3936cc commit 7658055

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/rpc/misc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ static RPCHelpMan createmultisig()
169169
result.pushKV("descriptor", descriptor->ToString());
170170

171171
UniValue warnings(UniValue::VARR);
172-
if (!request.params[2].isNull() && OutputTypeFromDestination(dest) != output_type) {
172+
if (descriptor->GetOutputType() != output_type) {
173173
// Only warns if the user has explicitly chosen an address type we cannot generate
174174
warnings.push_back("Unable to make chosen address type, please ensure no uncompressed public keys are present.");
175175
}
176-
if (warnings.size()) result.pushKV("warnings", warnings);
176+
if (!warnings.empty()) result.pushKV("warnings", warnings);
177177

178178
return result;
179179
},

src/wallet/rpc/addresses.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ RPCHelpMan addmultisigaddress()
302302
result.pushKV("descriptor", descriptor->ToString());
303303

304304
UniValue warnings(UniValue::VARR);
305-
if (!request.params[3].isNull() && OutputTypeFromDestination(dest) != output_type) {
305+
if (descriptor->GetOutputType() != output_type) {
306306
// Only warns if the user has explicitly chosen an address type we cannot generate
307307
warnings.push_back("Unable to make chosen address type, please ensure no uncompressed public keys are present.");
308308
}
309-
if (warnings.size()) result.pushKV("warnings", warnings);
309+
if (!warnings.empty()) result.pushKV("warnings", warnings);
310310

311311
return result;
312312
},

0 commit comments

Comments
 (0)