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/simplewallet/simplewallet.cpp | |
parent | blockchain: deterministic UNIX time unlock checks (diff) | |
download | monero-80e535c95a3e7b0c548ad996a777d6d026e93f6a.tar.xz |
wallet2: adapt to deterministic unlock time
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index f37d77933..5fb4131fa 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -8553,8 +8553,8 @@ bool simple_wallet::get_transfers(std::vector<std::string>& local_args, std::vec } else { - uint64_t current_time = static_cast<uint64_t>(time(NULL)); - uint64_t threshold = current_time + (m_wallet->use_fork_rules(2, 0) ? CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V2 : CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V1); + const uint64_t adjusted_time = m_wallet->get_daemon_adjusted_time(); + uint64_t threshold = adjusted_time + (m_wallet->use_fork_rules(2, 0) ? CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V2 : CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V1); if (threshold < pd.m_unlock_time) locked_msg = get_human_readable_timespan(std::chrono::seconds(pd.m_unlock_time - threshold)); } @@ -10265,8 +10265,8 @@ bool simple_wallet::show_transfer(const std::vector<std::string> &args) } else { - uint64_t current_time = static_cast<uint64_t>(time(NULL)); - uint64_t threshold = current_time + (m_wallet->use_fork_rules(2, 0) ? CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V2 : CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V1); + const uint64_t adjusted_time = m_wallet->get_daemon_adjusted_time(); + uint64_t threshold = adjusted_time + (m_wallet->use_fork_rules(2, 0) ? CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V2 : CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V1); if (threshold >= pd.m_unlock_time) success_msg_writer() << "unlocked for " << get_human_readable_timespan(std::chrono::seconds(threshold - pd.m_unlock_time)); else |