// Check funds
int64 nBalance = GetAccountBalance(strAccount, nMinDepth);
if (nAmount > nBalance)
throw JSONRPCError(-6, "Account has insufficient funds");
This prevents an account balance from going negative, but it doesn't consider the transaction fee, hence if you send out an entire account balance, you'll get a negative balance if there is a transaction fee.