Added minimum fee error message in 'transfer' RPC call

This commit is contained in:
Neozaru 2014-06-15 16:00:43 +02:00
parent 38a8e5c5f1
commit 5f31331c6e
2 changed files with 7 additions and 0 deletions

View File

@ -89,6 +89,12 @@ namespace tools
bool wallet_rpc_server::on_transfer(const wallet_rpc::COMMAND_RPC_TRANSFER::request& req, wallet_rpc::COMMAND_RPC_TRANSFER::response& res, epee::json_rpc::error& er, connection_context& cntx) bool wallet_rpc_server::on_transfer(const wallet_rpc::COMMAND_RPC_TRANSFER::request& req, wallet_rpc::COMMAND_RPC_TRANSFER::response& res, epee::json_rpc::error& er, connection_context& cntx)
{ {
if ( req.fee < DEFAULT_FEE ) {
er.code = WALLET_RPC_ERROR_CODE_WRONG_FEE;
er.message = "Fee is not valid. Minimum fee : " + std::to_string(DEFAULT_FEE) + " (Moneroshi)";
return false;
}
std::vector<cryptonote::tx_destination_entry> dsts; std::vector<cryptonote::tx_destination_entry> dsts;
for (auto it = req.destinations.begin(); it != req.destinations.end(); it++) for (auto it = req.destinations.begin(); it != req.destinations.end(); it++)
{ {

View File

@ -11,3 +11,4 @@
#define WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR -4 #define WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR -4
#define WALLET_RPC_ERROR_CODE_WRONG_PAYMENT_ID -5 #define WALLET_RPC_ERROR_CODE_WRONG_PAYMENT_ID -5
#define WALLET_RPC_ERROR_CODE_TRANSFER_TYPE -6 #define WALLET_RPC_ERROR_CODE_TRANSFER_TYPE -6
#define WALLET_RPC_ERROR_CODE_WRONG_FEE -7