aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-01-10 11:54:11 +0100
committerRiccardo Spagni <ric@spagni.net>2018-01-10 11:54:11 +0100
commit990389f09d53ac9319f6070a9374703d9d5c2e14 (patch)
treed573d99228129d36e93dd95206828d1183bffb40 /src/wallet/wallet2.cpp
parentMerge pull request #2997 (diff)
parentwallet2: guard against the dameon sending blocks before last checkpoint (diff)
downloadmonero-990389f09d53ac9319f6070a9374703d9d5c2e14.tar.xz
Merge pull request #3002
9996d5e9 wallet2: guard against the dameon sending blocks before last checkpoint (moneromooo-monero) eadaa6aa wallet_rpc_server: fix wallet leak on error exit (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 20e8ba53d..3aad6a0f3 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -2036,6 +2036,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();