Fixes #25127
If there are any uncompressed keys when calling AddAndGetMultisigDestination
, it will just default to a legacy address regardless of the chosen address_type
. So, #23113 added a warnings field which will warn the user why their address format is different.
However, when creating a multisig (p2sh-segwit), it is returning an inappropriate warning, because when getting the output type from destination (OutputTypeFromDestination
), it returns ScriptHash
for both legacy and P2SH_SEGWIT
. So, since P2SH_SEGWIT
is different from ScriptHash
, it returns the warning:
https://github.com/bitcoin/bitcoin/blob/192d639a6b1bd0feaa52e6ea4e63e33982704c32/src/rpc/output_script.cpp#L166-L169
So, to avoid this mistake I changed OutputTypeFromDestination
to descriptor->GetOutputType()
to get the appropriate output type.