aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp13
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index d23d5cddb..bbcfa6168 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -48,6 +48,7 @@ using namespace epee;
#include "cryptonote_basic/merge_mining.h"
#include "cryptonote_core/tx_sanity_check.h"
#include "misc_language.h"
+#include "net/local_ip.h"
#include "net/parse.h"
#include "storages/http_abstract_invoke.h"
#include "crypto/hash.h"
@@ -2890,7 +2891,17 @@ namespace cryptonote
return r;
CHECK_PAYMENT(req, res, COST_PER_FEE_ESTIMATE);
- res.fee = m_core.get_blockchain_storage().get_dynamic_base_fee_estimate(req.grace_blocks);
+
+ 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/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index 9206b5e21..1be2610ff 100644
--- a/src/rpc/core_rpc_server_commands_defs.h
+++ b/src/rpc/core_rpc_server_commands_defs.h
@@ -2191,11 +2191,13 @@ namespace cryptonote
{
uint64_t fee;
uint64_t quantization_mask;
+ std::vector<uint64_t> fees;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE_PARENT(rpc_access_response_base)
KV_SERIALIZE(fee)
KV_SERIALIZE_OPT(quantization_mask, (uint64_t)1)
+ KV_SERIALIZE(fees)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<response_t> response;