changeset 580:a1db9789c0bd draft

Allow move RPC to take account balances negative Use case: Customer owes you bitcoins, so you create a payment address associated with an account with a negative balance (the amount they owe). When customer pays, that account balance will go to zero.
author Gavin Andresen <gavinandresen@gmail.com>
date Fri, 06 May 2011 13:07:36 -0400
parents 047e6546dcce
children d0dcb95f5d36
files src/rpc.cpp
diffstat 1 files changed, 0 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/rpc.cpp
+++ b/src/rpc.cpp
@@ -702,21 +702,6 @@
         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