diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index a0816946b..368491eae 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -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) { + 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 dsts; for (auto it = req.destinations.begin(); it != req.destinations.end(); it++) { diff --git a/src/wallet/wallet_rpc_server_error_codes.h b/src/wallet/wallet_rpc_server_error_codes.h index a37bde795..469351f8d 100644 --- a/src/wallet/wallet_rpc_server_error_codes.h +++ b/src/wallet/wallet_rpc_server_error_codes.h @@ -11,3 +11,4 @@ #define WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR -4 #define WALLET_RPC_ERROR_CODE_WRONG_PAYMENT_ID -5 #define WALLET_RPC_ERROR_CODE_TRANSFER_TYPE -6 +#define WALLET_RPC_ERROR_CODE_WRONG_FEE -7