diff options
author | TheCharlatan <seb.kung@gmail.com> | 2020-08-02 15:54:29 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-09-15 11:40:31 +0000 |
commit | 80e535c95a3e7b0c548ad996a777d6d026e93f6a (patch) | |
tree | 82fccb41e3d253e61cd0f76d87768df669c434d0 /src/wallet/node_rpc_proxy.cpp | |
parent | blockchain: deterministic UNIX time unlock checks (diff) | |
download | monero-80e535c95a3e7b0c548ad996a777d6d026e93f6a.tar.xz |
wallet2: adapt to deterministic unlock time
Diffstat (limited to 'src/wallet/node_rpc_proxy.cpp')
-rw-r--r-- | src/wallet/node_rpc_proxy.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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<std::string> 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<std::string> NodeRPCProxy::get_block_weight_limit(uint64_t &bloc return boost::optional<std::string>(); } +boost::optional<std::string> NodeRPCProxy::get_adjusted_time(uint64_t &adjusted_time) +{ + auto res = get_info(); + if (res) + return res; + adjusted_time = m_adjusted_time; + return boost::optional<std::string>(); +} + boost::optional<std::string> NodeRPCProxy::get_earliest_height(uint8_t version, uint64_t &earliest_height) { if (m_offline) |