blockchain: fix an off by one error in unlocked time check

This commit is contained in:
moneromooo-monero 2015-12-25 22:12:52 +00:00
parent f294be35bc
commit a9ff11c816
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

View File

@ -2231,7 +2231,7 @@ bool Blockchain::is_tx_spendtime_unlocked(uint64_t unlock_time) const
{
// ND: Instead of calling get_current_blockchain_height(), call m_db->height()
// directly as get_current_blockchain_height() locks the recursive mutex.
if(m_db->height() + CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS >= unlock_time)
if(m_db->height()-1 + CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS >= unlock_time)
return true;
else
return false;