aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-11-16 11:10:20 +0200
committerRiccardo Spagni <ric@spagni.net>2018-11-16 11:10:20 +0200
commitf9c60736b8cac428378ea74f6ba04137847c8abe (patch)
tree7ad5e6078ef0781df73e92bcc3f7a70269883653 /src
parentMerge pull request #4792 (diff)
parentFix: out_of_hashchain_bounds_error in refresh (diff)
downloadmonero-f9c60736b8cac428378ea74f6ba04137847c8abe.tar.xz
Merge pull request #4794
e198b06e Fix: out_of_hashchain_bounds_error in refresh (Hasan Pekdemir)
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet2.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 1e189fbb3..129b96733 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -2731,7 +2731,7 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo
short_chain_history.clear();
get_short_chain_history(short_chain_history);
fast_refresh(stop_height, blocks_start_height, short_chain_history, true);
- THROW_WALLET_EXCEPTION_IF(m_blockchain.size() != stop_height, error::wallet_internal_error, "Unexpected hashchain size");
+ THROW_WALLET_EXCEPTION_IF((m_blockchain.size() == stop_height || (m_blockchain.size() == 1 && stop_height == 0) ? false : true), error::wallet_internal_error, "Unexpected hashchain size");
THROW_WALLET_EXCEPTION_IF(m_blockchain.offset() != 0, error::wallet_internal_error, "Unexpected hashchain offset");
for (const auto &h: tip)
m_blockchain.push_back(h);