File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -843,15 +843,20 @@ namespace rpc
843
843
void DaemonHandler::handle (const GetFeeEstimate::Request& req, GetFeeEstimate::Response& res)
844
844
{
845
845
res.hard_fork_version = m_core.get_blockchain_storage ().get_current_hard_fork_version ();
846
- res. estimated_base_fee = m_core. get_blockchain_storage (). get_dynamic_base_fee_estimate (req. num_grace_blocks );
846
+
847
847
848
848
if (res.hard_fork_version < HF_VERSION_PER_BYTE_FEE)
849
849
{
850
+ res.fees .clear ();
851
+ res.estimated_base_fee = m_core.get_blockchain_storage ().get_dynamic_base_fee_estimate (req.num_grace_blocks );
850
852
res.size_scale = 1024 ; // per KiB fee
851
853
res.fee_mask = 1 ;
852
854
}
853
855
else
854
856
{
857
+ m_core.get_blockchain_storage ().get_dynamic_base_fee_estimate_2021_scaling (req.num_grace_blocks , res.fees );
858
+ res.estimated_base_fee = res.fees .at (0 );
859
+
855
860
res.size_scale = 1 ; // per byte fee
856
861
res.fee_mask = Blockchain::get_fee_quantization_mask ();
857
862
}
Original file line number Diff line number Diff line change @@ -753,6 +753,7 @@ void GetFeeEstimate::Request::fromJson(const rapidjson::Value& val)
753
753
754
754
void GetFeeEstimate::Response::doToJson (rapidjson::Writer<epee::byte_stream>& dest) const
755
755
{
756
+ INSERT_INTO_JSON_OBJECT (dest, fees, fees);
756
757
INSERT_INTO_JSON_OBJECT (dest, estimated_base_fee, estimated_base_fee);
757
758
INSERT_INTO_JSON_OBJECT (dest, fee_mask, fee_mask);
758
759
INSERT_INTO_JSON_OBJECT (dest, size_scale, size_scale);
@@ -766,6 +767,7 @@ void GetFeeEstimate::Response::fromJson(const rapidjson::Value& val)
766
767
throw json::WRONG_TYPE (" json object" );
767
768
}
768
769
770
+ GET_FROM_JSON_OBJECT (val, fees, fees);
769
771
GET_FROM_JSON_OBJECT (val, estimated_base_fee, estimated_base_fee);
770
772
GET_FROM_JSON_OBJECT (val, fee_mask, fee_mask);
771
773
GET_FROM_JSON_OBJECT (val, size_scale, size_scale);
Original file line number Diff line number Diff line change @@ -423,6 +423,7 @@ BEGIN_RPC_MESSAGE_CLASS(GetFeeEstimate);
423
423
RPC_MESSAGE_MEMBER (uint64_t , num_grace_blocks);
424
424
END_RPC_MESSAGE_REQUEST;
425
425
BEGIN_RPC_MESSAGE_RESPONSE;
426
+ RPC_MESSAGE_MEMBER (std::vector<uint64_t >, fees);
426
427
RPC_MESSAGE_MEMBER (uint64_t , estimated_base_fee);
427
428
RPC_MESSAGE_MEMBER (uint64_t , fee_mask);
428
429
RPC_MESSAGE_MEMBER (uint32_t , size_scale);
You can’t perform that action at this time.
0 commit comments