Skip to content

Commit

Permalink
Support P2WPKH addresses in create/addmultisig
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa committed Jan 9, 2018
1 parent 3eaa003 commit 37c03d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rpc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 37c03d3

Please sign in to comment.