diff --git a/Makefile.am b/Makefile.am index 6ba6e7b0a..ceb252227 100644 --- a/Makefile.am +++ b/Makefile.am @@ -181,7 +181,7 @@ baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtere test_bitcoin.info: baseline_filtered_combined.info $(MAKE) -C src/ check - $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@ + $(LCOV) -c -d $(abs_builddir)/src -t test_blackmore -o $@ $(LCOV) -z -d $(abs_builddir)/src $(LCOV) -z -d $(abs_builddir)/src/leveldb diff --git a/contrib/debian/changelog b/contrib/debian/changelog index 110bfe03e..1571934ca 100644 --- a/contrib/debian/changelog +++ b/contrib/debian/changelog @@ -218,7 +218,7 @@ bitcoin (0.5.0~rc3-natty0) natty; urgency=low bitcoin (0.5.0~rc1-natty1) natty; urgency=low - * Add test_bitcoin to build test + * Add test_blackmore to build test * Fix clean * Remove unnecessary build-dependancies diff --git a/contrib/debian/rules b/contrib/debian/rules index 52b357cf0..fee064649 100755 --- a/contrib/debian/rules +++ b/contrib/debian/rules @@ -1,9 +1,9 @@ #!/usr/bin/make -f # -*- mode: makefile; coding: utf-8 -*- -#DEB_MAKE_CHECK_TARGET = test_bitcoin -#build/bitcoind:: -# $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,src/test_bitcoin) +#DEB_MAKE_CHECK_TARGET = test_blackmore +#build/blackmored:: +# $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,src/test_blackmore) DEB_INSTALL_EXAMPLES_bitcoind += debian/examples/* DEB_INSTALL_MANPAGES_bitcoind += debian/manpages/* diff --git a/contrib/devtools/README.md b/contrib/devtools/README.md index 60fe69e7e..dd1d1f796 100644 --- a/contrib/devtools/README.md +++ b/contrib/devtools/README.md @@ -123,10 +123,10 @@ If only supported symbols are used the return value will be 0 and the output wil If there are 'unsupported' symbols, the return value will be 1 a list like this will be printed: - .../64/test_bitcoin: symbol memcpy from unsupported version GLIBC_2.14 - .../64/test_bitcoin: symbol __fdelt_chk from unsupported version GLIBC_2.15 - .../64/test_bitcoin: symbol std::out_of_range::~out_of_range() from unsupported version GLIBCXX_3.4.15 - .../64/test_bitcoin: symbol _ZNSt8__detail15_List_nod from unsupported version GLIBCXX_3.4.15 + .../64/test_blackmore: symbol memcpy from unsupported version GLIBC_2.14 + .../64/test_blackmore: symbol __fdelt_chk from unsupported version GLIBC_2.15 + .../64/test_blackmore: symbol std::out_of_range::~out_of_range() from unsupported version GLIBCXX_3.4.15 + .../64/test_blackmore: symbol _ZNSt8__detail15_List_nod from unsupported version GLIBCXX_3.4.15 update-translations.py ====================== diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index ef64891eb..87850f4f8 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -34,7 +34,7 @@ files: - "MacOSX10.11.sdk.tar.gz" script: | WRAP_DIR=$HOME/wrapped - HOSTS="x86_64-apple-darwin14" + HOSTS="x86_64-apple-darwin16" CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage" FAKETIME_HOST_PROGS="" FAKETIME_PROGS="ar ranlib date dmg genisoimage" diff --git a/contrib/rpm/bitcoin.spec b/contrib/rpm/bitcoin.spec index 38ae03818..eade1ecdf 100644 --- a/contrib/rpm/bitcoin.spec +++ b/contrib/rpm/bitcoin.spec @@ -34,7 +34,7 @@ Source23: https://raw.githubusercontent.com/bitcoin/bitcoin/v%{version}/contrib/ #selinux Source30: https://raw.githubusercontent.com/bitcoin/bitcoin/v%{version}/contrib/rpm/bitcoin.te -# Source31 - what about bitcoin-tx and bench_bitcoin ??? +# Source31 - what about bitcoin-tx and bench_blackmore ??? Source31: https://raw.githubusercontent.com/bitcoin/bitcoin/v%{version}/contrib/rpm/bitcoin.fc Source32: https://raw.githubusercontent.com/bitcoin/bitcoin/v%{version}/contrib/rpm/bitcoin.if @@ -142,9 +142,9 @@ Group: Applications/System This package provides several command line utilities for interacting with a bitcoin-core daemon. -The bitcoin-cli utility allows you to communicate and control a bitcoin daemon +The blackmore-cli utility allows you to communicate and control a bitcoin daemon over RPC, the bitcoin-tx utility allows you to create a custom transaction, and -the bench_bitcoin utility can be used to perform some benchmarks. +the bench_blackmore utility can be used to perform some benchmarks. This package contains utilities needed by the bitcoin-server package. @@ -423,7 +423,7 @@ rm -rf %{buildroot} %doc COPYING bitcoin.conf.example doc/README.md %attr(0755,root,root) %{_bindir}/bitcoin-cli %attr(0755,root,root) %{_bindir}/bitcoin-tx -%attr(0755,root,root) %{_bindir}/bench_bitcoin +%attr(0755,root,root) %{_bindir}/bench_blackmore %attr(0644,root,root) %{_mandir}/man1/bitcoin-cli.1* %attr(0644,root,root) %{_mandir}/man5/bitcoin.conf.5* diff --git a/depends/README.md b/depends/README.md index f37181ca8..240e66805 100644 --- a/depends/README.md +++ b/depends/README.md @@ -72,7 +72,7 @@ For linux RISC-V 64-bit cross compilation (there are no packages for 32-bit): sudo apt-get install g++-riscv64-linux-gnu binutils-riscv64-linux-gnu -RISC-V known issue: gcc-7.3.0 and gcc-7.3.1 result in a broken `test_bitcoin` executable (see https://github.com/bitcoin/bitcoin/pull/13543), +RISC-V known issue: gcc-7.3.0 and gcc-7.3.1 result in a broken `test_blackmore` executable (see https://github.com/bitcoin/bitcoin/pull/13543), this is apparently fixed in gcc-8.1.0. For linux S390X cross compilation: diff --git a/doc/benchmarking.md b/doc/benchmarking.md index 0ba75afcd..bd8354c1e 100644 --- a/doc/benchmarking.md +++ b/doc/benchmarking.md @@ -5,7 +5,7 @@ Bitcoin Core has an internal benchmarking framework, with benchmarks for cryptographic algorithms such as SHA1, SHA256, SHA512 and RIPEMD160. As well as the rolling bloom filter. After compiling bitcoin-core, the benchmarks can be run with: -`src/bench/bench_bitcoin` +`src/bench/bench_blackmore` The output will look similar to: ``` diff --git a/doc/build-openbsd.md b/doc/build-openbsd.md index 542bc5c8a..5a359ae40 100644 --- a/doc/build-openbsd.md +++ b/doc/build-openbsd.md @@ -35,7 +35,7 @@ This compiler will not overwrite the system compiler, it will be installed as `e Do not use `pkg_add boost`! The boost version installed thus is compiled using the `g++` compiler not `eg++`, which will result in a conflict between `/usr/local/lib/libestdc++.so.XX.0` and `/usr/lib/libstdc++.so.XX.0`, resulting in a test crash: - test_bitcoin:/usr/lib/libstdc++.so.57.0: /usr/local/lib/libestdc++.so.17.0 : WARNING: symbol(_ZN11__gnu_debug17_S_debug_me ssagesE) size mismatch, relink your program + test_blackmore:/usr/lib/libstdc++.so.57.0: /usr/local/lib/libestdc++.so.17.0 : WARNING: symbol(_ZN11__gnu_debug17_S_debug_me ssagesE) size mismatch, relink your program ... Segmentation fault (core dumped) diff --git a/doc/release-notes/release-notes-0.13.1.md b/doc/release-notes/release-notes-0.13.1.md index 75c2d61be..7e4e7f990 100644 --- a/doc/release-notes/release-notes-0.13.1.md +++ b/doc/release-notes/release-notes-0.13.1.md @@ -281,7 +281,7 @@ git merge commit are mentioned. ### Build system - #8293 `fa5b249` Allow building libbitcoinconsensus without any univalue (luke-jr) -- #8492 `8b0bdd3` Allow building bench_bitcoin by itself (luke-jr) +- #8492 `8b0bdd3` Allow building bench_blackmore by itself (luke-jr) - #8563 `147003c` Add configure check for -latomic (ajtowns) - #8626 `ea51b0f` Berkeley DB v6 compatibility fix (netsafe) - #8520 `75f2065` Remove check for `openssl/ec.h` (laanwj) diff --git a/doc/unit-tests.md b/doc/unit-tests.md index afaece829..648695f91 100644 --- a/doc/unit-tests.md +++ b/doc/unit-tests.md @@ -6,13 +6,13 @@ and tests weren't explicitly disabled. After configuring, they can be run with `make check`. -To run the bitcoind tests manually, launch `src/test/test_bitcoin`. +To run the blackmored tests manually, launch `src/test/test_blackmore`. To add more bitcoind tests, add `BOOST_AUTO_TEST_CASE` functions to the existing .cpp files in the `test/` directory or add new .cpp files that implement new BOOST_AUTO_TEST_SUITE sections. -To run the bitcoin-qt tests manually, launch `src/qt/test/test_bitcoin-qt` +To run the blackmore-qt tests manually, launch `src/qt/test/test_blackmore-qt` -To add more bitcoin-qt tests, add them to the `src/qt/test/` directory and +To add more blackmore-qt tests, add them to the `src/qt/test/` directory and the `src/qt/test/test_main.cpp` file. diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include index 39c488cc6..4b4b1c10b 100644 --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -2,12 +2,12 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -bin_PROGRAMS += bench/bench_bitcoin +bin_PROGRAMS += bench/bench_blackmore BENCH_SRCDIR = bench -BENCH_BINARY = bench/bench_bitcoin$(EXEEXT) +BENCH_BINARY = bench/bench_blackmore$(EXEEXT) -bench_bench_bitcoin_SOURCES = \ +bench_bench_blackmore_SOURCES = \ bench/bench_bitcoin.cpp \ bench/bench.cpp \ bench/bench.h \ @@ -19,9 +19,9 @@ bench_bench_bitcoin_SOURCES = \ bench/mempool_eviction.cpp \ bench/base58.cpp -bench_bench_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CLFAGS) $(EVENT_PTHREADS_CFLAGS) -I$(builddir)/bench/ -bench_bench_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -bench_bench_bitcoin_LDADD = \ +bench_bench_blackmore_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CLFAGS) $(EVENT_PTHREADS_CFLAGS) -I$(builddir)/bench/ +bench_bench_blackmore_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) +bench_bench_blackmore_LDADD = \ $(LIBBITCOIN_SERVER) \ $(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_UTIL) \ @@ -33,16 +33,16 @@ bench_bench_bitcoin_LDADD = \ $(LIBUNIVALUE) if ENABLE_ZMQ -bench_bench_bitcoin_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) +bench_bench_blackmore_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) endif if ENABLE_WALLET -bench_bench_bitcoin_SOURCES += bench/coin_selection.cpp -bench_bench_bitcoin_LDADD += $(LIBBITCOIN_WALLET) $(LIBBITCOIN_CRYPTO) +bench_bench_blackmore_SOURCES += bench/coin_selection.cpp +bench_bench_blackmore_LDADD += $(LIBBITCOIN_WALLET) $(LIBBITCOIN_CRYPTO) endif -bench_bench_bitcoin_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) -bench_bench_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +bench_bench_blackmore_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) +bench_bench_blackmore_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) CLEAN_BITCOIN_BENCH = bench/*.gcda bench/*.gcno @@ -54,7 +54,7 @@ bench: $(BENCH_BINARY) FORCE $(BENCH_BINARY) bitcoin_bench_clean : FORCE - rm -f $(CLEAN_BITCOIN_BENCH) $(bench_bench_bitcoin_OBJECTS) $(BENCH_BINARY) + rm -f $(CLEAN_BITCOIN_BENCH) $(bench_bench_blackmore_OBJECTS) $(BENCH_BINARY) %.raw.h: %.raw @$(MKDIR_P) $(@D) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 7c172f99d..655811534 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -2,8 +2,8 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -bin_PROGRAMS += qt/test/test_bitcoin-qt -TESTS += qt/test/test_bitcoin-qt +bin_PROGRAMS += qt/test/test_blackmore-qt +TESTS += qt/test/test_blackmore-qt TEST_QT_MOC_CPP = \ qt/test/moc_bitcoinaddressvalidatortests.cpp \ @@ -25,10 +25,10 @@ TEST_QT_H = \ qt/test/paymentrequestdata.h \ qt/test/paymentservertests.h -qt_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ +qt_test_test_blackmore_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ $(QT_INCLUDES) $(QT_TEST_INCLUDES) $(PROTOBUF_CFLAGS) -qt_test_test_bitcoin_qt_SOURCES = \ +qt_test_test_blackmore_qt_SOURCES = \ qt/test/bitcoinaddressvalidatortests.cpp \ qt/test/compattests.cpp \ qt/test/guiutiltests.cpp \ @@ -37,34 +37,34 @@ qt_test_test_bitcoin_qt_SOURCES = \ qt/test/uritests.cpp \ $(TEST_QT_H) if ENABLE_WALLET -qt_test_test_bitcoin_qt_SOURCES += \ +qt_test_test_blackmore_qt_SOURCES += \ qt/test/paymentservertests.cpp endif -nodist_qt_test_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP) +nodist_qt_test_test_blackmore_qt_SOURCES = $(TEST_QT_MOC_CPP) -qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) +qt_test_test_blackmore_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) if ENABLE_WALLET -qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) +qt_test_test_blackmore_qt_LDADD += $(LIBBITCOIN_WALLET) endif if ENABLE_ZMQ -qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) +qt_test_test_blackmore_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) endif -qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \ +qt_test_test_blackmore_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \ $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) -qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -qt_test_test_bitcoin_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS) +qt_test_test_blackmore_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +qt_test_test_blackmore_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS) CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno CLEANFILES += $(CLEAN_BITCOIN_QT_TEST) -test_bitcoin_qt : qt/test/test_bitcoin-qt$(EXEEXT) +test_blackmore_qt : qt/test/test_blackmore-qt$(EXEEXT) -test_bitcoin_qt_check : qt/test/test_bitcoin-qt$(EXEEXT) FORCE +test_blackmore_qt_check : qt/test/test_blackmore-qt$(EXEEXT) FORCE $(MAKE) check-TESTS TESTS=$^ -test_bitcoin_qt_clean: FORCE - rm -f $(CLEAN_BITCOIN_QT_TEST) $(qt_test_test_bitcoin_qt_OBJECTS) +test_blackmore_qt_clean: FORCE + rm -f $(CLEAN_BITCOIN_QT_TEST) $(qt_test_test_blackmore_qt_OBJECTS) diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 31fb05e09..cfb519b3a 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -2,10 +2,10 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -TESTS += test/test_bitcoin -bin_PROGRAMS += test/test_bitcoin +TESTS += test/test_blackmore +bin_PROGRAMS += test/test_blackmore TEST_SRCDIR = test -TEST_BINARY=test/test_bitcoin$(EXEEXT) +TEST_BINARY=test/test_blackmore$(EXEEXT) EXTRA_DIST += \ @@ -106,23 +106,23 @@ BITCOIN_TESTS += \ wallet/test/rpc_wallet_tests.cpp endif -test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) -test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) -test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ +test_test_blackmore_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) +test_test_blackmore_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) +test_test_blackmore_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) -test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) +test_test_blackmore_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) if ENABLE_WALLET -test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) +test_test_blackmore_LDADD += $(LIBBITCOIN_WALLET) endif -test_test_bitcoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) -test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static +test_test_blackmore_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) +test_test_blackmore_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static if ENABLE_ZMQ -test_test_bitcoin_LDADD += $(ZMQ_LIBS) +test_test_blackmore_LDADD += $(ZMQ_LIBS) endif -nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) +nodist_test_test_blackmore_SOURCES = $(GENERATED_TEST_FILES) $(BITCOIN_TESTS): $(GENERATED_TEST_FILES) @@ -139,7 +139,7 @@ bitcoin_test_check: $(TEST_BINARY) FORCE $(MAKE) check-TESTS TESTS=$^ bitcoin_test_clean : FORCE - rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY) + rm -f $(CLEAN_BITCOIN_TEST) $(test_test_blackmore_OBJECTS) $(TEST_BINARY) check-local: @echo "Running test/bitcoin-util-test.py..." diff --git a/src/bench/.gitignore b/src/bench/.gitignore index 32c037022..fcbc0d6ff 100644 --- a/src/bench/.gitignore +++ b/src/bench/.gitignore @@ -1,2 +1 @@ -bench_blackmore -bench_bitcoin \ No newline at end of file +bench_blackmore \ No newline at end of file diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h index 0802129b1..9f1638b86 100644 --- a/src/consensus/consensus.h +++ b/src/consensus/consensus.h @@ -17,7 +17,11 @@ static const int STAKE_MIN_CONFIRMATIONS = 500; /** Flags for nSequence and nLockTime locks */ enum { + /* Interpret sequence numbers as relative lock-time constraints. */ + LOCKTIME_VERIFY_SEQUENCE = (1 << 0), + /* Use GetMedianTimePast() instead of nTime for end point timestamp. */ + LOCKTIME_MEDIAN_TIME_PAST = (1 << 1), }; #endif // BITCOIN_CONSENSUS_CONSENSUS_H diff --git a/src/consensus/merkle.cpp b/src/consensus/merkle.cpp index 22eb7159a..7035dd6d0 100644 --- a/src/consensus/merkle.cpp +++ b/src/consensus/merkle.cpp @@ -2,9 +2,9 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "merkle.h" -#include "hash.h" -#include "utilstrencodings.h" +#include +#include +#include /* WARNING! If you're reading this because you're learning about crypto and/or designing a new system that will use merkle trees, keep in mind @@ -101,7 +101,7 @@ static void MerkleComputation(const std::vector& leaves, uint256* proot bool matchh = matchlevel == level; while (count != (((uint32_t)1) << level)) { // If we reach this point, h is an inner value that is not the top. - // We combine it with itself (Bitcoin's special rule for odd levels in + // We combine it with itself (Blackcoin's special rule for odd levels in // the tree) to produce a higher level one. if (pbranch && matchh) { pbranch->push_back(h); @@ -132,13 +132,13 @@ static void MerkleComputation(const std::vector& leaves, uint256* proot uint256 ComputeMerkleRoot(const std::vector& leaves, bool* mutated) { uint256 hash; - MerkleComputation(leaves, &hash, mutated, -1, NULL); + MerkleComputation(leaves, &hash, mutated, -1, nullptr); return hash; } std::vector ComputeMerkleBranch(const std::vector& leaves, uint32_t position) { std::vector ret; - MerkleComputation(leaves, NULL, NULL, position, &ret); + MerkleComputation(leaves, nullptr, nullptr, position, &ret); return ret; } diff --git a/src/consensus/merkle.h b/src/consensus/merkle.h index 6ef59745a..437f29ef4 100644 --- a/src/consensus/merkle.h +++ b/src/consensus/merkle.h @@ -8,9 +8,9 @@ #include #include -#include "primitives/transaction.h" -#include "primitives/block.h" -#include "uint256.h" +#include +#include +#include uint256 ComputeMerkleRoot(const std::vector& leaves, bool* mutated = NULL); std::vector ComputeMerkleBranch(const std::vector& leaves, uint32_t position); diff --git a/src/consensus/params.h b/src/consensus/params.h index bc3d7c75d..0313b6573 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -6,7 +6,8 @@ #ifndef BITCOIN_CONSENSUS_PARAMS_H #define BITCOIN_CONSENSUS_PARAMS_H -#include "uint256.h" +#include +#include #include #include diff --git a/src/consensus/validation.h b/src/consensus/validation.h index 7c5acb59f..d7e57f5b5 100644 --- a/src/consensus/validation.h +++ b/src/consensus/validation.h @@ -22,9 +22,9 @@ static const unsigned char REJECT_CHECKPOINT = 0x43; class CValidationState { private: enum mode_state { - MODE_VALID, //!< everything ok - MODE_INVALID, //!< network rule violation (DoS value may be set) - MODE_ERROR, //!< run-time error + MODE_VALID, //! everything ok + MODE_INVALID, //! network rule violation (DoS value may be set) + MODE_ERROR, //! run-time error } mode; int nDoS; std::string strRejectReason; diff --git a/src/qt/test/rpcnestedtests.cpp b/src/qt/test/rpcnestedtests.cpp index 3dae33baf..fa67c8c37 100644 --- a/src/qt/test/rpcnestedtests.cpp +++ b/src/qt/test/rpcnestedtests.cpp @@ -27,7 +27,7 @@ void RPCNestedTests::rpcNestedTests() const CChainParams& chainparams = Params(); RegisterAllCoreRPCCommands(tableRPC); ClearDatadirCache(); - std::string path = QDir::tempPath().toStdString() + "/" + strprintf("test_bitcoin_qt_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); + std::string path = QDir::tempPath().toStdString() + "/" + strprintf("test_blackmore_qt_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); QDir dir(QString::fromStdString(path)); dir.mkpath("."); mapArgs["-datadir"] = path; diff --git a/src/test/README.md b/src/test/README.md index 61462642b..8e72fdb64 100644 --- a/src/test/README.md +++ b/src/test/README.md @@ -5,7 +5,7 @@ sense to simply use this framework rather than require developers to configure some other framework (we want as few impediments to creating unit tests as possible). -The build system is setup to compile an executable called `test_bitcoin` +The build system is setup to compile an executable called `test_blackmore` that runs all of the unit tests. The main source file is called test_bitcoin.cpp. To add a new unit test file to our test suite you need to add the file to `src/Makefile.test.include`. The pattern is to create @@ -19,14 +19,14 @@ For further reading, I found the following website to be helpful in explaining how the boost unit test framework works: [http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/](http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/). -test_bitcoin has some built-in command-line arguments; for +test_blackmore has some built-in command-line arguments; for example, to run just the getarg_tests verbosely: - test_bitcoin --log_level=all --run_test=getarg_tests + test_blackmore --log_level=all --run_test=getarg_tests ... or to run just the doubledash test: - test_bitcoin --run_test=getarg_tests/doubledash + test_blackmore --run_test=getarg_tests/doubledash -Run `test_bitcoin --help` for the full list. +Run `test_blackmore --help` for the full list. diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index 042fad42d..0141e2033 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -497,7 +497,7 @@ BOOST_AUTO_TEST_CASE(rolling_bloom) if (rb1.contains(RandomData())) ++nHits; } - // Run test_bitcoin with --log_level=message to see BOOST_TEST_MESSAGEs: + // Run test_blackmore with --log_level=message to see BOOST_TEST_MESSAGEs: BOOST_TEST_MESSAGE("RollingBloomFilter got " << nHits << " false positives (~100 expected)"); // Insanely unlikely to get a fp count outside this range: diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 3dd02fd05..f161412d5 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -53,7 +53,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha // instead of unit tests, but for now we need these here. RegisterAllCoreRPCCommands(tableRPC); ClearDatadirCache(); - pathTemp = GetTempPath() / strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); + pathTemp = GetTempPath() / strprintf("test_blackmore_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); boost::filesystem::create_directories(pathTemp); mapArgs["-datadir"] = pathTemp.string(); mempool.setSanityCheck(1.0);