diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_core/hardfork.cpp | 11 | ||||
-rw-r--r-- | src/wallet/CMakeLists.txt | 26 |
2 files changed, 12 insertions, 25 deletions
diff --git a/src/cryptonote_core/hardfork.cpp b/src/cryptonote_core/hardfork.cpp index d3262dbe3..39c026b08 100644 --- a/src/cryptonote_core/hardfork.cpp +++ b/src/cryptonote_core/hardfork.cpp @@ -164,7 +164,7 @@ void HardFork::init() // restore state from DB uint64_t height = db.height(); if (height > window_size) - height -= window_size; + height -= window_size - 1; else height = 1; @@ -259,8 +259,7 @@ bool HardFork::rescan_from_block_height(uint64_t height) for (size_t n = 0; n < 256; ++n) last_versions[n] = 0; - const uint64_t rescan_height = height >= (window_size - 1) ? height - (window_size -1) : 0; - for (uint64_t h = rescan_height; h <= height; ++h) { + for (uint64_t h = height; h < db.height(); ++h) { cryptonote::block b = db.get_block_from_height(h); const uint8_t v = get_effective_version(get_block_vote(b)); last_versions[v]++; @@ -271,6 +270,12 @@ bool HardFork::rescan_from_block_height(uint64_t height) current_fork_index = 0; while (current_fork_index + 1 < heights.size() && heights[current_fork_index].version != lastv) ++current_fork_index; + + uint8_t voted = get_voted_fork_index(db.height()); + if (voted > current_fork_index) { + current_fork_index = voted; + } + db.block_txn_stop(); return true; diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt index 086758c39..c4585f9ee 100644 --- a/src/wallet/CMakeLists.txt +++ b/src/wallet/CMakeLists.txt @@ -75,28 +75,10 @@ target_link_libraries(wallet ${Boost_REGEX_LIBRARY} ${EXTRA_LIBRARIES}) - -# in case of static build, randon.c.obj from UNBOUND_LIBARY conflicts with the same file from 'crypto' -# and in case of dynamic build, merge_static_libs called with ${UNBOUND_LIBRARY} will fail -if (STATIC) - set(libs_to_merge wallet cryptonote_core mnemonics common crypto) - # hack - repack libunbound into another static lib - there's conflicting object file "random.c.obj" - merge_static_libs(wallet_merged "${libs_to_merge}") - merge_static_libs(wallet_merged2 "${UNBOUND_LIBRARY}") - install(TARGETS wallet_merged wallet_merged2 - ARCHIVE DESTINATION lib) -else (STATIC) - set(libs_to_merge wallet cryptonote_core mnemonics common crypto ${UNBOUND_LIBRARY} ) - merge_static_libs(wallet_merged "${libs_to_merge}") - install(TARGETS wallet_merged - ARCHIVE DESTINATION lib) -endif (STATIC) - -#MERGE_STATIC_LIBS(wallet_merged wallet_merged "${libs_to_merge}") - - +set(libs_to_merge wallet cryptonote_core mnemonics common crypto) +merge_static_libs(wallet_merged "${libs_to_merge}") +install(TARGETS wallet_merged + ARCHIVE DESTINATION lib) install(FILES ${wallet_api_headers} DESTINATION include/wallet) - - |