From 71945067925d3bb15c039f5ed682ea40ab6b16a3 Mon Sep 17 00:00:00 2001 From: jeffro256 Date: Sun, 10 Mar 2024 12:11:39 -0500 Subject: Blockchain: remove old fee calc logic --- src/rpc/core_rpc_server.cpp | 6 ------ src/rpc/daemon_handler.cpp | 11 ++++------- 2 files changed, 4 insertions(+), 13 deletions(-) (limited to 'src/rpc') diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 9a0b02f70..f8407689c 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -3019,16 +3019,10 @@ namespace cryptonote CHECK_PAYMENT(req, res, COST_PER_FEE_ESTIMATE); - const uint8_t version = m_core.get_blockchain_storage().get_current_hard_fork_version(); - if (version >= HF_VERSION_2021_SCALING) { m_core.get_blockchain_storage().get_dynamic_base_fee_estimate_2021_scaling(req.grace_blocks, res.fees); res.fee = res.fees[0]; } - else - { - res.fee = m_core.get_blockchain_storage().get_dynamic_base_fee_estimate(req.grace_blocks); - } res.quantization_mask = Blockchain::get_fee_quantization_mask(); res.status = CORE_RPC_STATUS_OK; return true; diff --git a/src/rpc/daemon_handler.cpp b/src/rpc/daemon_handler.cpp index 52067bd4d..48bd7ea86 100644 --- a/src/rpc/daemon_handler.cpp +++ b/src/rpc/daemon_handler.cpp @@ -831,14 +831,11 @@ namespace rpc void DaemonHandler::handle(const GetFeeEstimate::Request& req, GetFeeEstimate::Response& res) { res.hard_fork_version = m_core.get_blockchain_storage().get_current_hard_fork_version(); - res.estimated_base_fee = m_core.get_blockchain_storage().get_dynamic_base_fee_estimate(req.num_grace_blocks); - if (res.hard_fork_version < HF_VERSION_PER_BYTE_FEE) - { - res.size_scale = 1024; // per KiB fee - res.fee_mask = 1; - } - else + std::vector fees; + m_core.get_blockchain_storage().get_dynamic_base_fee_estimate_2021_scaling(req.num_grace_blocks, fees); + res.estimated_base_fee = fees[0]; + { res.size_scale = 1; // per byte fee res.fee_mask = Blockchain::get_fee_quantization_mask(); -- cgit v1.2.3