aboutsummaryrefslogtreecommitdiff
path: root/src/rpcwallet.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-09-17 12:08:53 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-09-17 13:04:54 +0200
commit69dd8c919aa3a1b88af34265f828fe0a58a55014 (patch)
tree672551d1afcb67ad45a24450ac753cfbd31d2e1e /src/rpcwallet.cpp
parent651a1fcf813983e8e5f6f180e062a5111e900dad (diff)
parent0be990ba34110184c8a5a2c04094311dab5cd84c (diff)
downloadbitcoin-69dd8c919aa3a1b88af34265f828fe0a58a55014.tar.xz
Merge pull request #4899
0be990b Move CTxDestination from script/script to script/standard (Pieter Wuille)
Diffstat (limited to 'src/rpcwallet.cpp')
-rw-r--r--src/rpcwallet.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index 997b861e59..d9a23b2347 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -124,8 +124,7 @@ CBitcoinAddress GetAccountAddress(string strAccount, bool bForceNew=false)
// Check if the current key has been used
if (account.vchPubKey.IsValid())
{
- CScript scriptPubKey;
- scriptPubKey.SetDestination(account.vchPubKey.GetID());
+ CScript scriptPubKey = GetScriptForDestination(account.vchPubKey.GetID());
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin();
it != pwalletMain->mapWallet.end() && account.vchPubKey.IsValid();
++it)
@@ -472,10 +471,9 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
// Bitcoin address
CBitcoinAddress address = CBitcoinAddress(params[0].get_str());
- CScript scriptPubKey;
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
- scriptPubKey.SetDestination(address.Get());
+ CScript scriptPubKey = GetScriptForDestination(address.Get());
if (!IsMine(*pwalletMain,scriptPubKey))
return (double)0.0;
@@ -849,8 +847,7 @@ Value sendmany(const Array& params, bool fHelp)
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);
setAddress.insert(address);
- CScript scriptPubKey;
- scriptPubKey.SetDestination(address.Get());
+ CScript scriptPubKey = GetScriptForDestination(address.Get());
int64_t nAmount = AmountFromValue(s.value_);
totalAmount += nAmount;