Adds an “address_type” parameter that accepts “legacy”, “p2sh-segwit”, and “bech32” to choose the type of address created. Defaults to “legacy” rather than the value of the -address-type
option for backwards compatibility.
As part of implementing this, OutputType is moved from wallet into its own module, and AddAndGetDestinationForScript
is changed to apply to a CKeyStore
rather than a wallet, and to invoke keystore.AddCScript(script)
itself rather than expecting the caller to have done that.
Fixes #12502