diff options
author | Pavel Janík <Pavel@Janik.cz> | 2014-12-05 17:22:06 +0100 |
---|---|---|
committer | Pavel Janík <Pavel@Janik.cz> | 2014-12-05 17:22:06 +0100 |
commit | 4be639eaec05ed1170b8cf0ed77b2a6e9bad732c (patch) | |
tree | e27d93425dda2de0af1382923a548fbe4eb0e132 /src | |
parent | b93173dee9b233409daca201dd7ed0c19576e895 (diff) |
Use RPC_INVALID_PARAMETER instead of RPC_WALLET_ERROR for invalid amount.
No return at the end of void function.
Diffstat (limited to 'src')
-rw-r--r-- | src/rpcwallet.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index a03ec7cee1..e43eee1551 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -314,7 +314,7 @@ void SendMoney(const CTxDestination &address, CAmount nValue, CWalletTx& wtxNew) { // Check amount if (nValue <= 0) - throw JSONRPCError(RPC_WALLET_ERROR, "Invalid amount"); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid amount"); if (nValue > pwalletMain->GetBalance()) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient funds"); @@ -342,8 +342,6 @@ void SendMoney(const CTxDestination &address, CAmount nValue, CWalletTx& wtxNew) } if (!pwalletMain->CommitTransaction(wtxNew, reservekey)) throw JSONRPCError(RPC_WALLET_ERROR, "Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."); - - return; } Value sendtoaddress(const Array& params, bool fHelp) |