aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt9
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl5
-rw-r--r--src/wallet/CMakeLists.txt7
3 files changed, 16 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 70bb215d0..5a79325ef 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -82,8 +82,13 @@ function (bitmonero_add_library name)
FILES
${ARGN})
- add_library("${name}"
- ${ARGN})
+ # Define a ("virtual") object library and an actual library that links those
+ # objects together. The virtual libraries can be arbitrarily combined to link
+ # any subset of objects into one library archive. This is used for releasing
+ # libwallet, which combines multiple components.
+ set(objlib obj_${name})
+ add_library(${objlib} OBJECT ${ARGN})
+ add_library("${name}" STATIC $<TARGET_OBJECTS:${objlib}>)
set_property(TARGET "${name}"
PROPERTY
FOLDER "libs")
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 6f095a76f..81d96d5bf 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -277,8 +277,11 @@ namespace cryptonote
m_core.set_target_blockchain_height(static_cast<int64_t>(hshd.current_height));
int64_t diff = static_cast<int64_t>(hshd.current_height) - static_cast<int64_t>(m_core.get_current_blockchain_height());
+ int64_t max_block_height = max(static_cast<int64_t>(hshd.current_height),static_cast<int64_t>(m_core.get_current_blockchain_height()));
+ int64_t last_block_v1 = 1009826;
+ int64_t diff_v2 = max_block_height > last_block_v1 ? min(abs(diff), max_block_height - last_block_v1) : 0;
LOG_PRINT_CCONTEXT_YELLOW("Sync data returned unknown top block: " << m_core.get_current_blockchain_height() << " -> " << hshd.current_height
- << " [" << std::abs(diff) << " blocks (" << diff / (24 * 60 * 60 / DIFFICULTY_TARGET_V1) << " days) "
+ << " [" << std::abs(diff) << " blocks (" << ((abs(diff) - diff_v2) / (24 * 60 * 60 / DIFFICULTY_TARGET_V1)) + (diff_v2 / (24 * 60 * 60 / DIFFICULTY_TARGET_V2)) << " days) "
<< (0 <= diff ? std::string("behind") : std::string("ahead"))
<< "] " << ENDL << "SYNCHRONIZATION started", (is_inital ? LOG_LEVEL_0:LOG_LEVEL_1));
LOG_PRINT_L1("Remote blockchain height: " << hshd.current_height << ", id: " << hshd.top_id);
diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt
index c4585f9ee..48e4b0a23 100644
--- a/src/wallet/CMakeLists.txt
+++ b/src/wallet/CMakeLists.txt
@@ -27,7 +27,6 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# include (${PROJECT_SOURCE_DIR}/cmake/libutils.cmake)
-include (${PROJECT_SOURCE_DIR}/cmake/MergeStaticLibs.cmake)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@@ -76,7 +75,11 @@ target_link_libraries(wallet
${EXTRA_LIBRARIES})
set(libs_to_merge wallet cryptonote_core mnemonics common crypto)
-merge_static_libs(wallet_merged "${libs_to_merge}")
+
+foreach(lib ${libs_to_merge})
+ list(APPEND objlibs $<TARGET_OBJECTS:obj_${lib}>) # matches naming convention in src/CMakeLists.txtA
+endforeach()
+add_library(wallet_merged STATIC ${objlibs})
install(TARGETS wallet_merged
ARCHIVE DESTINATION lib)