aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
-rw-r--r--contrib/epee/include/console_handler.h12
-rw-r--r--src/cryptonote_core/blockchain.cpp15
3 files changed, 21 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e7378a7e..f9e21604f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -159,16 +159,16 @@ endif()
option(STATIC "Link libraries statically" ${DEFAULT_STATIC})
if(MINGW)
- get_filename_component(msys2_install_path "[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS2 ${ARCH_WIDTH}bit;InstallLocation]" ABSOLUTE)
+ string(REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}")
+ message(STATUS "MSYS location: ${msys2_install_path}")
set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include")
# This is necessary because otherwise CMake will make Boost libraries -lfoo
# rather than a full path. Unfortunately, this makes the shared libraries get
# linked due to a bug in CMake which misses putting -static flags around the
# -lfoo arguments.
- list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES
- "${msys2_install_path}/mingw${ARCH_WIDTH}/lib")
- list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES
- "${msys2_install_path}/mingw${ARCH_WIDTH}/lib")
+ set(DEFLIB ${msys2_install_path}/mingw${ARCH_WIDTH}/lib)
+ list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
+ list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
endif()
if(STATIC)
diff --git a/contrib/epee/include/console_handler.h b/contrib/epee/include/console_handler.h
index 952fc3c96..5dd3eaba9 100644
--- a/contrib/epee/include/console_handler.h
+++ b/contrib/epee/include/console_handler.h
@@ -274,14 +274,15 @@ namespace epee
}
std::string command;
- if(!m_stdin_reader.get_line(command))
- {
- LOG_PRINT("Failed to read line.", LOG_LEVEL_0);
- }
+ bool get_line_ret = m_stdin_reader.get_line(command);
if (m_stdin_reader.eos())
{
break;
}
+ if (!get_line_ret)
+ {
+ LOG_PRINT("Failed to read line.", LOG_LEVEL_0);
+ }
string_tools::trim(command);
LOG_PRINT_L2("Read command: " << command);
@@ -303,7 +304,8 @@ namespace epee
std::cout << usage;
}
}
- exit_handler();
+ if (exit_handler)
+ exit_handler();
return true;
CATCH_ENTRY_L0("console_handler", false);
}
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index ea107abb6..cc2d6f821 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -309,7 +309,7 @@ bool Blockchain::init(BlockchainDB* db, const bool testnet)
m_async_pool.create_thread(boost::bind(&boost::asio::io_service::run, &m_async_service));
#if defined(PER_BLOCK_CHECKPOINT)
- if (m_fast_sync && get_blocks_dat_start() != nullptr)
+ if (m_fast_sync && !testnet && get_blocks_dat_start() != nullptr)
{
if (get_blocks_dat_size() > 4)
{
@@ -2009,11 +2009,14 @@ bool Blockchain::check_tx_inputs(const transaction& tx, uint64_t* pmax_used_bloc
boost::thread_group threadpool;
std::auto_ptr < boost::asio::io_service::work > work(new boost::asio::io_service::work(ioservice));
- for (int i = 0; i < threads; i++)
- {
- threadpool.create_thread(boost::bind(&boost::asio::io_service::run, &ioservice));
- }
-
+ if(threads > 1)
+ {
+ for (int i = 0; i < threads; i++)
+ {
+ threadpool.create_thread(boost::bind(&boost::asio::io_service::run, &ioservice));
+ }
+ }
+
#define KILL_IOSERVICE() \
if(threads > 1) \
{ \