diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-03 00:51:53 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-03 00:51:53 +0100 |
commit | 452d4fae396589850e4dcf66dbf1209ea96f0ef1 (patch) | |
tree | cc7b5cbcfa053a06fe5db928b5359b5dd1d76784 /src/wallet/wallet2.h | |
parent | Merge pull request #2518 (diff) | |
download | monero-452d4fae396589850e4dcf66dbf1209ea96f0ef1.tar.xz |
tests: fix hashchain unit tests
and relax the not-empty safety check to stay more intuitiuve
Diffstat (limited to 'src/wallet/wallet2.h')
-rw-r--r-- | src/wallet/wallet2.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 1dff14a95..296f96a25 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -108,7 +108,7 @@ namespace tools void crop(size_t height) { m_blockchain.resize(height - m_offset); } void clear() { m_offset = 0; m_blockchain.clear(); } bool empty() const { return m_blockchain.empty() && m_offset == 0; } - void trim(size_t height) { while (height > m_offset+1 && m_blockchain.size() > 1) { m_blockchain.pop_front(); ++m_offset; } m_blockchain.shrink_to_fit(); } + void trim(size_t height) { while (height > m_offset && m_blockchain.size() > 1) { m_blockchain.pop_front(); ++m_offset; } m_blockchain.shrink_to_fit(); } void refill(const crypto::hash &hash) { m_blockchain.push_back(hash); --m_offset; } template <class t_archive> |