aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-12-29 11:04:08 +0200
committerRiccardo Spagni <ric@spagni.net>2015-12-29 11:04:15 +0200
commit90dbae918f427646a0b06ed62f3b2448f5874f44 (patch)
tree6989688f59011c25130a2783d18a35dd52b506b0 /src
parentMerge pull request #565 (diff)
parenthardfork: ensure current_fork_index can not become negative on rescan (diff)
downloadmonero-90dbae918f427646a0b06ed62f3b2448f5874f44.tar.xz
Merge pull request #566
50ee591 hardfork: ensure current_fork_index can not become negative on rescan (moneromooo-monero) b90e14d tests: add a unit test for canonical decomposed amounts (moneromooo-monero)
Diffstat (limited to '')
-rw-r--r--src/cryptonote_core/hardfork.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptonote_core/hardfork.cpp b/src/cryptonote_core/hardfork.cpp
index 9bd4a337c..14d731108 100644
--- a/src/cryptonote_core/hardfork.cpp
+++ b/src/cryptonote_core/hardfork.cpp
@@ -210,7 +210,7 @@ bool HardFork::reorganize_from_block_height(uint64_t height)
last_versions[n] = 0;
const uint64_t rescan_height = height >= (window_size - 1) ? height - (window_size -1) : 0;
const uint8_t start_version = height == 0 ? original_version : db.get_hard_fork_version(height);
- while (heights[current_fork_index].version > start_version) {
+ while (current_fork_index > 0 && heights[current_fork_index].version > start_version) {
db.set_hard_fork_starting_height(heights[current_fork_index].version, std::numeric_limits<uint64_t>::max());
--current_fork_index;
}