forked from lthn/blockchain
wallet rpc: check for fee correctness on "transfer" call prior to tx creation
This commit is contained in:
parent
61d95846ae
commit
50abfc82aa
1 changed files with 7 additions and 0 deletions
|
|
@ -239,6 +239,13 @@ namespace tools
|
|||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool wallet_rpc_server::on_transfer(const wallet_public::COMMAND_RPC_TRANSFER::request& req, wallet_public::COMMAND_RPC_TRANSFER::response& res, epee::json_rpc::error& er, connection_context& cntx)
|
||||
{
|
||||
if (req.fee < m_wallet.get_core_runtime_config().tx_pool_min_fee)
|
||||
{
|
||||
er.code = WALLET_RPC_ERROR_CODE_WRONG_ARGUMENT;
|
||||
er.message = std::string("Given fee is too low: ") + epee::string_tools::num_to_string_fast(req.fee) + ", minimum is: " + epee::string_tools::num_to_string_fast(m_wallet.get_core_runtime_config().tx_pool_min_fee);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string payment_id;
|
||||
if (!epee::string_tools::parse_hexstr_to_binbuff(req.payment_id, payment_id))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue