From 80e535c95a3e7b0c548ad996a777d6d026e93f6a Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Sun, 2 Aug 2020 15:54:29 +0000 Subject: wallet2: adapt to deterministic unlock time --- src/wallet/node_rpc_proxy.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/wallet/node_rpc_proxy.cpp') diff --git a/src/wallet/node_rpc_proxy.cpp b/src/wallet/node_rpc_proxy.cpp index 95b8ce8bb..48a602bf3 100644 --- a/src/wallet/node_rpc_proxy.cpp +++ b/src/wallet/node_rpc_proxy.cpp @@ -72,6 +72,7 @@ void NodeRPCProxy::invalidate() m_rpc_version = 0; m_target_height = 0; m_block_weight_limit = 0; + m_adjusted_time = 0; m_get_info_time = 0; m_rpc_payment_info_time = 0; m_rpc_payment_seed_height = 0; @@ -131,6 +132,7 @@ boost::optional NodeRPCProxy::get_info() m_height = resp_t.height; m_target_height = resp_t.target_height; m_block_weight_limit = resp_t.block_weight_limit ? resp_t.block_weight_limit : resp_t.block_size_limit; + m_adjusted_time = resp_t.adjusted_time; m_get_info_time = now; m_height_time = now; } @@ -171,6 +173,15 @@ boost::optional NodeRPCProxy::get_block_weight_limit(uint64_t &bloc return boost::optional(); } +boost::optional NodeRPCProxy::get_adjusted_time(uint64_t &adjusted_time) +{ + auto res = get_info(); + if (res) + return res; + adjusted_time = m_adjusted_time; + return boost::optional(); +} + boost::optional NodeRPCProxy::get_earliest_height(uint8_t version, uint64_t &earliest_height) { if (m_offline) -- cgit v1.2.3