mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Merge 4f1a75b1aa into merged_master (Bitcoin PR bitcoin/bitcoin#22621)
This commit is contained in:
commit
1d89a2fdfa
7 changed files with 40 additions and 36 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#include <util/strencodings.h>
|
||||
#include <util/system.h>
|
||||
|
||||
#include <optional>
|
||||
#include <stdint.h>
|
||||
#include <tuple>
|
||||
#ifdef HAVE_MALLOC_INFO
|
||||
|
|
@ -164,12 +165,13 @@ static RPCHelpMan createmultisig()
|
|||
// Get the output type
|
||||
OutputType output_type = OutputType::LEGACY;
|
||||
if (!request.params[2].isNull()) {
|
||||
if (!ParseOutputType(request.params[2].get_str(), output_type)) {
|
||||
std::optional<OutputType> parsed = ParseOutputType(request.params[2].get_str());
|
||||
if (!parsed) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Unknown address type '%s'", request.params[2].get_str()));
|
||||
}
|
||||
if (output_type == OutputType::BECH32M) {
|
||||
} else if (parsed.value() == OutputType::BECH32M) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "createmultisig cannot create bech32m multisig addresses");
|
||||
}
|
||||
output_type = parsed.value();
|
||||
}
|
||||
|
||||
// Construct using pay-to-script-hash:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue