mirror of
https://github.com/monero-project/monero.git
synced 2025-08-16 21:20:25 -04:00
wallet2: adapt to deterministic unlock time
This commit is contained in:
parent
4971219c2c
commit
80e535c95a
10 changed files with 57 additions and 23 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue