mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 21:42:47 +01:00
Support P2WPKH addresses in create/addmultisig
This commit is contained in:
parent
3eaa003c88
commit
37c03d3e05
@ -280,12 +280,12 @@ CScript _createmultisig_redeemScript(CWallet * const pwallet, const UniValue& pa
|
|||||||
// Case 1: Bitcoin address and we have full public key:
|
// Case 1: Bitcoin address and we have full public key:
|
||||||
CTxDestination dest = DecodeDestination(ks);
|
CTxDestination dest = DecodeDestination(ks);
|
||||||
if (pwallet && IsValidDestination(dest)) {
|
if (pwallet && IsValidDestination(dest)) {
|
||||||
const CKeyID *keyID = boost::get<CKeyID>(&dest);
|
CKeyID key = GetKeyForDestination(*pwallet, dest);
|
||||||
if (!keyID) {
|
if (key.IsNull()) {
|
||||||
throw std::runtime_error(strprintf("%s does not refer to a key", ks));
|
throw std::runtime_error(strprintf("%s does not refer to a key", ks));
|
||||||
}
|
}
|
||||||
CPubKey vchPubKey;
|
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));
|
throw std::runtime_error(strprintf("no full public key for address %s", ks));
|
||||||
}
|
}
|
||||||
if (!vchPubKey.IsFullyValid())
|
if (!vchPubKey.IsFullyValid())
|
||||||
|
Loading…
Reference in New Issue
Block a user