core_rpc_server::on_get_alias_reward() and wallet2::get_alias_cost() were fixed to support aliases in post-HF4 env
This commit is contained in:
parent
de52782b21
commit
4ae2cd8a51
2 changed files with 3 additions and 11 deletions
|
|
@ -1208,16 +1208,8 @@ namespace currency
|
|||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
bool core_rpc_server::on_get_alias_reward(const COMMAND_RPC_GET_ALIAS_REWARD::request& req, COMMAND_RPC_GET_ALIAS_REWARD::response& res, epee::json_rpc::error& error_resp, connection_context& cntx)
|
||||
{
|
||||
|
||||
uint64_t default_tx_fee = m_core.get_blockchain_storage().get_core_runtime_config().tx_default_fee;
|
||||
uint64_t current_median_fee = m_core.get_blockchain_storage().get_tx_fee_median();
|
||||
|
||||
res.reward = get_alias_coast_from_fee(req.alias, std::max(default_tx_fee, current_median_fee));
|
||||
|
||||
if (res.reward)
|
||||
res.status = API_RETURN_CODE_OK;
|
||||
else
|
||||
res.status = API_RETURN_CODE_NOT_FOUND;
|
||||
res.reward = m_core.get_blockchain_storage().get_alias_coast(req.alias);
|
||||
res.status = API_RETURN_CODE_OK;
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -4571,7 +4571,7 @@ uint64_t wallet2::get_alias_cost(const std::string& alias)
|
|||
throw std::runtime_error(std::string("Failed to get alias cost"));
|
||||
}
|
||||
|
||||
return rsp.reward + rsp.reward / 10; //add 10% of price to be sure;
|
||||
return rsp.reward;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
void wallet2::request_alias_registration(currency::extra_alias_entry& ai, currency::transaction& res_tx, uint64_t fee, uint64_t reward, const crypto::secret_key& authority_key)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue