Skip to content

Commit

Permalink
v20240401
Browse files Browse the repository at this point in the history
  • Loading branch information
dynexcoin committed Apr 1, 2024
1 parent 58f3de4 commit 8e9f077
Show file tree
Hide file tree
Showing 810 changed files with 2,387 additions and 2,039 deletions.
109 changes: 62 additions & 47 deletions CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,55 +1,52 @@
cmake_minimum_required(VERSION 3.5)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CONFIGURATION_TYPES Debug RelWithDebInfo Release CACHE TYPE INTERNAL)
set(CMAKE_CONFIGURATION_TYPES "Release;Debug;RelWithDebInfo" CACHE TYPE INTERNAL FORCE)
set(CMAKE_SKIP_INSTALL_RULES ON)
set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY ON)
set(CMAKE_SUPPRESS_REGENERATION ON)
include(CheckCXXCompilerFlag)

enable_testing()
configure_file(${CMAKE_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_BINARY_DIR})

project(Dynex)

include_directories(include src external "${CMAKE_BINARY_DIR}/version")
if(APPLE)
include_directories(SYSTEM /usr/include/malloc)
enable_language(ASM)
endif()

if(WIN32)
option(CMAKE_USE_WIN32_THREADS_INIT "using WIN32 threads" ON)
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64")
set(ARM64 ON)
else()
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(ARM64 OFF)
endif()

#if(WIN32)
# option(CMAKE_USE_WIN32_THREADS_INIT "using WIN32 threads" ON)
#else(UNIX)
# set(CMAKE_THREAD_LIBS_INIT "-lpthread")
# set(CMAKE_HAVE_THREADS_LIBRARY 1)
# set(CMAKE_USE_WIN32_THREADS_INIT 0)
# set(CMAKE_USE_PTHREADS_INIT 1)
# set(THREADS_PREFER_PTHREAD_FLAG ON)
#endif()

if(MSVC)
include_directories(src/Platform/Windows)
set(STATIC_DEFAULT ON)
elseif(APPLE)
include_directories(src/Platform/OSX)
include_directories(src/Platform/Posix)
set(STATIC_DEFAULT ON)
else()
include_directories(src/Platform/Linux)
include_directories(src/Platform/Posix)
set(STATIC_DEFAULT OFF)
endif()

option(STATIC "Link libraries statically" ${STATIC_DEFAULT})

if(MSVC)
include_directories(src/Platform/Windows)
elseif(APPLE)
include_directories(src/Platform/OSX)
include_directories(src/Platform/Posix)
else()
include_directories(src/Platform/Linux)
include_directories(src/Platform/Posix)
endif()

set(STATIC ${MSVC} CACHE BOOL "Link libraries statically")

if(MSVC)
add_compile_options("/std:c++17")
add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /D_VARIADIC_MAX=8 /D__SSE4_1__ /d2archSSE42")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10485760")
if(STATIC)
Expand All @@ -65,15 +62,13 @@ else()
add_definitions("-D_DEFAULT_SOURCE -D_GNU_SOURCE")
endif()
set(ARCH native CACHE STRING "CPU to build for: -march value or default")
if("${ARCH}" STREQUAL "default")
# Apple clang is slow with -march=native
if(("${ARCH}" STREQUAL "default") OR (APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang"))
set(ARCH_FLAG "")
else()
set(ARCH_FLAG "-march=${ARCH}")
endif()
#set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Werror -Wno-error=extra -Wno-error=unused-function -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized -Wno-error=unused-result")

set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=unused-function -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-error=undef -Wno-unused-parameter -Wno-undef -Wno-unused-const-variable -Wno-unused-variable -Wno-unused-but-set-variable -Wno-write-strings")

set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-error=undef -Wno-unused-parameter -Wno-undef -Wno-unused-const-variable -Wno-unused-variable -Wno-unused-but-set-variable -Wno-write-strings -Wno-unused-function ")
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(WARNINGS "${WARNINGS} -Wno-error=mismatched-tags -Wno-error=null-conversion -Wno-overloaded-shift-op-parentheses -Wno-error=shift-count-overflow -Wno-error=tautological-constant-out-of-range-compare -Wno-error=unneeded-internal-declaration -Wno-unused-private-field")
else()
Expand All @@ -90,21 +85,37 @@ else()
set(WARNINGS "${WARNINGS} -Wno-error=odr")
endif()
set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes")
set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers -Wno-class-memaccess")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${MINGW_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} -maes")
if(NOT APPLE)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c17 ${MINGW_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG}")

#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_HAS_TR1_TUPLE=0")

CHECK_CXX_COMPILER_FLAG("-Werror -Wclass-memaccess" CLASS_MEMACCESS)
if(CLASS_MEMACCESS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-class-memaccess")
endif()

CHECK_CXX_COMPILER_FLAG("-Werror -maes" MAES)
if (MAES)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} -maes")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_HAS_TR1_TUPLE=0")

CHECK_CXX_COMPILER_FLAG("-Werror -pthread" PTHREAD)
if (PTHREAD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif()

if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8))
set(DEBUG_FLAGS "-g3 -Og")
else()
set(DEBUG_FLAGS "-g3 -O0")
endif()
set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable")

set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable -fno-strict-aliasing")

if(NOT APPLE)
# There is a clang bug that does not allow to compile code that uses AES-NI intrinsics if -flto is enabled
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux"
Expand All @@ -127,32 +138,25 @@ else()
endif()
endif()

# CURL is required:
# CURL is requred:
FIND_PACKAGE(CURL REQUIRED)
IF(CURL_FOUND)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
#if(APPLE)
# INCLUDE_DIRECTORIES("/usr/local/homebrew/cellar/curl/7.85.0/include")
# SET(CURL_LIBRARIES "-L /usr/local/homebrew/cellar/curl/7.85.0/lib -L /usr/local/homebrew/cellar/curl/7.85.0/include" )
# MESSAGE(INFO " Apple M1 curl path set to x86_64 versions /usr/local/homebrew/cellar/curl/7.85.0/")
#endif()
ELSE(CURL_FOUND)
MESSAGE(FATAL_ERROR "Could not find the CURL library and development files.")
ENDIF(CURL_FOUND)

# Boost is required:
if(STATIC)
MESSAGE(STATUS "LIB BOOST: Static linking")
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
endif()
find_package(Boost 1.55 REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options)
find_package(Boost 1.55 REQUIRED COMPONENTS filesystem program_options)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
if(MINGW)
set(Boost_LIBRARIES "${Boost_LIBRARIES};ws2_32;mswsock")
elseif(APPLE)
set(Boost_LIBRARIES "${Boost_LIBRARIES}")
#set(Boost_LIBRARIES "-lboost_program_options -lboost_filesystem -lboost_serialization -lboost_chrono -L ${BOOST_ROOT}/include -L ${BOOST_ROOT}/lib") #dm ${"Boost_LIBRARIES}")

elseif(NOT MSVC)
set(Boost_LIBRARIES "${Boost_LIBRARIES};rt")
endif()
Expand Down Expand Up @@ -183,6 +187,17 @@ else()
endif()
endif()

file(STRINGS "src/version.h.in" CNVER REGEX "#define CN_VER_.*")
foreach(VAL CN_VER_MAJOR CN_VER_MINOR CN_VER_REV CN_VER_WAL CN_VER_BUILD)
if(CNVER MATCHES "#define ${VAL} ([0-9]+)")
#message(STATUS "${VAL}=${CMAKE_MATCH_1}")
set(${VAL} "${CMAKE_MATCH_1}")
endif()
endforeach()
MESSAGE(STATUS "VERSION: ${CN_VER_MAJOR}.${CN_VER_MINOR}.${CN_VER_REV}(.${CN_VER_WAL})-${CN_VER_BUILD}")

add_subdirectory(external)
add_subdirectory(src)
add_subdirectory(tests)

MESSAGE(STATUS "BUILD: ${CMAKE_BUILD_TYPE}")
Empty file modified CTestCustom.cmake
100644 → 100755
Empty file.
Empty file modified LICENSE.md
100644 → 100755
Empty file.
Empty file modified Makefile
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified external/CMakeLists.txt
100644 → 100755
Empty file.
Empty file modified external/README.md
100644 → 100755
Empty file.
Empty file modified external/google/README.md
100644 → 100755
Empty file.
Empty file modified external/google/dense_hash_map
100644 → 100755
Empty file.
Empty file modified external/google/dense_hash_set
100644 → 100755
Empty file.
Empty file modified external/google/sparse_hash_map
100644 → 100755
Empty file.
Empty file modified external/google/sparse_hash_set
100644 → 100755
Empty file.
Empty file modified external/google/sparsehash/README.md
100644 → 100755
Empty file.
Empty file modified external/google/sparsehash/densehashtable.h
100644 → 100755
Empty file.
Empty file modified external/google/sparsehash/hashtable-common.h
100644 → 100755
Empty file.
Empty file modified external/google/sparsehash/libc_allocator_with_realloc.h
100644 → 100755
Empty file.
Empty file modified external/google/sparsehash/os_config.h
100644 → 100755
Empty file.
Empty file modified external/google/sparsehash/sparseconfig.h
100644 → 100755
Empty file.
Empty file modified external/google/sparsehash/sparseconfig_win.h
100644 → 100755
Empty file.
Empty file modified external/google/sparsehash/sparsehashtable.h
100644 → 100755
Empty file.
Empty file modified external/google/sparsetable
100644 → 100755
Empty file.
Empty file modified external/google/type_traits.h
100644 → 100755
Empty file.
Empty file modified external/gtest/CMakeLists.txt
100644 → 100755
Empty file.
Empty file modified external/gtest/README.md
100644 → 100755
Empty file.
Empty file modified external/linenoise/README.md
100644 → 100755
Empty file.
Empty file modified external/linenoise/linenoise.hpp
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/CMakeLists.txt
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/Changelog.txt
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/LICENSE
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/MANIFEST.in
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/Makefile
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/Makefile.mingw
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/README
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/README.md
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/VERSION
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/addr_is_reserved.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/addr_is_reserved.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/apiversions.txt
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/codelength.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/connecthostport.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/connecthostport.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/external-ip.sh
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/igd_desc_parse.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/igd_desc_parse.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/java/JavaBridgeTest.java
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/java/testjava.bat
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/java/testjava.sh
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/listdevices.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/man3/miniupnpc.3
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/mingw32make.bat
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/minihttptestserver.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/minisoap.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/minisoap.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/minissdpc.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/minissdpc.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniupnpc-config.cmake
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniupnpc.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniupnpc.def
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniupnpc.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniupnpc.rc
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniupnpc_declspec.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniupnpc_socketdef.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniupnpcmodule.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniupnpcstrings.h.cmake
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniupnpcstrings.h.in
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniupnpctypes.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniwget.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniwget.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/miniwget_private.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/minixml.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/minixml.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/minixmlvalid.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/genminiupnpcstrings.vbs
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/miniupnpc.sln
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/miniupnpc.vcproj
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/miniupnpc.vcxproj
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/miniupnpc.vcxproj.filters
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/miniupnpc_vs2010.sln
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/miniupnpc_vs2010.vcxproj
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/miniupnpc_vs2010.vcxproj.filters
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/miniupnpc_vs2015.sln
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/upnpc-static.vcproj
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/upnpc-static.vcxproj
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/upnpc-static.vcxproj.filters
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/msvc/upnpc-static_vs2010.vcxproj
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/portlistingparse.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/portlistingparse.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/pymoduletest.py
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/receivedata.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/receivedata.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/setup.py
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/setupmingw32.py
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testaddr_is_reserved.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testdesc/linksys_WAG200G_desc.values
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testdesc/linksys_WAG200G_desc.xml
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testdesc/new_LiveBox_desc.values
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testdesc/new_LiveBox_desc.xml
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testigddescparse.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testminiwget.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testminiwget.sh
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testminixml.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testportlistingparse.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testreplyparse/DeletePortMapping.namevalue
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testreplyparse/DeletePortMapping.xml
100644 → 100755
Empty file.
Empty file.
Empty file modified external/miniupnpc/testreplyparse/GetExternalIPAddress.xml
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified external/miniupnpc/testreplyparse/readme.txt
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testupnpigd.py
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testupnpreplyparse.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/testupnpreplyparse.sh
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/updateminiupnpcstrings.sh
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/upnpc.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/upnpcommands.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/upnpcommands.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/upnpdev.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/upnpdev.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/upnperrors.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/upnperrors.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/upnpreplyparse.c
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/upnpreplyparse.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/win32_snprintf.h
100644 → 100755
Empty file.
Empty file modified external/miniupnpc/wingenminiupnpcstrings.c
100644 → 100755
Empty file.
Empty file modified include/BlockchainExplorerData.h
100644 → 100755
Empty file.
Empty file modified include/BlockchainExplorerData2.h
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions include/CryptoTypes.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@

namespace Crypto {

struct Uuid {
uint8_t data[16];
};

struct Hash {
uint8_t data[32];
};
Expand Down
Empty file modified include/DynexCN.h
100644 → 100755
Empty file.
Empty file modified include/IBlockchainExplorer.h
100644 → 100755
Empty file.
Empty file modified include/INode.h
100644 → 100755
Empty file.
Empty file modified include/IObservable.h
100644 → 100755
Empty file.
Empty file modified include/IStreamSerializable.h
100644 → 100755
Empty file.
Empty file modified include/ITransaction.h
100644 → 100755
Empty file.
Empty file modified include/ITransfersContainer.h
100644 → 100755
Empty file.
Empty file modified include/ITransfersSynchronizer.h
100644 → 100755
Empty file.
Empty file modified include/IWallet.h
100644 → 100755
Empty file.
Empty file modified include/IWalletLegacy.h
100644 → 100755
Empty file.
Empty file modified include/android.h
100644 → 100755
Empty file.
Empty file modified src/BlockchainExplorer/BlockchainExplorer.cpp
100644 → 100755
Empty file.
Empty file modified src/BlockchainExplorer/BlockchainExplorer.h
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion src/BlockchainExplorer/BlockchainExplorerDataBuilder.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ bool BlockchainExplorerDataBuilder::fillBlockDetails(const Block &block, BlockDe
}

if (!core.getGeneratedTransactionsNumber(blockDetails.height, blockDetails.alreadyGeneratedTransactions)) {
return false;
//return false;
blockDetails.alreadyGeneratedTransactions = 0;
}

uint64_t prevBlockGeneratedCoins = 0;
Expand Down
Empty file modified src/BlockchainExplorer/BlockchainExplorerDataBuilder.h
100644 → 100755
Empty file.
Empty file modified src/BlockchainExplorer/BlockchainExplorerErrors.cpp
100644 → 100755
Empty file.
Empty file modified src/BlockchainExplorer/BlockchainExplorerErrors.h
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ set_property(TARGET GreenWallet PROPERTY OUTPUT_NAME "greenwallet")

if (DEFINED GUI)
add_subdirectory(WalletGui)
endif()
endif()
6 changes: 5 additions & 1 deletion src/CheckpointsData.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ const std::initializer_list<CheckpointData> CHECKPOINTS = {
{322609, "0c94b77d4ba377ea42108a24345338a7dbe2217a6aa6774c6d0b6da9f2c14882"},
{324706, "8b9099e50ddb3c111c4919223f071db4c888ee9a22b8893951ebb4295f864498"},
{329541, "f493e1ca40fe4e3a45143e02b5e061761149f02f2dfaeccfe06416c6d4c1e3da"},
{333158, "780bf986a1294a9227e9b9624a9c18a87cb282c494a58d400e0cf08422a53902"}
{333158, "780bf986a1294a9227e9b9624a9c18a87cb282c494a58d400e0cf08422a53902"},
{336000, "ee73127ab5773a465b0e6c544dfb84a764eb795a8e5dccbff8b6c87de10e45a9"},
{385300, "3896c73bc8027b30c31302ad6685f3580892d632145c381e79ee07b0ad2e0d7f"},
{400000, "48b8c448c11a8ef95fc0accfc967309a1159915d12b03a41aa2ea4b41cc5bb46"},
{410000, "e28586d1ce84881e2dd718f5659087d1435a68c400123c8f6cff6a76542ef9be"},
};

}
Empty file modified src/Common/ArrayRef.h
100644 → 100755
Empty file.
Empty file modified src/Common/ArrayView.h
100644 → 100755
Empty file.
Empty file modified src/Common/Base58.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/Base58.h
100644 → 100755
Empty file.
Empty file modified src/Common/Base64.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/Base64.h
100644 → 100755
Empty file.
Empty file modified src/Common/BlockingQueue.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/BlockingQueue.h
100644 → 100755
Empty file.
Empty file modified src/Common/CommandLine.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/CommandLine.h
100644 → 100755
Empty file.
Empty file modified src/Common/ConsoleHandler.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/ConsoleHandler.h
100644 → 100755
Empty file.
Empty file modified src/Common/ConsoleTools.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/ConsoleTools.h
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/Common/DnsTools.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ namespace Common {

map<ns_type, function<void(const ns_rr &rr)>> callbacks;

callbacks[ns_t_txt] = [&nsMsg, &records](const ns_rr &rr) -> void {
callbacks[ns_t_txt] = [&records](const ns_rr &rr) -> void {
int txt_len = *(unsigned char *) ns_rr_rdata(rr);
char txt[256];
memset(txt, 0, 256);
Expand Down
Empty file modified src/Common/DnsTools.h
100644 → 100755
Empty file.
Empty file modified src/Common/FileMappedVector.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/FileMappedVector.h
100644 → 100755
Empty file.
3 changes: 1 addition & 2 deletions src/Common/FormatTools.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ std::string formatAmount(const uint64_t amount)
const uint64_t dollars = amount / divisor;
const uint64_t cents = amount % divisor;

return formatDollars(dollars) + "." + formatCents(cents) + " "
+ "CROAT";
return formatDollars(dollars) + "." + formatCents(cents) + " " + DynexCN::CRYPTONOTE_TICKER;
}

std::string formatAmountBasic(const uint64_t amount)
Expand Down
Empty file modified src/Common/FormatTools.h
100644 → 100755
Empty file.
Empty file modified src/Common/IInputStream.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/IInputStream.h
100644 → 100755
Empty file.
Empty file modified src/Common/IOutputStream.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/IOutputStream.h
100644 → 100755
Empty file.
Empty file modified src/Common/JsonValue.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/JsonValue.h
100644 → 100755
Empty file.
Empty file modified src/Common/Lazy.h
100644 → 100755
Empty file.
Empty file modified src/Common/Math.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/Math.h
100644 → 100755
Empty file.
Empty file modified src/Common/MemoryInputStream.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/MemoryInputStream.h
100644 → 100755
Empty file.
Empty file modified src/Common/ObserverManager.h
100644 → 100755
Empty file.
Empty file modified src/Common/PasswordContainer.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/PasswordContainer.h
100644 → 100755
Empty file.
Empty file modified src/Common/PathTools.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/PathTools.h
100644 → 100755
Empty file.
Empty file modified src/Common/ScopeExit.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/ScopeExit.h
100644 → 100755
Empty file.
Empty file modified src/Common/ShuffleGenerator.h
100644 → 100755
Empty file.
Empty file modified src/Common/SignalHandler.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/SignalHandler.h
100644 → 100755
Empty file.
Empty file modified src/Common/StdInputStream.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/StdInputStream.h
100644 → 100755
Empty file.
Empty file modified src/Common/StdOutputStream.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/StdOutputStream.h
100644 → 100755
Empty file.
Empty file modified src/Common/StreamTools.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/StreamTools.h
100644 → 100755
Empty file.
Empty file modified src/Common/StringBuffer.h
100644 → 100755
Empty file.
Empty file modified src/Common/StringInputStream.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/StringInputStream.h
100644 → 100755
Empty file.
Empty file modified src/Common/StringOutputStream.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/StringOutputStream.h
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/Common/StringTools.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ std::string ipAddressToString(uint32_t ip) {
bytes[3] = (ip >> 24) & 0xFF;

char buf[16];
sprintf(buf, "%d.%d.%d.%d", bytes[0], bytes[1], bytes[2], bytes[3]);
snprintf(buf, sizeof(buf), "%d.%d.%d.%d", bytes[0], bytes[1], bytes[2], bytes[3]);

return std::string(buf);
}
Expand Down
Empty file modified src/Common/StringTools.h
100644 → 100755
Empty file.
Empty file modified src/Common/StringView.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/StringView.h
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions src/Common/UrlTools.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <stdint.h>
#include <stdio.h>
#include <string>
#include <boost/regex.hpp>
#include <regex>
#include "DynexCNConfig.h"


Expand All @@ -58,9 +58,9 @@ bool parseUrlAddress(const std::string& url, std::string& host, uint16_t& port,
port = 0;
ssl = false;

boost::regex uri_exp("^(https://|http://|)(([a-z|A-Z|0-9]|[a-z|A-Z|0-9]-[a-z|A-Z|0-9]|[a-z|A-Z|0-9]\\.)+)(:[0-9]{1,5}|)(/([\\w|-]+/)+|/|)$");
boost::cmatch reg_res;
if (boost::regex_match(url.c_str(), reg_res, uri_exp)) {
std::regex uri_exp("^(https://|http://|)(([a-z|A-Z|0-9]|[a-z|A-Z|0-9]-[a-z|A-Z|0-9]|[a-z|A-Z|0-9]\\.)+)(:[0-9]{1,5}|)(/([\\w|-]+/)+|/|)$");
std::smatch reg_res;
if (std::regex_match(url, reg_res, uri_exp)) {
if (reg_res.length(4) > 0) {
int port_src = 0;
if (sscanf(reg_res.str(4).c_str() + 1, "%d", &port_src) == 1) {
Expand Down
Empty file modified src/Common/UrlTools.h
100644 → 100755
Empty file.
Empty file modified src/Common/Util.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/Util.h
100644 → 100755
Empty file.
Empty file modified src/Common/Varint.h
100644 → 100755
Empty file.
Empty file modified src/Common/VectorOutputStream.cpp
100644 → 100755
Empty file.
Empty file modified src/Common/VectorOutputStream.h
100644 → 100755
Empty file.
Empty file modified src/Common/int-util.h
100644 → 100755
Empty file.
Empty file modified src/Common/pod-class.h
100644 → 100755
Empty file.
Empty file modified src/Common/static_assert.h
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion src/ConnectivityTool/ConnectivityTool.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ bool print_COMMAND_REQUEST_STAT_INFO(const COMMAND_REQUEST_STAT_INFO::response &

std::cout << "Tx pool size: " << si.payload_info.tx_pool_size << ENDL;
std::cout << "BC height: " << si.payload_info.blockchain_height << ENDL;
std::cout << "Mining speed: " << si.payload_info.mining_speed << ENDL;
std::cout << "Alternative blocks: " << si.payload_info.alternative_blocks << ENDL;
std::cout << "Top block id: " << si.payload_info.top_block_id_str << ENDL;
return true;
Expand Down
52 changes: 21 additions & 31 deletions src/Daemon/Daemon.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#include "DynexCNCore/Core.h"
#include "DynexCNCore/CoreConfig.h"
#include "DynexCNCore/Currency.h"
#include "DynexCNCore/MinerConfig.h"
#include "DynexCNProtocol/DynexCNProtocolHandler.h"
#include "DynexCNProtocol/IDynexCNProtocolQuery.h"
#include "P2p/NetNode.h"
Expand Down Expand Up @@ -178,7 +177,6 @@ int main(int argc, char* argv[])
RpcServerConfig::initOptions(desc_cmd_sett);
CoreConfig::initOptions(desc_cmd_sett);
NetNodeConfig::initOptions(desc_cmd_sett);
MinerConfig::initOptions(desc_cmd_sett);

po::options_description desc_options("Allowed options");
desc_options.add(desc_cmd_only).add(desc_cmd_sett);
Expand Down Expand Up @@ -458,41 +456,33 @@ int main(int argc, char* argv[])
DynexCN::core ccore(currency, nullptr, logManager, command_line::get_arg(vm, arg_enable_blockchain_indexes));

bool disable_checkpoints = command_line::get_arg(vm, arg_disable_checkpoints);
if (!disable_checkpoints) {

DynexCN::Checkpoints checkpoints(logManager);
for (const auto& cp : DynexCN::CHECKPOINTS) {
checkpoints.add_checkpoint(cp.height, cp.blockId);
}

#ifndef __ANDROID__
checkpoints.load_checkpoints_from_dns();
#endif

bool manual_checkpoints = !command_line::get_arg(vm, arg_load_checkpoints).empty();

if (manual_checkpoints && !testnet_mode) {
logger(INFO) << "Loading checkpoints from file...";
std::string checkpoints_file = command_line::get_arg(vm, arg_load_checkpoints);
bool results = checkpoints.load_checkpoints_from_file(checkpoints_file);
if (!results) {
throw std::runtime_error("Failed to load checkpoints");
}
}
if (!disable_checkpoints) {
DynexCN::Checkpoints checkpoints(logManager);
if (!testnet_mode) {
for (const auto& cp : DynexCN::CHECKPOINTS) {
checkpoints.add_checkpoint(cp.height, cp.blockId);
}
}

if (!testnet_mode) {
ccore.set_checkpoints(std::move(checkpoints));
}
checkpoints.load_checkpoints_from_remote(testnet_mode);

}
bool manual_checkpoints = !command_line::get_arg(vm, arg_load_checkpoints).empty();
if (manual_checkpoints) {
logger(INFO) << "Loading checkpoints from file...";
std::string checkpoints_file = command_line::get_arg(vm, arg_load_checkpoints);
bool results = checkpoints.load_checkpoints_from_file(checkpoints_file);
if (!results) {
throw std::runtime_error("Failed to load checkpoints");
}
}
ccore.set_checkpoints(std::move(checkpoints));
}

CoreConfig coreConfig;
coreConfig.init(vm);
NetNodeConfig netNodeConfig;
netNodeConfig.init(vm);
netNodeConfig.setTestnet(testnet_mode);
MinerConfig minerConfig;
minerConfig.init(vm);
RpcServerConfig rpcConfig;
rpcConfig.init(vm);

Expand Down Expand Up @@ -563,7 +553,7 @@ int main(int argc, char* argv[])

// initialize core here
logger(INFO) << "Initializing core...";
if (!ccore.init(coreConfig, minerConfig, true)) {
if (!ccore.init(coreConfig, true)) {
logger(ERROR, BRIGHT_RED) << "Failed to initialize core";
return 1;
}
Expand All @@ -575,7 +565,7 @@ int main(int argc, char* argv[])
uint32_t _index = 0;
if (!Common::fromString(rollback_str, _index)) {
std::cout << "wrong block index parameter" << ENDL;
return false;
return 0;
}
logger(INFO, BRIGHT_YELLOW) << "Rollback blockchain to height " << _index;
ccore.rollbackBlockchain(_index);
Expand Down
Loading

0 comments on commit 8e9f077

Please sign in to comment.