Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wallet: remove obsolete fee logic #9302

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions src/simplewallet/simplewallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,24 +978,20 @@ bool simple_wallet::print_fee_info(const std::vector<std::string> &args/* = std:
{
if (!try_connect_to_daemon())
return true;
const bool per_byte = m_wallet->use_fork_rules(HF_VERSION_PER_BYTE_FEE);
const uint64_t base_fee = m_wallet->get_base_fee();
const char *base = per_byte ? "byte" : "kB";
const uint64_t typical_size = per_byte ? 2500 : 13;
const uint64_t size_granularity = per_byte ? 1 : 1024;
message_writer() << (boost::format(tr("Current fee is %s %s per %s")) % print_money(base_fee) % cryptonote::get_unit(cryptonote::get_default_decimal_point()) % base).str();

std::vector<uint64_t> fees;

uint64_t base_fee = m_wallet->get_base_fee(1);
message_writer() << (boost::format(tr("Current fee is %s %s per byte")) % print_money(base_fee) % cryptonote::get_unit(cryptonote::get_default_decimal_point())).str();

std::vector<std::pair<double, double>> fees;
for (uint32_t priority = 1; priority <= 4; ++priority)
{
uint64_t mult = m_wallet->get_fee_multiplier(priority);
fees.push_back(base_fee * typical_size * mult);
uint64_t fee = m_wallet->get_base_fee(priority);
fees.push_back(std::make_pair<double, double>(fee, fee));
}
std::vector<std::pair<uint64_t, uint64_t>> blocks;
try
{
uint64_t base_size = typical_size * size_granularity;
blocks = m_wallet->estimate_backlog(base_size, base_size + size_granularity - 1, fees);
blocks = m_wallet->estimate_backlog(fees);
}
catch (const std::exception &e)
{
Expand Down
10 changes: 0 additions & 10 deletions src/wallet/node_rpc_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,6 @@ boost::optional<std::string> NodeRPCProxy::get_dynamic_base_fee_estimate_2021_sc
return boost::optional<std::string>();
}

boost::optional<std::string> NodeRPCProxy::get_dynamic_base_fee_estimate(uint64_t grace_blocks, uint64_t &fee)
{
std::vector<uint64_t> fees;
auto res = get_dynamic_base_fee_estimate_2021_scaling(grace_blocks, fees);
if (res)
return res;
fee = fees[0];
return boost::none;
}

boost::optional<std::string> NodeRPCProxy::get_fee_quantization_mask(uint64_t &fee_quantization_mask)
{
uint64_t height;
Expand Down
1 change: 0 additions & 1 deletion src/wallet/node_rpc_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class NodeRPCProxy
boost::optional<std::string> get_block_weight_limit(uint64_t &block_weight_limit);
boost::optional<std::string> get_adjusted_time(uint64_t &adjusted_time);
boost::optional<std::string> get_earliest_height(uint8_t version, uint64_t &earliest_height);
boost::optional<std::string> get_dynamic_base_fee_estimate(uint64_t grace_blocks, uint64_t &fee);
boost::optional<std::string> get_dynamic_base_fee_estimate_2021_scaling(uint64_t grace_blocks, std::vector<uint64_t> &fees);
boost::optional<std::string> get_fee_quantization_mask(uint64_t &fee_quantization_mask);
boost::optional<std::string> get_transactions(const std::vector<crypto::hash> &txids, const std::function<void(const cryptonote::COMMAND_RPC_GET_TRANSACTIONS::request&, const cryptonote::COMMAND_RPC_GET_TRANSACTIONS::response&, bool)> &f);
Expand Down
Loading
Loading