diff options
Diffstat (limited to 'src/rpcwallet.cpp')
-rw-r--r-- | src/rpcwallet.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index f304f70269..fbad1944de 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 { @@ -811,6 +813,7 @@ struct tallyitem { int64 nAmount; int nConf; + vector<uint256> txids; tallyitem() { nAmount = 0; @@ -852,6 +855,7 @@ Value ListReceived(const Array& params, bool fByAccounts) tallyitem& item = mapTally[address]; item.nAmount += txout.nValue; item.nConf = min(item.nConf, nDepth); + item.txids.push_back(wtx.GetHash()); } } @@ -887,6 +891,15 @@ Value ListReceived(const Array& params, bool fByAccounts) obj.push_back(Pair("account", strAccount)); obj.push_back(Pair("amount", ValueFromAmount(nAmount))); obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf))); + Array transactions; + if (it != mapTally.end()) + { + BOOST_FOREACH(const uint256& item, (*it).second.txids) + { + transactions.push_back(item.GetHex()); + } + } + obj.push_back(Pair("txids", transactions)); ret.push_back(obj); } } @@ -919,7 +932,8 @@ Value listreceivedbyaddress(const Array& params, bool fHelp) " \"address\" : receiving address\n" " \"account\" : the account of the receiving address\n" " \"amount\" : total amount received by the address\n" - " \"confirmations\" : number of confirmations of the most recent transaction included"); + " \"confirmations\" : number of confirmations of the most recent transaction included\n" + " \"txids\" : list of transactions with outputs to the address\n"); return ListReceived(params, false); } @@ -1400,7 +1414,7 @@ public: CPubKey vchPubKey; pwalletMain->GetPubKey(keyID, vchPubKey); obj.push_back(Pair("isscript", false)); - obj.push_back(Pair("pubkey", HexStr(vchPubKey.Raw()))); + obj.push_back(Pair("pubkey", HexStr(vchPubKey))); obj.push_back(Pair("iscompressed", vchPubKey.IsCompressed())); return obj; } |