Add new dynamic fees to ZMQ

This commit is contained in:
Lee Clagett 2025-06-13 17:10:17 -04:00
parent 125622d5bd
commit 2bce551da7
3 changed files with 5 additions and 3 deletions

View File

@ -844,9 +844,8 @@ namespace rpc
{
res.hard_fork_version = m_core.get_blockchain_storage().get_current_hard_fork_version();
std::vector<uint64_t> fees;
m_core.get_blockchain_storage().get_dynamic_base_fee_estimate_2021_scaling(req.num_grace_blocks, fees);
res.estimated_base_fee = fees[0];
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

View File

@ -753,6 +753,7 @@ void GetFeeEstimate::Request::fromJson(const rapidjson::Value& val)
void GetFeeEstimate::Response::doToJson(rapidjson::Writer<epee::byte_stream>& dest) const
{
INSERT_INTO_JSON_OBJECT(dest, fees, fees);
INSERT_INTO_JSON_OBJECT(dest, estimated_base_fee, estimated_base_fee);
INSERT_INTO_JSON_OBJECT(dest, fee_mask, fee_mask);
INSERT_INTO_JSON_OBJECT(dest, size_scale, size_scale);
@ -766,6 +767,7 @@ void GetFeeEstimate::Response::fromJson(const rapidjson::Value& val)
throw json::WRONG_TYPE("json object");
}
GET_FROM_JSON_OBJECT(val, fees, fees);
GET_FROM_JSON_OBJECT(val, estimated_base_fee, estimated_base_fee);
GET_FROM_JSON_OBJECT(val, fee_mask, fee_mask);
GET_FROM_JSON_OBJECT(val, size_scale, size_scale);

View File

@ -425,6 +425,7 @@ BEGIN_RPC_MESSAGE_CLASS(GetFeeEstimate);
RPC_MESSAGE_MEMBER(uint64_t, num_grace_blocks);
END_RPC_MESSAGE_REQUEST;
BEGIN_RPC_MESSAGE_RESPONSE;
RPC_MESSAGE_MEMBER(std::vector<uint64_t>, fees);
RPC_MESSAGE_MEMBER(uint64_t, estimated_base_fee);
RPC_MESSAGE_MEMBER(uint64_t, fee_mask);
RPC_MESSAGE_MEMBER(uint32_t, size_scale);