aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-09-15 19:55:03 -0500
committerluigi1111 <luigi1111w@gmail.com>2020-09-15 19:55:03 -0500
commitea587de300088635267007f7c775b30293fc6ea2 (patch)
tree82fccb41e3d253e61cd0f76d87768df669c434d0 /src/simplewallet
parent9bba1a24eadbc7d23a5a58d83024df224f9cafcb (diff)
parent80e535c95a3e7b0c548ad996a777d6d026e93f6a (diff)
downloadmonzero-core-ea587de300088635267007f7c775b30293fc6ea2.tar.gz
monzero-core-ea587de300088635267007f7c775b30293fc6ea2.tar.xz
monzero-core-ea587de300088635267007f7c775b30293fc6ea2.zip
Merge pull request #6745
80e535c wallet2: adapt to deterministic unlock time (TheCharlatan) 4971219 blockchain: deterministic UNIX time unlock checks (moneromooo-monero)
Diffstat (limited to 'src/simplewallet')
-rw-r--r--src/simplewallet/simplewallet.cpp8
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