- rework the function to not log errors but use throw JSONRPCError
- remove a check for IsLocked() that is done in sendtoaddress and
sendfrom RPC calls already
- cache GetBalance() return value, because it's possibly used twice
strError=strprintf("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!",FormatMoney(nFeeRequired));
throwJSONRPCError(RPC_WALLET_ERROR,strprintf("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!",FormatMoney(nFeeRequired)));
throwJSONRPCError(RPC_WALLET_ERROR,"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.");
throwJSONRPCError(RPC_WALLET_ERROR,"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.");