Add new dynamic fees to ZMQ

This commit is contained in:
Lee Clagett
2025-06-13 17:27:36 -04:00
committed by Lee *!* Clagett
parent df76543369
commit 9002681c1e
3 changed files with 9 additions and 1 deletions
+6 -1
View File
@@ -843,15 +843,20 @@ 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.fees.clear();
res.estimated_base_fee = m_core.get_blockchain_storage().get_dynamic_base_fee_estimate(req.num_grace_blocks);
res.size_scale = 1024; // per KiB fee
res.fee_mask = 1;
}
else
{
m_core.get_blockchain_storage().get_dynamic_base_fee_estimate_2021_scaling(req.num_grace_blocks, res.fees);
res.estimated_base_fee = res.fees.at(0);
res.size_scale = 1; // per byte fee
res.fee_mask = Blockchain::get_fee_quantization_mask();
}