aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt17
-rw-r--r--Makefile2
-rw-r--r--README.md2
-rw-r--r--external/unbound/CMakeLists.txt16
-rw-r--r--src/common/CMakeLists.txt4
-rw-r--r--src/common/dns_utils.cpp3
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp2
-rw-r--r--src/daemon/core.h1
-rw-r--r--tests/unit_tests/hardfork.cpp5
9 files changed, 30 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c01be24d4..69715738e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -311,6 +311,23 @@ else()
message(STATUS "Stack trace on exception disabled")
endif()
+# Handle OpenSSL, used for sha256sum on binary updates
+if (APPLE)
+ if (NOT OpenSSL_DIR)
+ EXECUTE_PROCESS(COMMAND brew --prefix openssl
+ OUTPUT_VARIABLE OPENSSL_ROOT_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message(STATUS "Using OpenSSL found at ${OPENSSL_ROOT_DIR}")
+ endif()
+endif()
+
+find_package(OpenSSL REQUIRED)
+if(STATIC)
+ if(UNIX)
+ set(OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES};${CMAKE_DL_LIBS}")
+ endif()
+endif()
+
if (UNIX AND NOT APPLE)
# Note that at the time of this writing the -Wstrict-prototypes flag added below will make this fail
set(THREADS_PREFER_PTHREAD_FLAG ON)
diff --git a/Makefile b/Makefile
index 3ee9d0e3e..64689a1ff 100644
--- a/Makefile
+++ b/Makefile
@@ -92,7 +92,7 @@ release-static-freebsd-x86_64:
mkdir -p build/release
cd build/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="freebsd-x64" ../.. && $(MAKE)
-release-static-freebsd-x86_64:
+release-static-mac-x86_64:
mkdir -p build/release
cd build/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="mac-x64" ../.. && $(MAKE)
diff --git a/README.md b/README.md
index 30b2cad89..54a0d0d0a 100644
--- a/README.md
+++ b/README.md
@@ -138,6 +138,7 @@ library archives (`.a`).
| pkg-config | any | NO | `pkg-config` | `base-devel` | NO | |
| Boost | 1.58 | NO | `libboost-all-dev` | `boost` | NO | C++ libraries |
| libevent | 2.0 | NO | `libevent-dev` | `libevent` | NO | Network IO |
+| OpenSSL | basically any | NO | `libssl-dev` | `openssl` | NO | sha256 sum |
| libunbound | 1.4.16 | YES | `libunbound-dev` | `unbound` | NO | DNS resolver |
| libminiupnpc | 2.0 | YES | `libminiupnpc-dev` | `miniupnpc` | YES | NAT punching |
| libunwind | any | NO | `libunwind8-dev` | `libunwind` | YES | Stack traces |
@@ -145,7 +146,6 @@ library archives (`.a`).
| ldns | 1.6.17 | NO | `libldns-dev` | `ldns` | YES | SSL toolkit |
| expat | 1.1 | NO | `libexpat1-dev` | `expat` | YES | XML parsing |
| GTest | 1.5 | YES | `libgtest-dev`^ | `gtest` | YES | Test suite |
-| BerkeleyDB | 4.8 | NO | `libdb{,++}-dev` | `db` | YES | Historic DB |
| Doxygen | any | NO | `doxygen` | `doxygen` | YES | Documentation |
| Graphviz | any | NO | `graphviz` | `graphviz` | YES | Documentation |
diff --git a/external/unbound/CMakeLists.txt b/external/unbound/CMakeLists.txt
index c1e2d6887..cb1c09448 100644
--- a/external/unbound/CMakeLists.txt
+++ b/external/unbound/CMakeLists.txt
@@ -30,22 +30,6 @@ cmake_minimum_required(VERSION 2.8.7)
project(unbound C)
-if (APPLE)
- if (NOT OpenSSL_DIR)
- EXECUTE_PROCESS(COMMAND brew --prefix openssl
- OUTPUT_VARIABLE OPENSSL_ROOT_DIR
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- message(STATUS "Using OpenSSL found at ${OPENSSL_ROOT_DIR}")
- endif()
-endif()
-
-find_package(OpenSSL REQUIRED)
-if(STATIC)
- if(UNIX)
- set(OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES};${CMAKE_DL_LIBS}")
- endif()
-endif()
-
find_package(Threads)
include(configure_checks.cmake)
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index eb4d4c25d..6f64cfbf2 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -26,6 +26,8 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR})
+
set(common_sources
base58.cpp
command_line.cpp
@@ -78,7 +80,6 @@ target_link_libraries(common
PUBLIC
epee
crypto
- -lcrypto
${UNBOUND_LIBRARY}
${LIBUNWIND_LIBRARIES}
${Boost_DATE_TIME_LIBRARY}
@@ -87,6 +88,7 @@ target_link_libraries(common
${Boost_THREAD_LIBRARY}
${Boost_REGEX_LIBRARY}
PRIVATE
+ ${OPENSSL_LIBRARIES}
${EXTRA_LIBRARIES})
#monero_install_headers(common
diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp
index f7655e3c7..19aae93da 100644
--- a/src/common/dns_utils.cpp
+++ b/src/common/dns_utils.cpp
@@ -478,6 +478,9 @@ namespace
bool load_txt_records_from_dns(std::vector<std::string> &good_records, const std::vector<std::string> &dns_urls)
{
+ // Prevent infinite recursion when distributing
+ if (dns_urls.empty()) return false;
+
std::vector<std::vector<std::string> > records;
records.resize(dns_urls.size());
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 73f01559d..ce5acdaf8 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -155,6 +155,8 @@ namespace cryptonote
// we now also need some of net_node's options (p2p bind arg, for separate data dir)
command_line::add_arg(desc, nodetool::arg_testnet_p2p_bind_port, false);
command_line::add_arg(desc, nodetool::arg_p2p_bind_port, false);
+
+ miner::init_options(desc);
}
//-----------------------------------------------------------------------------------------------
bool core::handle_command_line(const boost::program_options::variables_map& vm)
diff --git a/src/daemon/core.h b/src/daemon/core.h
index 23f7a9f63..b23423fdf 100644
--- a/src/daemon/core.h
+++ b/src/daemon/core.h
@@ -45,7 +45,6 @@ public:
static void init_options(boost::program_options::options_description & option_spec)
{
cryptonote::core::init_options(option_spec);
- cryptonote::miner::init_options(option_spec);
}
private:
typedef cryptonote::t_cryptonote_protocol_handler<cryptonote::core> t_protocol_raw;
diff --git a/tests/unit_tests/hardfork.cpp b/tests/unit_tests/hardfork.cpp
index 7ca5ad09d..94bbcc215 100644
--- a/tests/unit_tests/hardfork.cpp
+++ b/tests/unit_tests/hardfork.cpp
@@ -32,6 +32,7 @@
#include "gtest/gtest.h"
#include "blockchain_db/lmdb/db_lmdb.h"
+#include "cryptonote_basic/cryptonote_format_utils.h"
#include "cryptonote_basic/hardfork.h"
using namespace cryptonote;
@@ -59,7 +60,7 @@ public:
virtual void block_txn_abort() {}
virtual void drop_hard_fork_info() {}
virtual bool block_exists(const crypto::hash& h, uint64_t *height) const { return false; }
- virtual blobdata get_block_blob_from_height(const uint64_t& height) const { return blobdata(); }
+ virtual blobdata get_block_blob_from_height(const uint64_t& height) const { return cryptonote::t_serializable_object_to_blob(get_block_from_height(height)); }
virtual blobdata get_block_blob(const crypto::hash& h) const { return blobdata(); }
virtual bool get_tx_blob(const crypto::hash& h, cryptonote::blobdata &tx) const { return false; }
virtual uint64_t get_block_height(const crypto::hash& h) const { return 0; }
@@ -91,7 +92,7 @@ public:
virtual tx_out_index get_output_tx_and_index_from_global(const uint64_t& index) const { return tx_out_index(); }
virtual tx_out_index get_output_tx_and_index(const uint64_t& amount, const uint64_t& index) const { return tx_out_index(); }
virtual void get_output_tx_and_index(const uint64_t& amount, const std::vector<uint64_t> &offsets, std::vector<tx_out_index> &indices) const {}
- virtual void get_output_key(const uint64_t &amount, const std::vector<uint64_t> &offsets, std::vector<output_data_t> &outputs) {}
+ virtual void get_output_key(const uint64_t &amount, const std::vector<uint64_t> &offsets, std::vector<output_data_t> &outputs, bool allow_partial = false) {}
virtual bool can_thread_bulk_indices() const { return false; }
virtual std::vector<uint64_t> get_tx_output_indices(const crypto::hash& h) const { return std::vector<uint64_t>(); }
virtual std::vector<uint64_t> get_tx_amount_output_indices(const uint64_t tx_index) const { return std::vector<uint64_t>(); }