mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
Merge pull request #215 from gavinandresen/negativemove
Allow move RPC to take account balances negative
This commit is contained in:
commit
efe06e1efd
15
src/rpc.cpp
15
src/rpc.cpp
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user