From 3cb65b3f69f1d1f58dccb4165e38135c512aef8d Mon Sep 17 00:00:00 2001 From: Michał Sałaban Date: Sun, 28 Jan 2018 12:27:19 +0100 Subject: Return appropriate error code when not enough money for tx --- src/wallet/wallet_rpc_server.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/wallet/wallet_rpc_server.cpp') diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 97faf0b56..f995465d2 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -2412,6 +2412,11 @@ namespace tools er.code = WALLET_RPC_ERROR_CODE_NOT_ENOUGH_MONEY; er.message = e.what(); } + catch (const tools::error::not_enough_unlocked_money& e) + { + er.code = WALLET_RPC_ERROR_CODE_NOT_ENOUGH_UNLOCKED_MONEY; + er.message = e.what(); + } catch (const tools::error::tx_not_possible& e) { er.code = WALLET_RPC_ERROR_CODE_TX_NOT_POSSIBLE; -- cgit v1.2.3