mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-14 17:48:01 +02:00
Merge #13072: Update createmultisig RPC to support segwit
f40b3b82df[tests] functional test for createmultisig RPC (Anthony Towns)b9024fdda3segwit support for createmultisig RPC (Anthony Towns)d58055d25fMove AddAndGetDestinationForScript from wallet to outputype module (Anthony Towns)9a44db2e46Add outputtype module (Anthony Towns) Pull request description: 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 Tree-SHA512: a08c1cfa89976e4fd7d29caa90919ebd34a446354d17abb862e99f2ee60ed9bc19d8a21a18547c51dc3812cb9fbed86af0bef2f1e971f62bf95cade4a7d86237
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <validation.h>
|
||||
#include <key_io.h>
|
||||
#include <net.h>
|
||||
#include <outputtype.h>
|
||||
#include <policy/feerate.h>
|
||||
#include <policy/fees.h>
|
||||
#include <policy/policy.h>
|
||||
@@ -1369,8 +1370,7 @@ static UniValue addmultisigaddress(const JSONRPCRequest& request)
|
||||
|
||||
// Construct using pay-to-script-hash:
|
||||
CScript inner = CreateMultisigRedeemscript(required, pubkeys);
|
||||
pwallet->AddCScript(inner);
|
||||
CTxDestination dest = pwallet->AddAndGetDestinationForScript(inner, output_type);
|
||||
CTxDestination dest = AddAndGetDestinationForScript(*pwallet, inner, output_type);
|
||||
pwallet->SetAddressBook(dest, label, "send");
|
||||
|
||||
UniValue result(UniValue::VOBJ);
|
||||
|
||||
Reference in New Issue
Block a user