Skip to content

Commit

Permalink
Merge pull request #661 from evoskuil/master
Browse files Browse the repository at this point in the history
Use consistent calling convention and instead copy ptr, regen artifacts.
  • Loading branch information
evoskuil authored Jul 22, 2024
2 parents 2c2f44a + 6a56c03 commit f3e1d96
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 25 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,33 @@ jobs:
packager: "apt"
packages: "lcov"

- os: macos-13
- os: macos-latest
cxx: "clang++"
link: "dynamic"
optimization: "size"
assert: "ndebug"
coverage: "nocov"
boost: "--build-boost"
icu: "--build-icu --with-icu"
icu: ""
cc: "clang"
flags: "-Os -fPIE -DBOOST_NO_CXX98_FUNCTION_BASE"
options: "--enable-isystem"
packager: "brew"
packages: ""
packages: "icu4c"

- os: macos-13
- os: macos-latest
cxx: "clang++"
link: "static"
optimization: "size"
assert: "ndebug"
coverage: "nocov"
boost: "--build-boost"
icu: "--build-icu --with-icu"
icu: ""
cc: "clang"
flags: "-Os -fvisibility=hidden -fPIE -DBOOST_NO_CXX98_FUNCTION_BASE"
options: "--enable-isystem"
packager: "brew"
packages: ""
packages: "icu4c"


runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -298,33 +298,33 @@ jobs:
packager: "apt"
packages: ""

- os: macos-13
- os: macos-latest
cxx: "clang++"
link: "dynamic"
optimization: "size"
assert: "ndebug"
coverage: "nocov"
boost: "--build-boost"
icu: "--build-icu --with-icu"
icu: ""
cc: "clang"
flags: "-Os -fPIE -DBOOST_NO_CXX98_FUNCTION_BASE"
options: ""
packager: "brew"
packages: ""
packages: "icu4c"

- os: macos-13
- os: macos-latest
cxx: "clang++"
link: "static"
optimization: "size"
assert: "ndebug"
coverage: "nocov"
boost: "--build-boost"
icu: "--build-icu --with-icu"
icu: ""
cc: "clang"
flags: "-Os -fvisibility=hidden -fPIE -DBOOST_NO_CXX98_FUNCTION_BASE"
options: ""
packager: "brew"
packages: ""
packages: "icu4c"


runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/node/protocols/protocol_block_in_31800.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class BCN_API protocol_block_in_31800

/// Check incoming block message.
virtual bool handle_receive_block(const code& ec,
const network::messages::block::cptr message) NOEXCEPT;
const network::messages::block::cptr& message) NOEXCEPT;

private:
using type_id = network::messages::inventory::type_id;
Expand Down
2 changes: 1 addition & 1 deletion install-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ICU_ARCHIVE="icu4c-55_2-src.tgz"

# Boost archive.
#------------------------------------------------------------------------------
BOOST_URL="http://downloads.sourceforge.net/project/boost/boost/1.78.0/boost_1_78_0.tar.bz2"
BOOST_URL="https://archives.boost.io/release/1.78.0/source/boost_1_78_0.tar.bz2"
BOOST_ARCHIVE="boost_1_78_0.tar.bz2"


Expand Down
9 changes: 2 additions & 7 deletions install-cmakepresets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ICU_ARCHIVE="icu4c-55_2-src.tgz"

# Boost archive.
#------------------------------------------------------------------------------
BOOST_URL="http://downloads.sourceforge.net/project/boost/boost/1.78.0/boost_1_78_0.tar.bz2"
BOOST_URL="https://archives.boost.io/release/1.78.0/source/boost_1_78_0.tar.bz2"
BOOST_ARCHIVE="boost_1_78_0.tar.bz2"


Expand Down Expand Up @@ -733,14 +733,9 @@ cmake_tests()

# Build and run unit tests relative to the primary directory.
# VERBOSE=1 ensures test runner output sent to console (gcc).
make -j"$JOBS" test "VERBOSE=1"
CTEST_OUTPUT_ON_FAILURE=ON make -j"$JOBS" test "VERBOSE=1"
local RESULT=$?

# Test runners emit to the test.log file.
if [[ -e "test.log" ]]; then
cat "test.log"
fi

if [[ $RESULT -ne 0 ]]; then
exit $RESULT
fi
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ICU_ARCHIVE="icu4c-55_2-src.tgz"

# Boost archive.
#------------------------------------------------------------------------------
BOOST_URL="http://downloads.sourceforge.net/project/boost/boost/1.78.0/boost_1_78_0.tar.bz2"
BOOST_URL="https://archives.boost.io/release/1.78.0/source/boost_1_78_0.tar.bz2"
BOOST_ARCHIVE="boost_1_78_0.tar.bz2"


Expand Down
17 changes: 14 additions & 3 deletions src/protocols/protocol_block_in_31800.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ get_data protocol_block_in_31800::create_get_data(

// Messages are allocated in a thread of the channel and
bool protocol_block_in_31800::handle_receive_block(const code& ec,
const block::cptr message) NOEXCEPT
const block::cptr& message) NOEXCEPT
{
BC_ASSERT(stranded());

Expand All @@ -282,7 +282,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
// ........................................................................

auto& query = archive();
const auto& block = message->block_ptr;
const chain::block::cptr block{ message->block_ptr };
const auto& hash = block->get_hash();
const auto it = map_->find(hash);

Expand Down Expand Up @@ -315,7 +315,18 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
code == system::error::block_malleated)
{
LOGR("Uncommitted block [" << encode_hash(hash) << ":" << height
<< "] from [" << authority() << "] " << code.message());
<< "] from [" << authority() << "] " << code.message()
<< " txs(" << block->transactions() << ")"
<< " segregated(" << block->is_segregated() << ").");
stop(code);
return false;
}

if (code == system::error::forward_reference)
{
LOGR("Disordered block [" << encode_hash(hash) << ":" << height
<< " txs(" << block->transactions() << ")"
<< " segregated(" << block->is_segregated() << ").");
stop(code);
return false;
}
Expand Down

0 comments on commit f3e1d96

Please sign in to comment.