aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-01-14 09:26:59 -0500
committerRiccardo Spagni <ric@spagni.net>2017-01-14 09:26:59 -0500
commitd98db4868ddd7727866b053eeeb8fe154363896c (patch)
tree75918c0e7ca8dd602ab522851cf9f3752419ad92 /src
parentMerge pull request #1562 (diff)
parentaccount: fix build error involving std::max and different types (diff)
downloadmonero-d98db4868ddd7727866b053eeeb8fe154363896c.tar.xz
Merge pull request #1566
176b70a0 account: fix build error involving std::max and different types (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/account.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cryptonote_core/account.cpp b/src/cryptonote_core/account.cpp
index 602561489..bd703eee2 100644
--- a/src/cryptonote_core/account.cpp
+++ b/src/cryptonote_core/account.cpp
@@ -82,7 +82,9 @@ DISABLE_VS_WARNINGS(4244 4345)
if (recover)
{
- m_creation_timestamp = std::max(mktime(&timestamp), (long)0);
+ m_creation_timestamp = mktime(&timestamp);
+ if (m_creation_timestamp == (uint64_t)-1) // failure
+ m_creation_timestamp = 0; // lowest value
}
else
{
@@ -105,7 +107,9 @@ DISABLE_VS_WARNINGS(4244 4345)
timestamp.tm_min = 0;
timestamp.tm_sec = 0;
- m_creation_timestamp = std::max(mktime(&timestamp), (long)0);
+ m_creation_timestamp = mktime(&timestamp);
+ if (m_creation_timestamp == (uint64_t)-1) // failure
+ m_creation_timestamp = 0; // lowest value
}
//-----------------------------------------------------------------
void account_base::create_from_viewkey(const cryptonote::account_public_address& address, const crypto::secret_key& viewkey)