Skip to content

Commit eaf6f63

Browse files
committed
rpc: fix inappropriate warning for address type p2sh-segwit in createmultisig and addmultisigaddress
1 parent 44037a2 commit eaf6f63

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/rpc/output_script.cpp

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

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

172172
return result;
173173
},

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)