diff --git a/Makefile.am b/Makefile.am index 17d8bdd8..c4133d62 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,7 +32,7 @@ doc_DATA = \ # src/libbitcoin-blockchain.la => ${libdir} #------------------------------------------------------------------------------ lib_LTLIBRARIES = src/libbitcoin-blockchain.la -src_libbitcoin_blockchain_la_CPPFLAGS = -I${srcdir}/include ${bitcoin_database_CPPFLAGS} ${bitcoin_consensus_CPPFLAGS} +src_libbitcoin_blockchain_la_CPPFLAGS = -I${srcdir}/include ${bitcoin_database_SYS_CPPFLAGS} ${bitcoin_consensus_SYS_CPPFLAGS} src_libbitcoin_blockchain_la_LIBADD = ${bitcoin_database_LIBS} ${bitcoin_consensus_LIBS} src_libbitcoin_blockchain_la_SOURCES = \ src/settings.cpp \ @@ -70,7 +70,7 @@ if WITH_TESTS TESTS = libbitcoin-blockchain-test_runner.sh check_PROGRAMS = test/libbitcoin-blockchain-test -test_libbitcoin_blockchain_test_CPPFLAGS = -I${srcdir}/include ${bitcoin_database_CPPFLAGS} ${bitcoin_consensus_CPPFLAGS} +test_libbitcoin_blockchain_test_CPPFLAGS = -I${srcdir}/include ${bitcoin_database_SYS_CPPFLAGS} ${bitcoin_consensus_SYS_CPPFLAGS} test_libbitcoin_blockchain_test_LDADD = src/libbitcoin-blockchain.la ${boost_unit_test_framework_LIBS} ${bitcoin_database_LIBS} ${bitcoin_consensus_LIBS} test_libbitcoin_blockchain_test_SOURCES = \ test/fast_chain.cpp \ @@ -101,7 +101,7 @@ endif WITH_TESTS if WITH_TOOLS noinst_PROGRAMS = tools/initchain/initchain -tools_initchain_initchain_CPPFLAGS = -I${srcdir}/include ${bitcoin_database_CPPFLAGS} ${bitcoin_consensus_CPPFLAGS} +tools_initchain_initchain_CPPFLAGS = -I${srcdir}/include ${bitcoin_database_SYS_CPPFLAGS} ${bitcoin_consensus_SYS_CPPFLAGS} tools_initchain_initchain_LDADD = src/libbitcoin-blockchain.la ${bitcoin_database_LIBS} ${bitcoin_consensus_LIBS} tools_initchain_initchain_SOURCES = \ tools/initchain/initchain.cpp diff --git a/builds/msvc/vs2013/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters b/builds/msvc/vs2013/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters index 912067fd..0017fdde 100644 --- a/builds/msvc/vs2013/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters +++ b/builds/msvc/vs2013/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters @@ -10,11 +10,8 @@ {CEC6DE45-B67A-487F-0000-000000000000} - - {CEC6DE45-B67A-487F-0000-000000000001} - - {CEC6DE45-B67A-487F-0000-000000000002} + {CEC6DE45-B67A-487F-0000-000000000001} diff --git a/builds/msvc/vs2013/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters b/builds/msvc/vs2013/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters index 95fb7ebc..673cd40b 100644 --- a/builds/msvc/vs2013/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters +++ b/builds/msvc/vs2013/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters @@ -8,17 +8,11 @@ - {B9CED930-2EC0-4639-0000-000000000003} + {B9CED930-2EC0-4639-0000-000000000001} {B9CED930-2EC0-4639-0000-000000000000} - - {B9CED930-2EC0-4639-0000-000000000001} - - - {B9CED930-2EC0-4639-0000-000000000002} - diff --git a/builds/msvc/vs2013/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters b/builds/msvc/vs2013/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters index 8f116464..2fbc655f 100644 --- a/builds/msvc/vs2013/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters +++ b/builds/msvc/vs2013/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters @@ -8,67 +8,49 @@ - {868DAB9E-FD33-497F-0000-00000000000C} + {868DAB9E-FD33-497F-0000-000000000006} - {868DAB9E-FD33-497F-0000-00000000000D} + {868DAB9E-FD33-497F-0000-000000000007} - {868DAB9E-FD33-497F-0000-00000000000E} + {868DAB9E-FD33-497F-0000-000000000008} - {868DAB9E-FD33-497F-0000-00000000000F} + {868DAB9E-FD33-497F-0000-000000000009} - {868DAB9E-FD33-497F-0000-000000000001} + {868DAB9E-FD33-497F-0000-00000000000A} - {868DAB9E-FD33-497F-0000-000000000002} + {868DAB9E-FD33-497F-0000-00000000000B} - {868DAB9E-FD33-497F-0000-000000000003} + {868DAB9E-FD33-497F-0000-00000000000C} - {868DAB9E-FD33-497F-0000-000000000004} + {868DAB9E-FD33-497F-0000-00000000000D} - {868DAB9E-FD33-497F-0000-000000000005} + {868DAB9E-FD33-497F-0000-00000000000E} {868DAB9E-FD33-497F-0000-000000000000} - - {868DAB9E-FD33-497F-0000-000000000001} - - - {868DAB9E-FD33-497F-0000-000000000002} - - {868DAB9E-FD33-497F-0000-000000000003} - - - {868DAB9E-FD33-497F-0000-000000000008} + {868DAB9E-FD33-497F-0000-000000000001} - {868DAB9E-FD33-497F-0000-000000000004} + {868DAB9E-FD33-497F-0000-000000000002} - {868DAB9E-FD33-497F-0000-000000000005} - - - {868DAB9E-FD33-497F-0000-000000000009} + {868DAB9E-FD33-497F-0000-000000000003} - {868DAB9E-FD33-497F-0000-000000000006} - - - {868DAB9E-FD33-497F-0000-00000000000A} + {868DAB9E-FD33-497F-0000-000000000004} - {868DAB9E-FD33-497F-0000-000000000007} - - - {868DAB9E-FD33-497F-0000-00000000000B} + {868DAB9E-FD33-497F-0000-000000000005} diff --git a/builds/msvc/vs2015/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters b/builds/msvc/vs2015/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters index 912067fd..0017fdde 100644 --- a/builds/msvc/vs2015/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters +++ b/builds/msvc/vs2015/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters @@ -10,11 +10,8 @@ {CEC6DE45-B67A-487F-0000-000000000000} - - {CEC6DE45-B67A-487F-0000-000000000001} - - {CEC6DE45-B67A-487F-0000-000000000002} + {CEC6DE45-B67A-487F-0000-000000000001} diff --git a/builds/msvc/vs2015/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters b/builds/msvc/vs2015/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters index 95fb7ebc..673cd40b 100644 --- a/builds/msvc/vs2015/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters +++ b/builds/msvc/vs2015/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters @@ -8,17 +8,11 @@ - {B9CED930-2EC0-4639-0000-000000000003} + {B9CED930-2EC0-4639-0000-000000000001} {B9CED930-2EC0-4639-0000-000000000000} - - {B9CED930-2EC0-4639-0000-000000000001} - - - {B9CED930-2EC0-4639-0000-000000000002} - diff --git a/builds/msvc/vs2015/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters b/builds/msvc/vs2015/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters index 64c1b89a..ee48c847 100644 --- a/builds/msvc/vs2015/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters +++ b/builds/msvc/vs2015/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters @@ -8,67 +8,49 @@ - {868DAB9E-FD33-497F-0000-00000000000C} + {868DAB9E-FD33-497F-0000-000000000006} - {868DAB9E-FD33-497F-0000-00000000000D} + {868DAB9E-FD33-497F-0000-000000000007} - {868DAB9E-FD33-497F-0000-00000000000E} + {868DAB9E-FD33-497F-0000-000000000008} - {868DAB9E-FD33-497F-0000-00000000000F} + {868DAB9E-FD33-497F-0000-000000000009} - {868DAB9E-FD33-497F-0000-000000000001} + {868DAB9E-FD33-497F-0000-00000000000A} - {868DAB9E-FD33-497F-0000-000000000002} + {868DAB9E-FD33-497F-0000-00000000000B} - {868DAB9E-FD33-497F-0000-000000000003} + {868DAB9E-FD33-497F-0000-00000000000C} - {868DAB9E-FD33-497F-0000-000000000004} + {868DAB9E-FD33-497F-0000-00000000000D} - {868DAB9E-FD33-497F-0000-000000000005} + {868DAB9E-FD33-497F-0000-00000000000E} {868DAB9E-FD33-497F-0000-000000000000} - - {868DAB9E-FD33-497F-0000-000000000001} - - - {868DAB9E-FD33-497F-0000-000000000002} - - {868DAB9E-FD33-497F-0000-000000000003} - - - {868DAB9E-FD33-497F-0000-000000000008} + {868DAB9E-FD33-497F-0000-000000000001} - {868DAB9E-FD33-497F-0000-000000000004} + {868DAB9E-FD33-497F-0000-000000000002} - {868DAB9E-FD33-497F-0000-000000000005} - - - {868DAB9E-FD33-497F-0000-000000000009} + {868DAB9E-FD33-497F-0000-000000000003} - {868DAB9E-FD33-497F-0000-000000000006} - - - {868DAB9E-FD33-497F-0000-00000000000A} + {868DAB9E-FD33-497F-0000-000000000004} - {868DAB9E-FD33-497F-0000-000000000007} - - - {868DAB9E-FD33-497F-0000-00000000000B} + {868DAB9E-FD33-497F-0000-000000000005} diff --git a/builds/msvc/vs2017/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters b/builds/msvc/vs2017/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters index 912067fd..0017fdde 100644 --- a/builds/msvc/vs2017/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters +++ b/builds/msvc/vs2017/libbitcoin-blockchain-test/libbitcoin-blockchain-test.vcxproj.filters @@ -10,11 +10,8 @@ {CEC6DE45-B67A-487F-0000-000000000000} - - {CEC6DE45-B67A-487F-0000-000000000001} - - {CEC6DE45-B67A-487F-0000-000000000002} + {CEC6DE45-B67A-487F-0000-000000000001} diff --git a/builds/msvc/vs2017/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters b/builds/msvc/vs2017/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters index 95fb7ebc..673cd40b 100644 --- a/builds/msvc/vs2017/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters +++ b/builds/msvc/vs2017/libbitcoin-blockchain-tools/libbitcoin-blockchain-tools.vcxproj.filters @@ -8,17 +8,11 @@ - {B9CED930-2EC0-4639-0000-000000000003} + {B9CED930-2EC0-4639-0000-000000000001} {B9CED930-2EC0-4639-0000-000000000000} - - {B9CED930-2EC0-4639-0000-000000000001} - - - {B9CED930-2EC0-4639-0000-000000000002} - diff --git a/builds/msvc/vs2017/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters b/builds/msvc/vs2017/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters index 0250a2cf..6628812e 100644 --- a/builds/msvc/vs2017/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters +++ b/builds/msvc/vs2017/libbitcoin-blockchain/libbitcoin-blockchain.vcxproj.filters @@ -8,67 +8,49 @@ - {868DAB9E-FD33-497F-0000-00000000000C} + {868DAB9E-FD33-497F-0000-000000000006} - {868DAB9E-FD33-497F-0000-00000000000D} + {868DAB9E-FD33-497F-0000-000000000007} - {868DAB9E-FD33-497F-0000-00000000000E} + {868DAB9E-FD33-497F-0000-000000000008} - {868DAB9E-FD33-497F-0000-00000000000F} + {868DAB9E-FD33-497F-0000-000000000009} - {868DAB9E-FD33-497F-0000-000000000001} + {868DAB9E-FD33-497F-0000-00000000000A} - {868DAB9E-FD33-497F-0000-000000000002} + {868DAB9E-FD33-497F-0000-00000000000B} - {868DAB9E-FD33-497F-0000-000000000003} + {868DAB9E-FD33-497F-0000-00000000000C} - {868DAB9E-FD33-497F-0000-000000000004} + {868DAB9E-FD33-497F-0000-00000000000D} - {868DAB9E-FD33-497F-0000-000000000005} + {868DAB9E-FD33-497F-0000-00000000000E} {868DAB9E-FD33-497F-0000-000000000000} - - {868DAB9E-FD33-497F-0000-000000000001} - - - {868DAB9E-FD33-497F-0000-000000000002} - - {868DAB9E-FD33-497F-0000-000000000003} - - - {868DAB9E-FD33-497F-0000-000000000008} + {868DAB9E-FD33-497F-0000-000000000001} - {868DAB9E-FD33-497F-0000-000000000004} + {868DAB9E-FD33-497F-0000-000000000002} - {868DAB9E-FD33-497F-0000-000000000005} - - - {868DAB9E-FD33-497F-0000-000000000009} + {868DAB9E-FD33-497F-0000-000000000003} - {868DAB9E-FD33-497F-0000-000000000006} - - - {868DAB9E-FD33-497F-0000-00000000000A} + {868DAB9E-FD33-497F-0000-000000000004} - {868DAB9E-FD33-497F-0000-000000000007} - - - {868DAB9E-FD33-497F-0000-00000000000B} + {868DAB9E-FD33-497F-0000-000000000005} diff --git a/configure.ac b/configure.ac index c28661c7..61c39b2b 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,9 @@ AC_PROG_CXX # Enable shared libraries if available, and static if they don't conflict. AC_PROG_LIBTOOL +# Enable sed for substitution. +AC_PROG_SED + # Compute the canonical host-system type variable host, including host_os. AC_CANONICAL_HOST @@ -133,6 +136,7 @@ AS_CASE([${enable_shared}], [yes], AC_DEFINE([BOOST_ALL_DYN_LINK])) AS_CASE([${CC}], [*], [AX_BOOST_BASE([1.62.0], [AC_SUBST([boost_CPPFLAGS], [${BOOST_CPPFLAGS}]) + AC_SUBST([boost_SYS_CPPFLAGS], [`echo ${BOOST_CPPFLAGS} | $SED s/^-I/-isystem/g | $SED s/' -I'/' -isystem'/g`]) AC_SUBST([boost_LDFLAGS], [${BOOST_LDFLAGS}]) AC_MSG_NOTICE([boost_CPPFLAGS : ${boost_CPPFLAGS}]) AC_MSG_NOTICE([boost_LDFLAGS : ${boost_LDFLAGS}])], @@ -149,6 +153,7 @@ AS_CASE([${with_tests}], [yes], PKG_CHECK_MODULES([bitcoin_database], [libbitcoin-database >= 4.0.0]) AC_SUBST([bitcoin_database_PKG], ['libbitcoin-database >= 4.0.0']) AC_SUBST([bitcoin_database_CPPFLAGS], [${bitcoin_database_CFLAGS}]) +AC_SUBST([bitcoin_database_SYS_CPPFLAGS], [`echo ${bitcoin_database_CFLAGS} | $SED s/^-I/-isystem/g | $SED s/' -I'/' -isystem'/g`]) AC_MSG_NOTICE([bitcoin_database_CPPFLAGS : ${bitcoin_database_CPPFLAGS}]) AC_MSG_NOTICE([bitcoin_database_LIBS : ${bitcoin_database_LIBS}]) @@ -158,6 +163,7 @@ AS_CASE([${with_consensus}], [yes], [PKG_CHECK_MODULES([bitcoin_consensus], [libbitcoin-consensus >= 4.0.0]) AC_SUBST([bitcoin_consensus_PKG], ['libbitcoin-consensus >= 4.0.0']) AC_SUBST([bitcoin_consensus_CPPFLAGS], [${bitcoin_consensus_CFLAGS}]) + AC_SUBST([bitcoin_consensus_SYS_CPPFLAGS], [`echo ${bitcoin_consensus_CFLAGS} | $SED s/^-I/-isystem/g | $SED s/' -I'/' -isystem'/g`]) AC_MSG_NOTICE([bitcoin_consensus_CPPFLAGS : ${bitcoin_consensus_CPPFLAGS}]) AC_MSG_NOTICE([bitcoin_consensus_LIBS : ${bitcoin_consensus_LIBS}])], [AC_SUBST([bitcoin_consensus_PKG], [])]) @@ -177,12 +183,24 @@ AS_CASE([${CC}], [*], [AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])]) +# Warn on all stuff. +#------------------------------------------------------------------------------ +AS_CASE([${CC}], [*], + [AX_CHECK_COMPILE_FLAG([-Wall], + [CXXFLAGS="$CXXFLAGS -Wall"])]) + # Warn on extra stuff. #------------------------------------------------------------------------------ AS_CASE([${CC}], [*], [AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="$CFLAGS -Wextra"])]) +# Warn on extra stuff. +#------------------------------------------------------------------------------ +AS_CASE([${CC}], [*], + [AX_CHECK_COMPILE_FLAG([-Wextra], + [CXXFLAGS="$CXXFLAGS -Wextra"])]) + # Be really annoying. #------------------------------------------------------------------------------ AS_CASE([${CC}], [*], @@ -191,6 +209,26 @@ AS_CASE([${CC}], [*], [AX_CHECK_COMPILE_FLAG([-pedantic], [CFLAGS="$CFLAGS -pedantic"])])]) +# Be really annoying. +#------------------------------------------------------------------------------ +AS_CASE([${CC}], [*], + [AX_CHECK_COMPILE_FLAG([-Wpedantic], + [CXXFLAGS="$CXXFLAGS -Wpedantic"], + [AX_CHECK_COMPILE_FLAG([-pedantic], + [CXXFLAGS="$CXXFLAGS -pedantic"])])]) + +# Disallow warning on style order of declarations. +#------------------------------------------------------------------------------ +AS_CASE([${CC}], [*], + [AX_CHECK_COMPILE_FLAG([-Wno-reorder], + [CXXFLAGS="$CXXFLAGS -Wno-reorder"])]) + +# Suppress warning for incomplete field initialization. +#------------------------------------------------------------------------------ +AS_CASE([${CC}], [*], + [AX_CHECK_COMPILE_FLAG([-Wno-missing-field-initializers], + [CXXFLAGS="$CXXFLAGS -Wno-missing-field-initializers"])]) + # Conform to style. #------------------------------------------------------------------------------ AS_CASE([${CC}], [*], @@ -203,18 +241,6 @@ AS_CASE([${CC}], [*clang*], [AX_CHECK_COMPILE_FLAG([-Wno-mismatched-tags], [CXXFLAGS="$CXXFLAGS -Wno-mismatched-tags"])]) -# Clean up boost 1.55 headers. Enabled in gcc only. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*gcc*], - [AX_CHECK_COMPILE_FLAG([-Wno-deprecated-declarations], - [CXXFLAGS="$CXXFLAGS -Wno-deprecated-declarations"])]) - -# Clean up boost 1.55 headers. Enabled in clang only. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*clang*], - [AX_CHECK_COMPILE_FLAG([-Wno-redeclared-class-member], - [CXXFLAGS="$CXXFLAGS -Wno-redeclared-class-member"])]) - # Protect stack. #------------------------------------------------------------------------------ AS_CASE([${CC}], [*], @@ -227,12 +253,6 @@ AS_CASE([${CC}], [*], [AX_CHECK_LINK_FLAG([-fstack-protector-all], [LDFLAGS="$LDFLAGS -fstack-protector-all"])]) -# Hide internal functions from external libs. Enabled in gcc only. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*gcc*], - [AX_CHECK_COMPILE_FLAG([-fvisibility-hidden], - [CXXFLAGS="$CXXFLAGS -fvisibility-hidden"])]) - # Hide inlines from external libs. Enabled in gcc only. #------------------------------------------------------------------------------ AS_CASE([${CC}], [*gcc*], diff --git a/src/interface/block_chain.cpp b/src/interface/block_chain.cpp index 3b5c8890..0ced3346 100644 --- a/src/interface/block_chain.cpp +++ b/src/interface/block_chain.cpp @@ -505,7 +505,7 @@ bool block_chain::stop() validation_mutex_.lock_high_priority(); // This cannot call organize or stop (lock safe). - auto result = + auto result = header_organizer_.stop() && ////block_organizer_.stop() && transaction_organizer_.stop(); @@ -762,14 +762,14 @@ void block_chain::fetch_merkle_block(const hash_digest& hash, handler(error::success, merkle, result.height()); } -void block_chain::fetch_compact_block(size_t height, +void block_chain::fetch_compact_block(size_t , compact_block_fetch_handler handler) const { // TODO: implement compact blocks. handler(error::not_implemented, {}, 0); } -void block_chain::fetch_compact_block(const hash_digest& hash, +void block_chain::fetch_compact_block(const hash_digest& , compact_block_fetch_handler handler) const { // TODO: implement compact blocks. @@ -906,7 +906,7 @@ void block_chain::fetch_locator_block_hashes(get_blocks_const_ptr locator, } // BUGBUG: an intervening reorg can produce an invalid chain of hashes. - // TODO: instead walk backwards using parent hash lookups. + // TODO: instead walk backwards using parent hash lookups. // This is based on the idea that looking up by block hash to get heights // will be much faster than hashing each retrieved block to test for stop. @@ -989,7 +989,7 @@ void block_chain::fetch_locator_block_headers(get_headers_const_ptr locator, } // BUGBUG: an intervening reorg can produce an invalid chain of headers. - // TODO: instead walk backwards using parent hash lookups. + // TODO: instead walk backwards using parent hash lookups. // This is based on the idea that looking up by block hash to get heights // will be much faster than hashing each retrieved block to test for stop. @@ -1130,7 +1130,7 @@ void block_chain::fetch_header_locator(const block::indexes& heights, // Confirmed heights only. // TODO: reimplement in store. -void block_chain::fetch_spend(const chain::output_point& outpoint, +void block_chain::fetch_spend(const chain::output_point& , spend_fetch_handler handler) const { if (stopped()) @@ -1216,7 +1216,7 @@ void block_chain::fetch_template(merkle_block_fetch_handler handler) const // All txs satisfy the fee minimum and are valid at the next chain state. // The set of blocks is limited in count to size. The set may have internal // dependencies but all inputs must be satisfied at the current height. -void block_chain::fetch_mempool(size_t count_limit, uint64_t minimum_fee, +void block_chain::fetch_mempool(size_t count_limit, uint64_t , inventory_fetch_handler handler) const { transaction_organizer_.fetch_mempool(count_limit, handler); @@ -1308,7 +1308,7 @@ void block_chain::subscribe_headers(reindex_handler&& handler) header_organizer_.subscribe(std::move(handler)); } -void block_chain::subscribe_blockchain(reorganize_handler&& handler) +void block_chain::subscribe_blockchain(reorganize_handler&& ) { // Pass this through to the organizer, which issues the notifications. ////block_organizer_.subscribe(std::move(handler)); @@ -1336,7 +1336,7 @@ void block_chain::organize(header_const_ptr header, result_handler handler) header_organizer_.organize(header, handler); } -void block_chain::organize(block_const_ptr block, result_handler handler) +void block_chain::organize(block_const_ptr , result_handler ) { // TODO: implement block organize. // The handler must not call organize (lock safety). diff --git a/src/organizers/block_organizer.cpp b/src/organizers/block_organizer.cpp index 3e43c187..de9ee22c 100644 --- a/src/organizers/block_organizer.cpp +++ b/src/organizers/block_organizer.cpp @@ -218,8 +218,8 @@ void block_organizer::handle_connect(const code& ec, block_const_ptr block, // private // Outgoing blocks must have median_time_past set. void block_organizer::handle_reorganized(const code& ec, - block_const_ptr_list_const_ptr incoming, - block_const_ptr_list_ptr outgoing, result_handler handler) + block_const_ptr_list_const_ptr , + block_const_ptr_list_ptr , result_handler handler) { if (ec) { diff --git a/src/pools/parent_closure_calculator.cpp b/src/pools/parent_closure_calculator.cpp index 629b2312..42cf1e93 100644 --- a/src/pools/parent_closure_calculator.cpp +++ b/src/pools/parent_closure_calculator.cpp @@ -23,7 +23,7 @@ namespace libbitcoin { namespace blockchain { parent_closure_calculator::parent_closure_calculator( - transaction_pool_state& state) + transaction_pool_state& ) { } diff --git a/src/pools/transaction_pool.cpp b/src/pools/transaction_pool.cpp index 7cded2d6..ddee2284 100644 --- a/src/pools/transaction_pool.cpp +++ b/src/pools/transaction_pool.cpp @@ -41,7 +41,7 @@ namespace blockchain { transaction_pool::priority anchor_priority = 0.0; -transaction_pool::transaction_pool(const settings& settings) +transaction_pool::transaction_pool(const settings& ) ////: reject_conflicts_(settings.reject_conflicts), //// minimum_fee_(settings.minimum_fee_satoshis) { @@ -68,7 +68,7 @@ void transaction_pool::fetch_template(merkle_block_fetch_handler handler) const } // TODO: implement mempool message payload discovery. -void transaction_pool::fetch_mempool(size_t maximum, +void transaction_pool::fetch_mempool(size_t , inventory_fetch_handler handler) const { const auto empty = std::make_shared(); diff --git a/src/pools/transaction_pool_state.cpp b/src/pools/transaction_pool_state.cpp index d07263dc..c17ccfd0 100644 --- a/src/pools/transaction_pool_state.cpp +++ b/src/pools/transaction_pool_state.cpp @@ -29,7 +29,7 @@ transaction_pool_state::transaction_pool_state() { } -transaction_pool_state::transaction_pool_state(const settings& settings) +transaction_pool_state::transaction_pool_state(const settings& ) : transaction_pool_state() { } diff --git a/src/settings.cpp b/src/settings.cpp index 87310a0a..cf8f8b54 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -115,20 +115,20 @@ uint32_t settings::enabled_forks() const using namespace machine; uint32_t forks = rule_fork::no_rules; - forks |= (difficult ? rule_fork::difficult : 0); - forks |= (retarget ? rule_fork::retarget : 0); - forks |= (bip16 ? rule_fork::bip16_rule : 0); - forks |= (bip30 ? rule_fork::bip30_rule : 0); - forks |= (bip34 ? rule_fork::bip34_rule : 0); - forks |= (bip66 ? rule_fork::bip66_rule : 0); - forks |= (bip65 ? rule_fork::bip65_rule : 0); - forks |= (bip90 ? rule_fork::bip90_rule : 0); - forks |= (bip68 ? rule_fork::bip68_rule : 0); - forks |= (bip112 ? rule_fork::bip112_rule : 0); - forks |= (bip113 ? rule_fork::bip113_rule : 0); - forks |= (bip141 ? rule_fork::bip141_rule : 0); - forks |= (bip143 ? rule_fork::bip143_rule : 0); - forks |= (bip147 ? rule_fork::bip147_rule : 0); + forks |= (difficult ? static_cast(rule_fork::difficult) : 0); + forks |= (retarget ? static_cast(rule_fork::retarget) : 0); + forks |= (bip16 ? static_cast(rule_fork::bip16_rule) : 0); + forks |= (bip30 ? static_cast(rule_fork::bip30_rule) : 0); + forks |= (bip34 ? static_cast(rule_fork::bip34_rule) : 0); + forks |= (bip66 ? static_cast(rule_fork::bip66_rule) : 0); + forks |= (bip65 ? static_cast(rule_fork::bip65_rule) : 0); + forks |= (bip90 ? static_cast(rule_fork::bip90_rule) : 0); + forks |= (bip68 ? static_cast(rule_fork::bip68_rule) : 0); + forks |= (bip112 ? static_cast(rule_fork::bip112_rule) : 0); + forks |= (bip113 ? static_cast(rule_fork::bip113_rule) : 0); + forks |= (bip141 ? static_cast(rule_fork::bip141_rule) : 0); + forks |= (bip143 ? static_cast(rule_fork::bip143_rule) : 0); + forks |= (bip147 ? static_cast(rule_fork::bip147_rule) : 0); return forks; } diff --git a/src/validate/validate_block.cpp b/src/validate/validate_block.cpp index e25c8b0b..15c0832e 100644 --- a/src/validate/validate_block.cpp +++ b/src/validate/validate_block.cpp @@ -141,7 +141,7 @@ void validate_block::accept(block_const_ptr block, result_handler handler) const { // Populate block state for the next block. - block_populator_.populate(block, + block_populator_.populate(block, std::bind(&validate_block::handle_populated, this, _1, block, handler)); } @@ -225,7 +225,7 @@ void validate_block::accept_transactions(block_const_ptr block, size_t bucket, handler(ec); } -void validate_block::handle_accepted(const code& ec, block_const_ptr block, +void validate_block::handle_accepted(const code& ec, block_const_ptr , atomic_counter_ptr sigops, bool bip141, result_handler handler) const { if (ec) diff --git a/test/safe_chain.cpp b/test/safe_chain.cpp index b6011f56..e348e614 100644 --- a/test/safe_chain.cpp +++ b/test/safe_chain.cpp @@ -349,7 +349,7 @@ BOOST_AUTO_TEST_CASE(block_chain__fetch_locator_block_headers__full__sequential) const size_t limit = 3; const auto threshold = null_hash; const auto locator = std::make_shared(); - BOOST_REQUIRE_EQUAL(fetch_locator_block_headers(instance, locator, null_hash, 3), error::success); + BOOST_REQUIRE_EQUAL(fetch_locator_block_headers(instance, locator, threshold, limit), error::success); } BOOST_AUTO_TEST_CASE(block_chain__fetch_locator_block_headers__limited__sequential) @@ -366,7 +366,7 @@ BOOST_AUTO_TEST_CASE(block_chain__fetch_locator_block_headers__limited__sequenti const size_t limit = 3; const auto threshold = null_hash; const auto locator = std::make_shared(); - BOOST_REQUIRE_EQUAL(fetch_locator_block_headers(instance, locator, null_hash, 2), error::success); + BOOST_REQUIRE_EQUAL(fetch_locator_block_headers(instance, locator, threshold, limit), error::success); } // TODO: fetch_template diff --git a/test/validate_block.cpp b/test/validate_block.cpp index 04b183bb..9dee4365 100644 --- a/test/validate_block.cpp +++ b/test/validate_block.cpp @@ -63,7 +63,7 @@ BOOST_AUTO_TEST_CASE(validate_block__native__block_438513_tx__valid) prevout.set_script(script::factory(decoded_script, false)); BOOST_REQUIRE(prevout.script().is_valid()); - const auto result = validate_input::verify_script(tx, index, 62, libconsensus); + const auto result = validate_input::verify_script(tx, index, forks, libconsensus); BOOST_REQUIRE_EQUAL(result.value(), error::success); }