Skip to content

Commit

Permalink
Merge pull request #216 from ConcealNetwork/master
Browse files Browse the repository at this point in the history
bring it up to date
  • Loading branch information
krypt0x authored Oct 30, 2021
2 parents 6643aa2 + 280db63 commit 4716921
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 122 deletions.
37 changes: 1 addition & 36 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,41 +60,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-ubuntu16:
name: Ubuntu 16.04
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@master

- name: Build
id: build
run: |
sudo apt-get update
sudo apt-get install -y libboost-all-dev
build_folder="build/debug"
ccx_ver=${GITHUB_SHA::7}
ccx_ver_folder=$(echo $ccx_ver | sed 's/\.//g')
release_name=ccx-cli-ubuntu-1604-dev"$ccx_ver"
mkdir -p "$build_folder"
cd "$build_folder"
cmake ../.. -DCMAKE_BUILD_TYPE=Debug
make -j2
mkdir -p "$release_name"
exeFiles=()
for f in src/*; do [[ -x $f && -f $f ]] && exeFiles+=( "$f" ); done
strip "${exeFiles[@]}"
cp "${exeFiles[@]}" "$release_name/"
echo "::set-output name=release_name::${release_name}.zip"
echo "::set-output name=artifact_path::$build_folder/$release_name"
- name: Upload To GH Artifacts
uses: actions/upload-artifact@v1.0.0
with:
name: ${{ steps.build.outputs.release_name }}
path: ${{ steps.build.outputs.artifact_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-ubuntu18:
name: Ubuntu 18.04
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -181,7 +146,7 @@ jobs:
brew install gcc boost
mkdir "$build_folder"
cd "$build_folder"
cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" ..
cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -DSTATIC=ON ..
make -j2
mkdir "$release_name"
exeFiles=()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
brew install gcc boost
mkdir "$build_folder"
cd "$build_folder"
cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" ..
cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -DSTATIC=ON ..
make -j2
mkdir "$release_name"
exeFiles=()
Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/ubuntu16.yml

This file was deleted.

22 changes: 1 addition & 21 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,6 @@
"xthread": "cpp",
"sparse_hash_map": "cpp",
"sparse_hash_set": "cpp",
"sparsetable": "cpp",
"bitset": "cpp",
"clocale": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cwctype": "cpp",
"locale": "cpp",
"optional": "cpp",
"regex": "cpp",
"scoped_allocator": "cpp",
"shared_mutex": "cpp",
"string_view": "cpp",
"strstream": "cpp",
"typeindex": "cpp",
"valarray": "cpp",
"variant": "cpp",
"xlocbuf": "cpp",
"xlocmes": "cpp",
"*.ipp": "cpp"
"sparsetable": "cpp"
}
}
27 changes: 18 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 2.8.6)

include(CheckCXXCompilerFlag)
set(VERSION "0.2")
set(VERSION "6.4.9")
set(VERSION_BUILD_NO "Poseidon")
# Packaged from main commits
set(COMMIT 72946d9)
set(REFS " (HEAD -> master)")
Expand Down Expand Up @@ -250,6 +251,7 @@ if(ARM)
endif()

if(STATIC)
set(Boost_NO_BOOST_CMAKE ON)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
endif()
Expand Down Expand Up @@ -279,18 +281,25 @@ if (NOT COMMIT_ID_IN_VERSION)
set(VERSION "${VERSION}-unknown")
configure_file("src/version.h.in" "version/version.h")
add_custom_target(version ALL)
elseif(DEFINED COMMIT)
string(REPLACE "." "\\." VERSION_RE "${VERSION}")
if(NOT REFS MATCHES "(\\(|, )tag: v${VERSION_RE}(\\)|, )")
set(VERSION "${VERSION}-g${COMMIT}")
endif()
configure_file("src/version.h.in" "version/version.h")
add_custom_target(version ALL)
else()
find_package(Git QUIET)
if(Git_FOUND OR GIT_FOUND)
message(STATUS "Found Git: ${GIT_EXECUTABLE}")
add_custom_target(version ALL "${CMAKE_COMMAND}" "-D" "VERSION=${VERSION}" "-D" "GIT=${GIT_EXECUTABLE}" "-D" "TO=${CMAKE_BINARY_DIR}/version/version.h" "-P" "src/version.cmake" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
configure_file("src/version.h.in" "version/version.h")
add_custom_target(version ALL)
elseif(DEFINED COMMIT)
string(REPLACE "." "\\." VERSION_RE "${VERSION}")
if(NOT REFS MATCHES "(\\(|, )tag: v${VERSION_RE}(\\)|, )")
set(VERSION "${VERSION}-g${COMMIT}")
endif()
configure_file("src/version.h.in" "version/version.h")
add_custom_target(version ALL)
else()
message(STATUS "WARNING: Git was not found!")
set(VERSION "${VERSION}-unknown")
Expand Down
3 changes: 2 additions & 1 deletion src/CryptoNoteConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ namespace CryptoNote
const size_t BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT = 10000; // by default, blocks ids count in synchronizing
const size_t BLOCKS_SYNCHRONIZING_DEFAULT_COUNT = 128; // by default, blocks count in blocks downloading
const size_t COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT = 1000;
const size_t COMMAND_RPC_GET_OBJECTS_MAX_COUNT = 1000;

const int P2P_DEFAULT_PORT = 15000;
const int RPC_DEFAULT_PORT = 16000;
Expand Down Expand Up @@ -282,4 +283,4 @@ namespace CryptoNote

} // namespace CryptoNote

#define ALLOW_DEBUG_COMMANDS
#define ALLOW_DEBUG_COMMANDS
8 changes: 8 additions & 0 deletions src/CryptoNoteProtocol/CryptoNoteProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,19 @@ int CryptoNoteProtocolHandler::handle_notify_new_transactions(int command, NOTIF
int CryptoNoteProtocolHandler::handle_request_get_objects(int command, NOTIFY_REQUEST_GET_OBJECTS::request &arg, CryptoNoteConnectionContext &context)
{
logger(Logging::TRACE) << context << "NOTIFY_REQUEST_GET_OBJECTS";
if(arg.blocks.size() > COMMAND_RPC_GET_OBJECTS_MAX_COUNT || arg.txs.size() > COMMAND_RPC_GET_OBJECTS_MAX_COUNT)
{
logger(Logging::ERROR) << context << "GET_OBJECTS_MAX_COUNT exceeded blocks: " << arg.blocks.size() << " txes: " << arg.txs.size();
context.m_state = CryptoNoteConnectionContext::state_shutdown;
return 1;
}

NOTIFY_RESPONSE_GET_OBJECTS::request rsp;
if (!m_core.handle_get_objects(arg, rsp))
{
logger(Logging::ERROR) << context << "failed to handle request NOTIFY_REQUEST_GET_OBJECTS, dropping connection";
context.m_state = CryptoNoteConnectionContext::state_shutdown;
return 1;
}
logger(Logging::TRACE) << context << "-->>NOTIFY_RESPONSE_GET_OBJECTS: blocks.size()=" << rsp.blocks.size() << ", txs.size()=" << rsp.txs.size()
<< ", rsp.m_current_blockchain_height=" << rsp.current_blockchain_height << ", missed_ids.size()=" << rsp.missed_ids.size();
Expand Down
8 changes: 4 additions & 4 deletions src/version.h.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define BUILD_COMMIT_ID "@VERSION@"
#define PROJECT_VERSION "6.4.9"
#define PROJECT_VERSION_BUILD_NO "Poseidon"
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")"
#define BUILD_COMMIT_ID "@COMMIT@"
#define PROJECT_VERSION "@VERSION@"
#define PROJECT_VERSION_BUILD_NO "@VERSION_BUILD_NO@"
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" PROJECT_VERSION "-" BUILD_COMMIT_ID ")"

0 comments on commit 4716921

Please sign in to comment.