aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-07-18 22:58:08 +0200
committerRiccardo Spagni <ric@spagni.net>2015-07-18 22:58:20 +0200
commitd386be640df3912bfd2c2ca652518add1b35cb18 (patch)
tree9f574dd73df4a3b2703de79d201d7113a73f70db /src/cryptonote_core/blockchain.cpp
parentMerge pull request #341 (diff)
parentFixed threadpool bug when running on single core systems. (diff)
downloadmonero-d386be640df3912bfd2c2ca652518add1b35cb18.tar.xz
Merge pull request #342
70ae2ee Fixed threadpool bug when running on single core systems. *Thanks to freshman for reporting bug. (NoodleDoodleNoodleDoodleNoodleDoodleNoo) 464dbe7 Fixed MINGW duplicate library errors when MSYS folder cannot be found. *Thanks to luigi1111 for reporting. (NoodleDoodleNoodleDoodleNoodleDoodleNoo)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r--src/cryptonote_core/blockchain.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index ea107abb6..ffd4e7869 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -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) \
{ \