Merge pull request #215 from gavinandresen/negativemove
authorJeff Garzik <jgarzik@exmulti.com>
Thu, 12 May 2011 21:46:13 +0000 (14:46 -0700)
committerJeff Garzik <jgarzik@exmulti.com>
Thu, 12 May 2011 21:46:13 +0000 (14:46 -0700)
Allow move RPC to take account balances negative

src/rpc.cpp

index 8af659e..df5f123 100644 (file)
@@ -718,21 +718,6 @@ Value movecmd(const Array& params, bool fHelp)
         CWalletDB walletdb;
         walletdb.TxnBegin();
 
-        // Check funds
-        if (!strFrom.empty())
-        {
-            int64 nBalance = GetAccountBalance(walletdb, strFrom, nMinDepth);
-            if (nAmount > nBalance)
-                throw JSONRPCError(-6, "Account has insufficient funds");
-        }
-        else
-        {
-            // move from "" account special case
-            int64 nBalance = GetAccountBalance(walletdb, strTo, nMinDepth);
-            if (nAmount > GetBalance() - nBalance)
-                throw JSONRPCError(-6, "Account has insufficient funds");
-        }
-
         int64 nNow = GetAdjustedTime();
 
         // Debit