aboutsummaryrefslogtreecommitdiff
path: root/src/rpcwallet.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-05-01 06:52:05 +0200
committerPieter Wuille <sipa@ulyssis.org>2013-05-30 05:20:21 +0200
commitdfa23b94c24aae6466152fccbe896ba5dc0e97b4 (patch)
treea1f7f856577b2223bae9351c960b595b4032ce7a /src/rpcwallet.cpp
parent5d891489ab7828ad8db15e85bb63e2f13f021a6a (diff)
downloadbitcoin-dfa23b94c24aae6466152fccbe896ba5dc0e97b4.tar.xz
CSecret/CKey -> CKey/CPubKey split/refactor
Diffstat (limited to 'src/rpcwallet.cpp')
-rw-r--r--src/rpcwallet.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index 64ee39081b..89f094fa8b 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -374,11 +374,11 @@ Value verifymessage(const Array& params, bool fHelp)
ss << strMessageMagic;
ss << strMessage;
- CKey key;
- if (!key.SetCompactSignature(ss.GetHash(), vchSig))
+ CPubKey pubkey;
+ if (!pubkey.RecoverCompact(ss.GetHash(), vchSig))
return false;
- return (key.GetPubKey().GetID() == keyID);
+ return (pubkey.GetID() == keyID);
}
@@ -719,7 +719,7 @@ static CScript _createmultisig(const Array& params)
throw runtime_error(
strprintf("not enough keys supplied "
"(got %"PRIszu" keys, but need at least %d to redeem)", keys.size(), nRequired));
- std::vector<CKey> pubkeys;
+ std::vector<CPubKey> pubkeys;
pubkeys.resize(keys.size());
for (unsigned int i = 0; i < keys.size(); i++)
{
@@ -737,16 +737,18 @@ static CScript _createmultisig(const Array& params)
if (!pwalletMain->GetPubKey(keyID, vchPubKey))
throw runtime_error(
strprintf("no full public key for address %s",ks.c_str()));
- if (!vchPubKey.IsValid() || !pubkeys[i].SetPubKey(vchPubKey))
+ if (!vchPubKey.IsFullyValid())
throw runtime_error(" Invalid public key: "+ks);
+ pubkeys[i] = vchPubKey;
}
// Case 2: hex public key
else if (IsHex(ks))
{
CPubKey vchPubKey(ParseHex(ks));
- if (!vchPubKey.IsValid() || !pubkeys[i].SetPubKey(vchPubKey))
+ if (!vchPubKey.IsFullyValid())
throw runtime_error(" Invalid public key: "+ks);
+ pubkeys[i] = vchPubKey;
}
else
{