diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-23 23:46:35 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-24 12:12:40 +0000 |
commit | 9996d5e96c71cfcf1d693dd6ca533c6a4176bd10 (patch) | |
tree | 3c7b95d30462bcba9687d797fb832cd14e5eed12 | |
parent | wallet_rpc_server: fix wallet leak on error exit (diff) | |
download | monero-9996d5e96c71cfcf1d693dd6ca533c6a4176bd10.tar.xz |
wallet2: guard against the dameon sending blocks before last checkpoint
-rw-r--r-- | src/wallet/wallet2.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 04c6ee236..9a0db9044 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1951,6 +1951,11 @@ void wallet2::fast_refresh(uint64_t stop_height, uint64_t &blocks_start_height, pull_hashes(0, blocks_start_height, short_chain_history, hashes); if (hashes.size() <= 3) return; + if (blocks_start_height < m_blockchain.offset()) + { + MERROR("Blocks start before blockchain offset: " << blocks_start_height << " " << m_blockchain.offset()); + return; + } if (hashes.size() + current_index < stop_height) { drop_from_short_history(short_chain_history, 3); std::list<crypto::hash>::iterator right = hashes.end(); |