account: fix build error involving std::max and different types

This commit is contained in:
moneromooo-monero 2017-01-13 22:12:27 +00:00
parent 2806842200
commit 176b70a0d4
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

View File

@ -82,7 +82,9 @@ DISABLE_VS_WARNINGS(4244 4345)
if (recover) 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 else
{ {
@ -105,7 +107,9 @@ DISABLE_VS_WARNINGS(4244 4345)
timestamp.tm_min = 0; timestamp.tm_min = 0;
timestamp.tm_sec = 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) void account_base::create_from_viewkey(const cryptonote::account_public_address& address, const crypto::secret_key& viewkey)