From eac4f023489b86ff908bc7d3f7f6dfc04bb2d4a4 Mon Sep 17 00:00:00 2001 From: Anthony Fieroni Date: Mon, 6 Jan 2020 20:05:09 +0200 Subject: [PATCH] Fix rebase issues Signed-off-by: Anthony Fieroni --- Makefile.am | 3 - configure.ac | 58 +- depends/Makefile | 2 + src/Makefile.am | 12 +- src/Makefile.bench.include | 1 - src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 4 +- src/Makefile.test.include | 11 +- src/addrdb.cpp | 2 +- src/bench/block_assemble.cpp | 4 +- src/bench/checkblock.cpp | 6 +- src/bloom.cpp | 4 +- src/chainparams.cpp | 21 +- src/claimscriptop.cpp | 1 + src/claimscriptop.h | 12 +- src/claimtrie/blob.cpp | 2 +- src/claimtrie/forks.cpp | 2 +- src/claimtrie/forks.h | 3 +- src/claimtrie/sqlite/hdr/sqlite_modern_cpp.h | 4 +- src/claimtrie/trie.cpp | 22 +- src/claimtrie/trie.h | 18 +- src/claimtrie/txoutpoint.cpp | 10 +- src/claimtrie/txoutpoint.h | 4 +- src/coins.h | 7 +- src/consensus/params.h | 2 - src/consensus/validation.h | 1 + src/core_write.cpp | 2 +- src/crypto/siphash.cpp | 1 + src/index/base.cpp | 371 ++++ src/index/base.h | 117 ++ src/index/blockfilterindex.cpp | 197 +-- src/index/blockfilterindex.h | 2 +- src/init.cpp | 14 +- src/interfaces/chain.cpp | 2 +- src/miner.cpp | 3 +- src/nameclaim.cpp | 8 +- src/nameclaim.h | 10 +- src/net_processing.cpp | 1 + src/protocol.cpp | 14 +- src/qt/bitcoingui.cpp | 6 - src/qt/guiutil.cpp | 3 - src/qt/locale/bitcoin_da.ts | 8 +- src/qt/locale/bitcoin_de.ts | 4 + src/qt/locale/bitcoin_el.ts | 4 - src/qt/locale/bitcoin_es.ts | 4 + src/qt/locale/bitcoin_fi.ts | 12 - src/qt/locale/bitcoin_fr.ts | 4 + src/qt/locale/bitcoin_ja.ts | 12 +- src/qt/locale/bitcoin_ko.ts | 3 + src/qt/locale/bitcoin_nl.ts | 4 + src/qt/locale/bitcoin_pl.ts | 4 + src/qt/locale/bitcoin_pt_BR.ts | 4 + src/qt/locale/bitcoin_ro.ts | 8 - src/qt/locale/bitcoin_sk.ts | 4 + src/qt/locale/bitcoin_uk.ts | 3 + src/qt/locale/bitcoin_zh_TW.ts | 4 + src/rest.cpp | 8 +- src/rpc/claimtrie.cpp | 60 +- src/rpc/mining.cpp | 48 +- src/rpc/misc.cpp | 2 +- src/rpc/rawtransaction.cpp | 9 - src/rpc/server.cpp | 9 + src/rpc/server.h | 14 + src/scheduler.cpp | 2 +- src/script/sign.cpp | 23 +- src/script/sign.h | 3 - src/test/Checkpoints_tests.cpp | 27 - src/test/claimtriebranching_tests.cpp | 15 +- src/test/claimtriecache_tests.cpp | 1 - src/test/claimtrieexpirationfork_tests.cpp | 5 +- src/test/claimtriefixture.cpp | 63 +- src/test/claimtriefixture.h | 24 +- src/test/claimtriehashfork_tests.cpp | 47 +- src/test/claimtrienormalization_tests.cpp | 17 +- src/test/claimtrierpc_tests.cpp | 58 +- src/test/coins_tests.cpp | 2 + src/test/hash_tests.cpp | 1 + src/test/miner_tests.cpp | 10 +- src/test/nameclaim_tests.cpp | 2 +- src/test/script_tests.1cpp | 1665 ++++++++++++++++++ src/test/script_tests.cpp | 22 +- src/test/serialize_tests.cpp | 1 + src/test/setup_common.cpp | 4 +- src/test/sigopcount_tests.cpp | 1 + src/txdb.cpp | 22 +- src/txdb.h | 31 +- src/undo.h | 111 +- src/validation.cpp | 76 +- src/validation.h | 5 +- src/versionbits.cpp | 6 - src/wallet/db.cpp | 38 - src/wallet/db.h | 2 - src/wallet/init.cpp | 1 + src/wallet/ismine.h | 7 +- src/wallet/rpcwallet.cpp | 104 +- src/wallet/test/claim_rpc_tests.cpp | 51 +- src/wallet/test/wallet_tests.cpp | 45 +- src/wallet/wallet.cpp | 23 - src/wallet/wallet.h | 7 +- src/wallet/walletutil.cpp | 11 - src/wallet/walletutil.h | 20 - 101 files changed, 2761 insertions(+), 993 deletions(-) create mode 100644 src/index/base.cpp create mode 100644 src/index/base.h delete mode 100644 src/test/Checkpoints_tests.cpp create mode 100644 src/test/script_tests.1cpp diff --git a/Makefile.am b/Makefile.am index 13836c07d..50e14b934 100644 --- a/Makefile.am +++ b/Makefile.am @@ -175,9 +175,6 @@ $(BITCOIN_CLI_BIN): FORCE $(BITCOIN_TX_BIN): FORCE $(MAKE) -C src $(@F) -$(BITCOIN_TX_BIN): FORCE - $(MAKE) -C src $(@F) - $(BITCOIN_WALLET_BIN): FORCE $(MAKE) -C src $(@F) diff --git a/configure.ac b/configure.ac index 6b90a1443..dcdefd3c7 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ define(_CLIENT_VERSION_RC, 1) define(_COPYRIGHT_YEAR, 2019) define(_COPYRIGHT_HOLDERS,[The %s developers]) define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[LBRYcrd Core]]) -AC_INIT([LBRYcrd Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/lbryio/lbrycrd/issues],[lbrycrd],[https://lbry.com/]) +AC_INIT([LBRYcrd Core],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_REVISION, m4_if(_CLIENT_VERSION_BUILD, [0], [], _CLIENT_VERSION_BUILD))m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/lbryio/lbrycrd/issues],[lbrycrd],[https://lbry.com/]) AC_CONFIG_SRCDIR([src/validation.cpp]) AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) AC_CONFIG_AUX_DIR([build-aux]) @@ -438,23 +438,29 @@ fi CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS" +AC_ARG_WITH([utils], + [AS_HELP_STRING([--with-utils], + [build lbrycrd-cli lbrycrd-tx lbrycrd-wallet (default=yes)])], + [build_lbrycrd_utils=$withval], + [build_lbrycrd_utils=yes]) + AC_ARG_ENABLE([util-cli], [AS_HELP_STRING([--enable-util-cli], [build lbrycrd-cli])], [build_lbrycrd_cli=$enableval], - [build_lbrycrd_cli=$build_bitcoin_utils]) + [build_lbrycrd_cli=$build_lbrycrd_utils]) AC_ARG_ENABLE([util-tx], [AS_HELP_STRING([--enable-util-tx], [build lbrycrd-tx])], [build_lbrycrd_tx=$enableval], - [build_lbrycrd_tx=$build_bitcoin_utils]) + [build_lbrycrd_tx=$build_lbrycrd_utils]) AC_ARG_ENABLE([util-wallet], [AS_HELP_STRING([--enable-util-wallet], [build lbrycrd-wallet])], [build_lbrycrd_wallet=$enableval], - [build_lbrycrd_wallet=$build_bitcoin_utils]) + [build_lbrycrd_wallet=$build_lbrycrd_utils]) AC_ARG_WITH([libs], [AS_HELP_STRING([--with-libs], @@ -511,7 +517,6 @@ case $host in fi CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D_WIN32_WINNT=0x0601" - LEVELDB_TARGET_FLAGS="-DOS_WINDOWS" if test "x$CXXFLAGS_overridden" = "xno"; then CXXFLAGS="$CXXFLAGS -w" fi @@ -533,7 +538,6 @@ case $host in ;; *darwin*) TARGET_OS=darwin - LEVELDB_TARGET_FLAGS="-DOS_MACOSX" if test x$cross_compiling != xyes; then BUILD_OS=darwin AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert) @@ -587,37 +591,8 @@ case $host in CPPFLAGS="$CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0" OBJCXXFLAGS="$CXXFLAGS" ;; - *android*) - dnl make sure android stays above linux for hosts like *linux-android* - LEVELDB_TARGET_FLAGS="-DOS_ANDROID" - ;; *linux*) TARGET_OS=linux - LEVELDB_TARGET_FLAGS="-DOS_LINUX" - ;; - *kfreebsd*) - LEVELDB_TARGET_FLAGS="-DOS_KFREEBSD" - ;; - *freebsd*) - LEVELDB_TARGET_FLAGS="-DOS_FREEBSD" - ;; - *openbsd*) - LEVELDB_TARGET_FLAGS="-DOS_OPENBSD" - ;; - *netbsd*) - LEVELDB_TARGET_FLAGS="-DOS_NETBSD" - ;; - *dragonfly*) - LEVELDB_TARGET_FLAGS="-DOS_DRAGONFLYBSD" - ;; - *solaris*) - LEVELDB_TARGET_FLAGS="-DOS_SOLARIS" - ;; - *hpux*) - LEVELDB_TARGET_FLAGS="-DOS_HPUX" - ;; - *) - AC_MSG_ERROR(Cannot build leveldb for $host. Please file a bug report.) ;; esac @@ -986,18 +961,10 @@ AC_LINK_IFELSE( # Define to 1 if std::system or ::wsystem (Windows) is available AC_DEFINE([HAVE_SYSTEM], [HAVE_STD__SYSTEM || HAVE_WSYSTEM], [std::system or ::wsystem]) -LEVELDB_CPPFLAGS= -LIBLEVELDB= -LIBMEMENV= -AM_CONDITIONAL([EMBEDDED_LEVELDB],[true]) -AC_SUBST(LEVELDB_CPPFLAGS) -AC_SUBST(LIBLEVELDB) -AC_SUBST(LIBMEMENV) - dnl enable-fuzz should disable all other targets if test "x$enable_fuzz" = "xyes"; then AC_MSG_WARN(enable-fuzz will disable all other targets) - build_bitcoin_utils=no + build_lbrycrd_utils=no build_lbrycrd_cli=no build_lbrycrd_tx=no build_lbrycrd_wallet=no @@ -1412,7 +1379,7 @@ if test x$have_protobuf != xno && BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path) fi -AC_MSG_CHECKING([whether to build bitcoind]) +AC_MSG_CHECKING([whether to build lbrycrdd]) AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_lbrycrdd = xyes]) AC_MSG_RESULT($build_lbrycrdd) @@ -1646,7 +1613,6 @@ AC_SUBST(BOOST_LIBS) AC_SUBST(ICU_CPPFLAGS) AC_SUBST(ICU_LIBS) AC_SUBST(TESTDEFS) -AC_SUBST(LEVELDB_TARGET_FLAGS) AC_SUBST(MINIUPNPC_CPPFLAGS) AC_SUBST(MINIUPNPC_LIBS) AC_SUBST(CRYPTO_LIBS) diff --git a/depends/Makefile b/depends/Makefile index 7243cc61e..ec5d16519 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -114,6 +114,8 @@ endif ifeq ($(rapidcheck_packages_),) packages += $(rapidcheck_packages) +endif + all_packages = $(packages) $(native_packages) meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk diff --git a/src/Makefile.am b/src/Makefile.am index 2709780ad..95a7cc887 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -137,6 +137,7 @@ BITCOIN_CORE_H = \ fs.h \ httprpc.h \ httpserver.h \ + index/base.h \ index/blockfilterindex.h \ indirectmap.h \ init.h \ @@ -275,13 +276,13 @@ libbitcoin_server_a_SOURCES = \ flatfile.cpp \ httprpc.cpp \ httpserver.cpp \ + index/base.cpp \ index/blockfilterindex.cpp \ interfaces/chain.cpp \ interfaces/node.cpp \ init.cpp \ lbry.cpp \ miner.cpp \ - nameclaim.cpp \ net.cpp \ net_processing.cpp \ node/coin.cpp \ @@ -309,7 +310,6 @@ libbitcoin_server_a_SOURCES = \ txmempool.cpp \ ui_interface.cpp \ uint256.cpp \ - utilstrencodings.cpp \ validation.cpp \ validationinterface.cpp \ versionbits.cpp \ @@ -362,7 +362,7 @@ libbitcoin_wallet_tool_a_SOURCES = \ $(BITCOIN_CORE_H) # crypto primitives library -crypto_libbitcoin_crypto_base_a_CPPFLAGS = $(AM_CPPFLAGS) +crypto_libbitcoin_crypto_base_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) crypto_libbitcoin_crypto_base_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) crypto_libbitcoin_crypto_base_a_SOURCES = \ crypto/aes.cpp \ @@ -573,7 +573,6 @@ lbrycrdd_LDADD = \ $(LIBBITCOIN_ZMQ) \ $(LIBBITCOIN_CONSENSUS) \ $(LIBBITCOIN_CRYPTO) \ - $(LIBMEMENV) \ $(LIBSECP256K1) lbrycrdd_LDADD += $(BOOST_LIBS) $(LIBCLAIMTRIE) $(BOOST_LOCALE_LIB) $(BDB_LIBS) $(CRYPTO_LIBS) $(ICU_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(ZMQ_LIBS) @@ -630,15 +629,14 @@ endif lbrycrd_wallet_LDADD = \ $(LIBBITCOIN_WALLET_TOOL) \ + $(LIBBITCOIN_SERVER) \ $(LIBBITCOIN_WALLET) \ + $(LIBBITCOIN_SERVER) \ $(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_CONSENSUS) \ $(LIBBITCOIN_UTIL) \ $(LIBBITCOIN_CRYPTO) \ $(LIBBITCOIN_ZMQ) \ - $(LIBLEVELDB) \ - $(LIBLEVELDB_SSE42) \ - $(LIBMEMENV) \ $(LIBSECP256K1) \ $(LIBUNIVALUE) diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include index 13af2dea5..ac9ae9ec1 100644 --- a/src/Makefile.bench.include +++ b/src/Makefile.bench.include @@ -56,7 +56,6 @@ bench_bench_bitcoin_LDADD = \ $(LIBBITCOIN_UTIL) \ $(LIBBITCOIN_CONSENSUS) \ $(LIBBITCOIN_CRYPTO) \ - $(LIBMEMENV) \ $(LIBSECP256K1) \ $(LIBUNIVALUE) \ $(EVENT_PTHREADS_LIBS) \ diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 9beab6c06..7c22a0760 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -334,7 +334,7 @@ endif if ENABLE_ZMQ qt_lbrycrd_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) endif -qt_lbrycrd_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBMEMENV) \ +qt_lbrycrd_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \ $(BOOST_LIBS) $(LIBCLAIMTRIE) $(BOOST_LOCALE_LIB) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(ICU_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \ $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) if ENABLE_BIP70 diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 14c069e2d..50a216443 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -58,7 +58,7 @@ qt_test_test_lbrycrd_qt_SOURCES += \ qt/test/wallettests.cpp \ wallet/test/wallet_test_fixture.cpp if ENABLE_BIP70 -qt_test_test_bitcoin_qt_SOURCES += \ +qt_test_test_lbrycrd_qt_SOURCES += \ qt/test/paymentservertests.cpp endif # ENABLE_BIP70 endif # ENABLE_WALLET @@ -73,7 +73,7 @@ if ENABLE_ZMQ qt_test_test_lbrycrd_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) endif qt_test_test_lbrycrd_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \ - $(LIBMEMENV) $(BOOST_LIBS) $(LIBCLAIMTRIE) $(BOOST_LOCALE_LIB) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ + $(BOOST_LIBS) $(LIBCLAIMTRIE) $(BOOST_LOCALE_LIB) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ $(QR_LIBS) $(PROTOBUF_LIBS) $(ICU_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \ $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) qt_test_test_lbrycrd_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 930e60f8b..ccb2bc054 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -68,15 +68,12 @@ FUZZ_SUITE_LD_COMMON = \ $(LIBBITCOIN_CONSENSUS) \ $(LIBBITCOIN_CRYPTO) \ $(LIBUNIVALUE) \ - $(LIBLEVELDB) \ - $(LIBLEVELDB_SSE42) \ $(BOOST_LIBS) \ - $(LIBMEMENV) \ $(LIBSECP256K1) \ $(EVENT_LIBS) \ $(CRYPTO_LIBS) \ - $(EVENT_PTHREADS_LIBS) - $(LIBCLAIMTRIE) + $(EVENT_PTHREADS_LIBS) \ + $(LIBCLAIMTRIE) \ $(BOOST_LOCALE_LIB) # test_bitcoin binary # @@ -96,7 +93,6 @@ BITCOIN_TESTS =\ test/blockfilter_tests.cpp \ test/blockfilter_index_tests.cpp \ test/bloom_tests.cpp \ - test/Checkpoints_tests.cpp \ test/bswap_tests.cpp \ test/checkqueue_tests.cpp \ test/coins_tests.cpp \ @@ -173,7 +169,6 @@ if ENABLE_WALLET BITCOIN_TESTS += \ wallet/test/db_tests.cpp \ wallet/test/claim_rpc_tests.cpp \ - wallet/test/db_tests.cpp \ wallet/test/psbt_wallet_tests.cpp \ wallet/test/wallet_tests.cpp \ wallet/test/wallet_crypto_tests.cpp \ @@ -196,7 +191,7 @@ test_test_lbrycrd_LDADD += $(LIBBITCOIN_WALLET) endif test_test_lbrycrd_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \ - $(LIBMEMENV) $(BOOST_LIBS) $(LIBCLAIMTRIE) $(BOOST_LOCALE_LIB) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS) + $(BOOST_LIBS) $(LIBCLAIMTRIE) $(BOOST_LOCALE_LIB) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS) test_test_lbrycrd_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) test_test_lbrycrd_LDADD += $(BDB_LIBS) $(CRYPTO_LIBS) $(ICU_LIBS) $(MINIUPNPC_LIBS) $(RAPIDCHECK_LIBS) diff --git a/src/addrdb.cpp b/src/addrdb.cpp index 5993f96aa..db936486b 100644 --- a/src/addrdb.cpp +++ b/src/addrdb.cpp @@ -110,7 +110,7 @@ bool DeserializeFileDB(const fs::path& path, Data& data) FILE *file = fsbridge::fopen(path, "rb"); CAutoFile filein(file, SER_DISK, CLIENT_VERSION); if (filein.IsNull()) - return false; + return error("%s: Failed to open file %s", __func__, path.string()); return DeserializeDB(filein, data); } diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp index f0fe898ed..089f9af5e 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -3,13 +3,13 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include #include #include #include -#include #include - +#include #include #include diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp index ce52906e9..c53afa37c 100644 --- a/src/bench/checkblock.cpp +++ b/src/bench/checkblock.cpp @@ -58,22 +58,24 @@ CDataStream getTestBlockStream() static void DeserializeBlockTest(benchmark::State& state) { auto stream = getTestBlockStream(); + auto size = stream.size() - 1; while (state.KeepRunning()) { CBlock block; stream >> block; - assert(stream.Rewind(block.size())); + assert(stream.Rewind(size)); } } static void DeserializeAndCheckBlockTest(benchmark::State& state) { auto stream = getTestBlockStream(); + auto size = stream.size() - 1; const auto chainParams = CreateChainParams(CBaseChainParams::REGTEST); while (state.KeepRunning()) { CBlock block; // Note that CBlock caches its checked state, so we need to recreate it here stream >> block; - assert(stream.Rewind(block.size())); + assert(stream.Rewind(size)); CValidationState validationState; bool checked = CheckBlock(block, validationState, chainParams->GetConsensus()); diff --git a/src/bloom.cpp b/src/bloom.cpp index a59bfeaba..a06192508 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -3,7 +3,6 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include -#include #include #include @@ -156,8 +155,7 @@ bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx) else if ((nFlags & BLOOM_UPDATE_MASK) == BLOOM_UPDATE_P2PUBKEY_ONLY) { std::vector > vSolutions; - const CScript& scriptPubKey = txout.scriptPubKey; - txnouttype type = Solver(scriptPubKey, vSolutions); + txnouttype type = Solver(txout.scriptPubKey, vSolutions); if (type == TX_PUBKEY || type == TX_MULTISIG) { insert(COutPoint(hash, i)); } diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 5a1af7619..de1be5b62 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include #include - #include #include #include @@ -125,9 +125,9 @@ public: consensus.BIP66Height = 200000; consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.nPowTargetTimespan = 150; //retarget every block - consensus.CSVHeight = 419328; // 000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5 - consensus.SegwitHeight = 481824; // 0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893 - consensus.MinBIP9WarningHeight = 483840; // segwit activation height + miner confirmation window + consensus.CSVHeight = 200000; + consensus.SegwitHeight = 680770; + consensus.MinBIP9WarningHeight = 682786; // segwit activation height + miner confirmation window consensus.nPowTargetSpacing = 150; consensus.nOriginalClaimExpirationTime = 262974; consensus.nExtendedClaimExpirationTime = 2102400; @@ -137,7 +137,6 @@ public: consensus.nNormalizedNameForkHeight = 539940; // targeting 21 March 2019 consensus.nMinRemovalWorkaroundHeight = 297706; consensus.nMaxRemovalWorkaroundHeight = 100000000; - consensus.nWitnessForkHeight = 680770; // targeting 11 Dec 2019 consensus.nAllClaimsInMerkleForkHeight = 658310; // targeting 30 Oct 2019 consensus.fPowAllowMinDifficultyBlocks = false; consensus.fPowNoRetargeting = false; @@ -236,9 +235,9 @@ public: consensus.BIP66Height = 1200000; consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.nPowTargetTimespan = 150; - consensus.CSVHeight = 770112; // 00000000025e930139bac5c6c31a403776da130831ab85be56578f3fa75369bb - consensus.SegwitHeight = 834624; // 00000000002b980fcd729daaa248fd9316a5200e9b367f4ff2c42453e84201ca - consensus.MinBIP9WarningHeight = 836640; // segwit activation height + miner confirmation window + consensus.CSVHeight = 1200000; + consensus.SegwitHeight = 1198600; + consensus.MinBIP9WarningHeight = 1200616; // segwit activation height + miner confirmation window consensus.nPowTargetSpacing = 150; consensus.nOriginalClaimExpirationTime = 262974; consensus.nExtendedClaimExpirationTime = 2102400; @@ -248,7 +247,6 @@ public: consensus.nNormalizedNameForkHeight = 993380; // targeting, 21 Feb 2019 consensus.nMinRemovalWorkaroundHeight = 99; consensus.nMaxRemovalWorkaroundHeight = 100000000; - consensus.nWitnessForkHeight = 1198600; consensus.nAllClaimsInMerkleForkHeight = 1198560; // targeting 30 Sep 2019 consensus.fPowAllowMinDifficultyBlocks = true; consensus.fPowNoRetargeting = false; @@ -334,8 +332,8 @@ public: consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests) consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests) consensus.CSVHeight = 432; // CSV activated on regtest (Used in rpc activation tests) - consensus.SegwitHeight = 0; // SEGWIT is always activated on regtest unless overridden - consensus.MinBIP9WarningHeight = 0; + consensus.SegwitHeight = 150; // SEGWIT is always activated on regtest unless overridden + consensus.MinBIP9WarningHeight = 294; consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); consensus.nPowTargetTimespan = 1;//14 * 24 * 60 * 60; // two weeks consensus.nPowTargetSpacing = 1; @@ -347,7 +345,6 @@ public: consensus.nNormalizedNameForkHeight = 250; // SDK depends upon this number consensus.nMinRemovalWorkaroundHeight = -1; consensus.nMaxRemovalWorkaroundHeight = -1; - consensus.nWitnessForkHeight = 150; consensus.nAllClaimsInMerkleForkHeight = 350; consensus.fPowAllowMinDifficultyBlocks = false; consensus.fPowNoRetargeting = false; diff --git a/src/claimscriptop.cpp b/src/claimscriptop.cpp index 62d8db381..cea777ab3 100644 --- a/src/claimscriptop.cpp +++ b/src/claimscriptop.cpp @@ -4,6 +4,7 @@ #include #include +#include #include CClaimScriptAddOp::CClaimScriptAddOp(const COutPoint& point, CAmount nValue, int nHeight) diff --git a/src/claimscriptop.h b/src/claimscriptop.h index 915ff1dc0..ff9e9424d 100644 --- a/src/claimscriptop.h +++ b/src/claimscriptop.h @@ -5,13 +5,11 @@ #ifndef CLAIMSCRIPTOP_H #define CLAIMSCRIPTOP_H -#include "amount.h" -#include "claimtrie/forks.h" -#include "hash.h" -#include "primitives/transaction.h" -#include "script/script.h" -#include "uint256.h" -#include "util.h" +#include +#include +#include +#include +#include