aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/node_rpc_proxy.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2021-07-29 12:02:08 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2022-04-10 18:13:34 +0000
commitb030f207517f59a5122409398549a02ac23829ae (patch)
tree08bbe9298a72bd99ca3e35d3df667d81ef07711e /src/wallet/node_rpc_proxy.cpp
parentepee: allow copying a rolling_median_t object (diff)
downloadmonero-b030f207517f59a5122409398549a02ac23829ae.tar.xz
Fee changes from ArticMine
https://github.com/ArticMine/Monero-Documents/blob/master/MoneroScaling2021-02.pdf with a change to use 1.7 instead of 2.0 for the max long term increase rate
Diffstat (limited to '')
-rw-r--r--src/wallet/node_rpc_proxy.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/wallet/node_rpc_proxy.cpp b/src/wallet/node_rpc_proxy.cpp
index 7635c5646..7810abdd2 100644
--- a/src/wallet/node_rpc_proxy.cpp
+++ b/src/wallet/node_rpc_proxy.cpp
@@ -70,6 +70,7 @@ void NodeRPCProxy::invalidate()
m_dynamic_base_fee_estimate = 0;
m_dynamic_base_fee_estimate_cached_height = 0;
m_dynamic_base_fee_estimate_grace_blocks = 0;
+ m_dynamic_base_fee_estimate_vector.clear();
m_fee_quantization_mask = 1;
m_rpc_version = 0;
m_target_height = 0;
@@ -210,7 +211,7 @@ boost::optional<std::string> NodeRPCProxy::get_earliest_height(uint8_t version,
return boost::optional<std::string>();
}
-boost::optional<std::string> NodeRPCProxy::get_dynamic_base_fee_estimate(uint64_t grace_blocks, uint64_t &fee)
+boost::optional<std::string> NodeRPCProxy::get_dynamic_base_fee_estimate_2021_scaling(uint64_t grace_blocks, std::vector<uint64_t> &fees)
{
uint64_t height;
@@ -238,13 +239,24 @@ boost::optional<std::string> NodeRPCProxy::get_dynamic_base_fee_estimate(uint64_
m_dynamic_base_fee_estimate = resp_t.fee;
m_dynamic_base_fee_estimate_cached_height = height;
m_dynamic_base_fee_estimate_grace_blocks = grace_blocks;
+ m_dynamic_base_fee_estimate_vector = !resp_t.fees.empty() ? std::move(resp_t.fees) : std::vector<uint64_t>{m_dynamic_base_fee_estimate};
m_fee_quantization_mask = resp_t.quantization_mask;
}
- fee = m_dynamic_base_fee_estimate;
+ fees = m_dynamic_base_fee_estimate_vector;
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;