Skip to content

Commit 37c03d3

Browse files
committed
Support P2WPKH addresses in create/addmultisig
1 parent 3eaa003 commit 37c03d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rpc/misc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ CScript _createmultisig_redeemScript(CWallet * const pwallet, const UniValue& pa
280280
// Case 1: Bitcoin address and we have full public key:
281281
CTxDestination dest = DecodeDestination(ks);
282282
if (pwallet && IsValidDestination(dest)) {
283-
const CKeyID *keyID = boost::get<CKeyID>(&dest);
284-
if (!keyID) {
283+
CKeyID key = GetKeyForDestination(*pwallet, dest);
284+
if (key.IsNull()) {
285285
throw std::runtime_error(strprintf("%s does not refer to a key", ks));
286286
}
287287
CPubKey vchPubKey;
288-
if (!pwallet->GetPubKey(*keyID, vchPubKey)) {
288+
if (!pwallet->GetPubKey(key, vchPubKey)) {
289289
throw std::runtime_error(strprintf("no full public key for address %s", ks));
290290
}
291291
if (!vchPubKey.IsFullyValid())

0 commit comments

Comments
 (0)