X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Frpcwallet.cpp;h=ca64fff8c543926967a1472cba586262e981bc5c;hp=8b3780ecbc29f79ece87bb1b2d1657a65d9c7e34;hb=a494e1c51c7f54ba353b02a7e470b0df0c0e7bbe;hpb=c6f2a669824f53979c53769a1b6b3d48d31ceac7 diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 8b3780e..ca64fff 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -343,7 +343,11 @@ Value sendtoaddress(const Array& params, bool fHelp) if (pwalletMain->IsLocked()) throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first."); - string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx); + // Parse Bitcoin address + CScript scriptPubKey; + scriptPubKey.SetDestination(address.Get()); + + string strError = pwalletMain->SendMoney(scriptPubKey, nAmount, wtx); if (strError != "") throw JSONRPCError(RPC_WALLET_ERROR, strError); @@ -721,8 +725,12 @@ Value sendfrom(const Array& params, bool fHelp) if (nAmount > nBalance) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds"); + // Parse Bitcoin address + CScript scriptPubKey; + scriptPubKey.SetDestination(address.Get()); + // Send - string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx); + string strError = pwalletMain->SendMoney(scriptPubKey, nAmount, wtx); if (strError != "") throw JSONRPCError(RPC_WALLET_ERROR, strError);