aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-10-14 18:11:13 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-10-14 18:11:13 -0500
commit37a72fd6ae5debbda2c2964ac5960d25e1bd01f3 (patch)
treee743484bb864a610f9c9b9ae54e669bb5f14e2e2 /src
parentMerge pull request #5940 (diff)
parentblockchain: tweak fee as a function of median values (diff)
downloadmonero-37a72fd6ae5debbda2c2964ac5960d25e1bd01f3.tar.xz
Merge pull request #5941
d37d30f blockchain: tweak fee as a function of median values (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/blockchain.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 86bcfcc5d..e3450491b 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -3432,7 +3432,8 @@ uint64_t Blockchain::get_dynamic_base_fee_estimate(uint64_t grace_blocks) const
}
const bool use_long_term_median_in_fee = version >= HF_VERSION_LONG_TERM_BLOCK_WEIGHT;
- uint64_t fee = get_dynamic_base_fee(base_reward, use_long_term_median_in_fee ? m_long_term_effective_median_block_weight : median, version);
+ const uint64_t use_median_value = use_long_term_median_in_fee ? std::min<uint64_t>(median, m_long_term_effective_median_block_weight) : median;
+ const uint64_t fee = get_dynamic_base_fee(base_reward, use_median_value, version);
const bool per_byte = version < HF_VERSION_PER_BYTE_FEE;
MDEBUG("Estimating " << grace_blocks << "-block fee at " << print_money(fee) << "/" << (per_byte ? "byte" : "kB"));
return fee;