#include <node_rpc_proxy.h>
Definition at line 40 of file node_rpc_proxy.h.
◆ NodeRPCProxy()
Definition at line 41 of file node_rpc_proxy.cpp.
42 : m_http_client(http_client)
43 , m_daemon_rpc_mutex(mutex)
◆ get_block_weight_limit()
| boost::optional< std::string > tools::NodeRPCProxy::get_block_weight_limit |
( |
uint64_t & |
block_weight_limit | ) |
const |
Definition at line 132 of file node_rpc_proxy.cpp.
134 auto res = get_info();
137 block_weight_limit = m_block_weight_limit;
138 return boost::optional<std::string>();
◆ get_dynamic_base_fee_estimate()
| boost::optional< std::string > tools::NodeRPCProxy::get_dynamic_base_fee_estimate |
( |
uint64_t |
grace_blocks, |
|
|
uint64_t & |
fee |
|
) |
| const |
Definition at line 164 of file node_rpc_proxy.cpp.
173 return boost::optional<std::string>(
"offline");
174 if (m_dynamic_base_fee_estimate_cached_height !=
height || m_dynamic_base_fee_estimate_grace_blocks != grace_blocks)
179 m_daemon_rpc_mutex.lock();
180 req_t.grace_blocks = grace_blocks;
182 m_daemon_rpc_mutex.unlock();
186 m_dynamic_base_fee_estimate = resp_t.fee;
187 m_dynamic_base_fee_estimate_cached_height =
height;
188 m_dynamic_base_fee_estimate_grace_blocks = grace_blocks;
189 m_fee_quantization_mask = resp_t.quantization_mask;
192 fee = m_dynamic_base_fee_estimate;
193 return boost::optional<std::string>();
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)
#define CORE_RPC_STATUS_BUSY
bool invoke_http_json_rpc(const boost::string_ref uri, std::string method_name, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref http_method="GET", const std::string &req_id="0")
#define CORE_RPC_STATUS_OK
unsigned __int64 uint64_t
◆ get_earliest_height()
| boost::optional< std::string > tools::NodeRPCProxy::get_earliest_height |
( |
uint8_t |
version, |
|
|
uint64_t & |
earliest_height |
|
) |
| const |
Definition at line 141 of file node_rpc_proxy.cpp.
144 return boost::optional<std::string>(
"offline");
145 if (m_earliest_height[
version] == 0)
150 m_daemon_rpc_mutex.lock();
153 m_daemon_rpc_mutex.unlock();
157 m_earliest_height[
version] = resp_t.earliest_height;
160 earliest_height = m_earliest_height[
version];
161 return boost::optional<std::string>();
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)
#define CORE_RPC_STATUS_BUSY
bool invoke_http_json_rpc(const boost::string_ref uri, std::string method_name, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref http_method="GET", const std::string &req_id="0")
#define CORE_RPC_STATUS_OK
version
Supported socks variants.
◆ get_fee_quantization_mask()
| boost::optional< std::string > tools::NodeRPCProxy::get_fee_quantization_mask |
( |
uint64_t & |
fee_quantization_mask | ) |
const |
Definition at line 196 of file node_rpc_proxy.cpp.
205 return boost::optional<std::string>(
"offline");
206 if (m_dynamic_base_fee_estimate_cached_height !=
height)
211 m_daemon_rpc_mutex.lock();
212 req_t.grace_blocks = m_dynamic_base_fee_estimate_grace_blocks;
214 m_daemon_rpc_mutex.unlock();
218 m_dynamic_base_fee_estimate = resp_t.fee;
219 m_dynamic_base_fee_estimate_cached_height =
height;
220 m_fee_quantization_mask = resp_t.quantization_mask;
223 fee_quantization_mask = m_fee_quantization_mask;
224 if (fee_quantization_mask == 0)
226 MERROR(
"Fee quantization mask is 0, forcing to 1");
227 fee_quantization_mask = 1;
229 return boost::optional<std::string>();
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)
#define CORE_RPC_STATUS_BUSY
bool invoke_http_json_rpc(const boost::string_ref uri, std::string method_name, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref http_method="GET", const std::string &req_id="0")
#define CORE_RPC_STATUS_OK
unsigned __int64 uint64_t
◆ get_height()
| boost::optional< std::string > tools::NodeRPCProxy::get_height |
( |
uint64_t & |
height | ) |
const |
Definition at line 114 of file node_rpc_proxy.cpp.
116 auto res = get_info();
120 return boost::optional<std::string>();
◆ get_rpc_version()
| boost::optional< std::string > tools::NodeRPCProxy::get_rpc_version |
( |
uint32_t & |
version | ) |
const |
Definition at line 64 of file node_rpc_proxy.cpp.
67 return boost::optional<std::string>(
"offline");
68 if (m_rpc_version == 0)
72 m_daemon_rpc_mutex.lock();
74 m_daemon_rpc_mutex.unlock();
78 m_rpc_version = resp_t.version;
80 rpc_version = m_rpc_version;
81 return boost::optional<std::string>();
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)
#define CORE_RPC_STATUS_BUSY
bool invoke_http_json_rpc(const boost::string_ref uri, std::string method_name, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref http_method="GET", const std::string &req_id="0")
#define CORE_RPC_STATUS_OK
◆ get_target_height()
| boost::optional< std::string > tools::NodeRPCProxy::get_target_height |
( |
uint64_t & |
height | ) |
const |
Definition at line 123 of file node_rpc_proxy.cpp.
125 auto res = get_info();
129 return boost::optional<std::string>();
◆ invalidate()
| void tools::NodeRPCProxy::invalidate |
( |
| ) |
|
Definition at line 49 of file node_rpc_proxy.cpp.
52 for (
size_t n = 0; n < 256; ++n)
53 m_earliest_height[n] = 0;
54 m_dynamic_base_fee_estimate = 0;
55 m_dynamic_base_fee_estimate_cached_height = 0;
56 m_dynamic_base_fee_estimate_grace_blocks = 0;
57 m_fee_quantization_mask = 1;
60 m_block_weight_limit = 0;
◆ set_height()
| void tools::NodeRPCProxy::set_height |
( |
uint64_t |
h | ) |
|
◆ set_offline()
| void tools::NodeRPCProxy::set_offline |
( |
bool |
offline | ) |
|
|
inline |
The documentation for this class was generated from the following files: