diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2022-04-18 02:12:55 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2022-04-18 02:12:55 -0500 |
| commit | 2b999f5398426d2c4452e001cfebad34abb686ff (patch) | |
| tree | 08bbe9298a72bd99ca3e35d3df667d81ef07711e /src/wallet/node_rpc_proxy.cpp | |
| parent | f49fc9b4876382d5c6f08fd7a6125b554c49e260 (diff) | |
| parent | b030f207517f59a5122409398549a02ac23829ae (diff) | |
| download | monzero-core-2b999f5398426d2c4452e001cfebad34abb686ff.tar.gz monzero-core-2b999f5398426d2c4452e001cfebad34abb686ff.tar.xz monzero-core-2b999f5398426d2c4452e001cfebad34abb686ff.zip | |
Merge pull request #7819
b030f20 Fee changes from ArticMine (moneromooo-monero)
9f786f0 epee: allow copying a rolling_median_t object (moneromooo-monero)
Diffstat (limited to 'src/wallet/node_rpc_proxy.cpp')
| -rw-r--r-- | src/wallet/node_rpc_proxy.cpp | 16 |
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; |
