diff options
Diffstat (limited to 'src/cryptonote_basic')
-rw-r--r-- | src/cryptonote_basic/connection_context.h | 4 | ||||
-rw-r--r-- | src/cryptonote_basic/cryptonote_basic_impl.h | 2 | ||||
-rw-r--r-- | src/cryptonote_basic/difficulty.h | 4 | ||||
-rw-r--r-- | src/cryptonote_basic/miner.cpp | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/src/cryptonote_basic/connection_context.h b/src/cryptonote_basic/connection_context.h index ff56b73d7..06f66120b 100644 --- a/src/cryptonote_basic/connection_context.h +++ b/src/cryptonote_basic/connection_context.h @@ -39,7 +39,8 @@ namespace cryptonote struct cryptonote_connection_context: public epee::net_utils::connection_context_base { - cryptonote_connection_context(): m_state(state_befor_handshake), m_remote_blockchain_height(0), m_last_response_height(0) {} + cryptonote_connection_context(): m_state(state_befor_handshake), m_remote_blockchain_height(0), m_last_response_height(0), + m_last_known_hash(cryptonote::null_hash) {} enum state { @@ -56,6 +57,7 @@ namespace cryptonote uint64_t m_last_response_height; boost::posix_time::ptime m_last_request_time; epee::copyable_atomic m_callback_request_count; //in debug purpose: problem with double callback rise + crypto::hash m_last_known_hash; //size_t m_score; TODO: add score calculations }; diff --git a/src/cryptonote_basic/cryptonote_basic_impl.h b/src/cryptonote_basic/cryptonote_basic_impl.h index 9838fcb47..7a2259b32 100644 --- a/src/cryptonote_basic/cryptonote_basic_impl.h +++ b/src/cryptonote_basic/cryptonote_basic_impl.h @@ -69,7 +69,7 @@ namespace cryptonote { namespace { - std::string return_first_address(const std::string &url, const std::vector<std::string> &addresses, bool dnssec_valid) + inline std::string return_first_address(const std::string &url, const std::vector<std::string> &addresses, bool dnssec_valid) { if (addresses.empty()) return {}; diff --git a/src/cryptonote_basic/difficulty.h b/src/cryptonote_basic/difficulty.h index aed6cb289..aeb1c030d 100644 --- a/src/cryptonote_basic/difficulty.h +++ b/src/cryptonote_basic/difficulty.h @@ -42,9 +42,9 @@ namespace cryptonote /** * @brief checks if a hash fits the given difficulty * - * The hash passes if (hash * difficulty) < 2^192. + * The hash passes if (hash * difficulty) < 2^256. * Phrased differently, if (hash * difficulty) fits without overflow into - * the least significant 192 bits of the 256 bit multiplication result. + * the least significant 256 bits of the 320 bit multiplication result. * * @param hash the hash to check * @param difficulty the difficulty to check against diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp index 9248e2e1d..b14532d44 100644 --- a/src/cryptonote_basic/miner.cpp +++ b/src/cryptonote_basic/miner.cpp @@ -382,7 +382,7 @@ namespace cryptonote boost::thread::attributes attrs; attrs.set_stack_size(THREAD_STACK_SIZE); - start(m_mine_address, m_threads_total, attrs, get_is_background_mining_enabled()); + start(m_mine_address, m_threads_total, attrs, get_is_background_mining_enabled(), get_ignore_battery()); } } //----------------------------------------------------------------------------------------------------- |