From 832fb114a7dfdc52fce4318cedb3eb0d78366d46 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 6 May 2011 13:07:36 -0400 Subject: [PATCH] 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. --- src/rpc.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/rpc.cpp b/src/rpc.cpp index 3aec7efb..379dea29 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -702,21 +702,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