diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-11-30 16:48:49 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2018-01-09 15:27:51 -0800 |
commit | 37c03d3e05713e14458ca2867e442926f165afea (patch) | |
tree | edb5f0e059761256a274c4c433c886e7d1c2fac5 | |
parent | 3eaa003c888f80207e8ff132f78417ff373ddfa3 (diff) |
Support P2WPKH addresses in create/addmultisig
-rw-r--r-- | src/rpc/misc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index f36879f3b1..826ac9d6bc 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -280,12 +280,12 @@ CScript _createmultisig_redeemScript(CWallet * const pwallet, const UniValue& pa // Case 1: Bitcoin address and we have full public key: CTxDestination dest = DecodeDestination(ks); if (pwallet && IsValidDestination(dest)) { - const CKeyID *keyID = boost::get<CKeyID>(&dest); - if (!keyID) { + CKeyID key = GetKeyForDestination(*pwallet, dest); + if (key.IsNull()) { throw std::runtime_error(strprintf("%s does not refer to a key", ks)); } CPubKey vchPubKey; - if (!pwallet->GetPubKey(*keyID, vchPubKey)) { + if (!pwallet->GetPubKey(key, vchPubKey)) { throw std::runtime_error(strprintf("no full public key for address %s", ks)); } if (!vchPubKey.IsFullyValid()) |