diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-05-15 00:21:11 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2019-06-20 11:02:00 -0400 |
commit | a49503402b6bc21e3878e151c07529941d36aed0 (patch) | |
tree | 5cd120a2b03b9335450ef8799b380aa574860e51 /src/rpc/util.h | |
parent | 65526fc8666fef35ef908dbc225f706bef642c7e (diff) | |
download | bitcoin-a49503402b6bc21e3878e151c07529941d36aed0.tar.xz |
Make and get the multisig redeemscript and destination in one function instead of two
Instead of creating a redeemScript with CreateMultisigRedeemscript and
then getting the destination with AddAndGetDestinationForScript, do
both in the same function.
CreateMultisigRedeemscript is changed to AddAndGetMultisigDestination.
It creates the redeemScript and returns it via an output parameter. Then
it calls AddAndGetDestinationForScript to add the destination to the
keystore and get the proper destination.
This allows us to inspect the public keys in the redeemScript before creating
the destination so that the correct destination is used when uncompressed
pubkeys are in the multisig.
Diffstat (limited to 'src/rpc/util.h')
-rw-r--r-- | src/rpc/util.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rpc/util.h b/src/rpc/util.h index e4fa8fc3d7..0eb2fef5c3 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -6,6 +6,7 @@ #define BITCOIN_RPC_UTIL_H #include <node/transaction.h> +#include <outputtype.h> #include <pubkey.h> #include <rpc/protocol.h> #include <script/standard.h> @@ -70,7 +71,7 @@ extern std::string HelpExampleRpc(const std::string& methodname, const std::stri CPubKey HexToPubKey(const std::string& hex_in); CPubKey AddrToPubKey(CKeyStore* const keystore, const std::string& addr_in); -CScript CreateMultisigRedeemscript(const int required, const std::vector<CPubKey>& pubkeys); +CTxDestination AddAndGetMultisigDestination(const int required, const std::vector<CPubKey>& pubkeys, OutputType type, CKeyStore& keystore, CScript& script_out); UniValue DescribeAddress(const CTxDestination& dest); |