From 16641e1b1afa3e116e7ece58d48fdd0c8863831e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 31 Mar 2017 12:57:22 +0200 Subject: [PATCH 01/29] Merge #10095: refactor: Move GetDifficulty out of `rpc/server.h` f885b67 refactor: Make rest.cpp dependency on `*toJSON` in `blockchain.cpp` explicit (Wladimir J. van der Laan) 8d8f28d refactor: Move RPCNotifyBlockChange out of `rpc/server.h` (Wladimir J. van der Laan) e6dcfee refactor: Move GetDifficulty out of `rpc/server.h` (Wladimir J. van der Laan) Tree-SHA512: fc2656611d18442f2fddba5ac1554d958151f6785c2039afdfc36735d7e71592d9686ff6cc7b2ad95180071d7514470e62c52d697c5a1e88f851bddaf5942edb --- src/Makefile.am | 1 + src/init.cpp | 1 + src/rest.cpp | 10 ++++------ src/rpc/blockchain.cpp | 13 ++++--------- src/rpc/blockchain.h | 40 ++++++++++++++++++++++++++++++++++++++++ src/rpc/mining.cpp | 1 + src/rpc/misc.cpp | 1 + src/rpc/server.h | 2 -- 8 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 src/rpc/blockchain.h diff --git a/src/Makefile.am b/src/Makefile.am index de6b93991f..060b9ddc98 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -199,6 +199,7 @@ BITCOIN_CORE_H = \ protocol.h \ random.h \ reverselock.h \ + rpc/blockchain.h \ rpc/client.h \ rpc/protocol.h \ rpc/server.h \ diff --git a/src/init.cpp b/src/init.cpp index 6510121562..71f1ce0e66 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -29,6 +29,7 @@ #include "policy/policy.h" #include "rpc/server.h" #include "rpc/register.h" +#include "rpc/blockchain.h" #include "script/standard.h" #include "script/sigcache.h" #include "scheduler.h" diff --git a/src/rest.cpp b/src/rest.cpp index c5a8c184a4..57c1725791 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -9,6 +9,7 @@ #include "primitives/transaction.h" #include "validation.h" #include "httpserver.h" +#include "rpc/blockchain.h" #include "rpc/server.h" #include "streams.h" #include "sync.h" @@ -58,12 +59,9 @@ struct CCoin { } }; -extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry); -extern UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false); -extern UniValue mempoolInfoToJSON(); -extern UniValue mempoolToJSON(bool fVerbose = false); -extern void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex); -extern UniValue blockheaderToJSON(const CBlockIndex* blockindex); +/* Defined in rawtransaction.cpp */ +void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry); +void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex); static bool RESTERR(HTTPRequest* req, enum HTTPStatusCode status, std::string message) { diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index d08d518108..dad858c779 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -4,6 +4,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include "rpc/blockchain.h" + #include "amount.h" #include "chain.h" #include "chainparams.h" @@ -52,13 +54,6 @@ static CUpdatedBlock latestblock; extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry); void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex); -/** - * Get the difficulty of the net wrt to the given block index, or the chain tip if - * not provided. - * - * @return A floating point number that is a multiple of the main net minimum - * difficulty (4295032833 hashes). - */ double GetDifficulty(const CBlockIndex* blockindex) { if (blockindex == NULL) @@ -119,7 +114,7 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex) return result; } -UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false) +UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails) { UniValue result(UniValue::VOBJ); result.push_back(Pair("hash", blockindex->GetBlockHash().GetHex())); @@ -409,7 +404,7 @@ void entryToJSON(UniValue &info, const CTxMemPoolEntry &e) info.push_back(Pair("instantlock", instantsend.IsLockedInstantSendTransaction(tx.GetHash()) || llmq::quorumInstantSendManager->IsLocked(tx.GetHash()))); } -UniValue mempoolToJSON(bool fVerbose = false) +UniValue mempoolToJSON(bool fVerbose) { if (fVerbose) { diff --git a/src/rpc/blockchain.h b/src/rpc/blockchain.h new file mode 100644 index 0000000000..c021441b0a --- /dev/null +++ b/src/rpc/blockchain.h @@ -0,0 +1,40 @@ +// Copyright (c) 2017 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_RPC_BLOCKCHAIN_H +#define BITCOIN_RPC_BLOCKCHAIN_H + +class CBlock; +class CBlockIndex; +class CScript; +class CTransaction; +class uint256; +class UniValue; + +/** + * Get the difficulty of the net wrt to the given block index, or the chain tip if + * not provided. + * + * @return A floating point number that is a multiple of the main net minimum + * difficulty (4295032833 hashes). + */ +double GetDifficulty(const CBlockIndex* blockindex = nullptr); + +/** Callback for when block tip changed. */ +void RPCNotifyBlockChange(bool ibd, const CBlockIndex *); + +/** Block description to JSON */ +UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false); + +/** Mempool information to JSON */ +UniValue mempoolInfoToJSON(); + +/** Mempool to JSON */ +UniValue mempoolToJSON(bool fVerbose = false); + +/** Block header to JSON */ +UniValue blockheaderToJSON(const CBlockIndex* blockindex); + +#endif + diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 1d3ea083f3..334db29874 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -17,6 +17,7 @@ #include "miner.h" #include "net.h" #include "pow.h" +#include "rpc/blockchain.h" #include "rpc/server.h" #include "spork.h" #include "txmempool.h" diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 7810d4a6bb..fca5a477e3 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -9,6 +9,7 @@ #include "init.h" #include "net.h" #include "netbase.h" +#include "rpc/blockchain.h" #include "rpc/server.h" #include "timedata.h" #include "txmempool.h" diff --git a/src/rpc/server.h b/src/rpc/server.h index 10d4a94f4d..dde2419b24 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -193,7 +193,6 @@ extern bool ParseBoolV(const UniValue& v, const std::string &strName); extern CAmount AmountFromValue(const UniValue& value); extern UniValue ValueFromAmount(const CAmount& amount); -extern double GetDifficulty(const CBlockIndex* blockindex = NULL); extern std::string HelpExampleCli(const std::string& methodname, const std::string& args); extern std::string HelpExampleRpc(const std::string& methodname, const std::string& args); @@ -201,6 +200,5 @@ bool StartRPC(); void InterruptRPC(); void StopRPC(); std::string JSONRPCExecBatch(const UniValue& vReq); -void RPCNotifyBlockChange(bool ibd, const CBlockIndex *); #endif // BITCOIN_RPCSERVER_H From b5968cd7a7eba4c5e015cbab3009a7e87d189d4d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 1 Apr 2017 12:25:50 +0200 Subject: [PATCH 02/29] Merge #10129: scheduler: fix sub-second precision with boost < 1.50 e025246 scheduler: fix sub-second precision with boost < 1.50 (Cory Fields) Tree-SHA512: b9d4875406c1a2bf3cb6412d7511c24d871bfba6a2ea5ccfbbf7392f2f8850027b001b776da422fea592878da21d897b1aa56d92bc2239869055dce79fd442ac --- src/scheduler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scheduler.cpp b/src/scheduler.cpp index 07fcd0a88e..56d9e01ee1 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -23,7 +23,9 @@ CScheduler::~CScheduler() #if BOOST_VERSION < 105000 static boost::system_time toPosixTime(const boost::chrono::system_clock::time_point& t) { - return boost::posix_time::from_time_t(boost::chrono::system_clock::to_time_t(t)); + // Creating the posix_time using from_time_t loses sub-second precision. So rather than exporting the time_point to time_t, + // start with a posix_time at the epoch (0) and add the milliseconds that have passed since then. + return boost::posix_time::from_time_t(0) + boost::posix_time::milliseconds(boost::chrono::duration_cast(t.time_since_epoch()).count()); } #endif From 07ed44df6b16bf379f3ab0798ccff3ac295fe2f9 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 2 Apr 2017 08:24:32 +0200 Subject: [PATCH 03/29] Merge #10136: build: Disable Wshadow warning 2c83911 build: Disable Wshadow warning (Wladimir J. van der Laan) Tree-SHA512: e3c1f7253c43449740760da287985b8027344dfc48c8a85ea9bca977c73cbaf75709d6e32ac0fea51eb89dccb48706a5abdf006be45375838df10ccba35e9aa1 --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index bacf8d3d21..2a820ec345 100644 --- a/configure.ac +++ b/configure.ac @@ -271,7 +271,6 @@ if test "x$CXXFLAGS_overridden" = "xno"; then AX_CHECK_COMPILE_FLAG([-Wformat],[CXXFLAGS="$CXXFLAGS -Wformat"],,[[$CXXFLAG_WERROR]]) AX_CHECK_COMPILE_FLAG([-Wvla],[CXXFLAGS="$CXXFLAGS -Wvla"],,[[$CXXFLAG_WERROR]]) AX_CHECK_COMPILE_FLAG([-Wformat-security],[CXXFLAGS="$CXXFLAGS -Wformat-security"],,[[$CXXFLAG_WERROR]]) - AX_CHECK_COMPILE_FLAG([-Wshadow],[CXXFLAGS="$CXXFLAGS -Wshadow"],,[[$CXXFLAG_WERROR]]) ## Some compilers (gcc) ignore unknown -Wno-* options, but warn about all ## unknown options if any other warning is produced. Test the -Wfoo case, and From 818ec218d6f7caf81af17dcacdd462eabc208171 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 2 Apr 2017 08:55:12 +0200 Subject: [PATCH 04/29] Merge #10128: Speed Up CuckooCache tests 3f098cc Decrease testcase sizes in cuckoocache tests (Jeremy Rubin) Tree-SHA512: 71a0e171be8d5473c791440aa4353d99b885b926b7284a3a1914c95e0c2c77925d5f3a6f329778cd81931a4e5832a082cb31d82ee8adb433d357d2e2b4f7a9e5 --- src/test/cuckoocache_tests.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/test/cuckoocache_tests.cpp b/src/test/cuckoocache_tests.cpp index 228b3e571a..a4e999dd57 100644 --- a/src/test/cuckoocache_tests.cpp +++ b/src/test/cuckoocache_tests.cpp @@ -60,7 +60,8 @@ BOOST_AUTO_TEST_CASE(test_cuckoocache_no_fakes) { insecure_rand = FastRandomContext(true); CuckooCache::cache cc{}; - cc.setup_bytes(32 << 20); + size_t megabytes = 4; + cc.setup_bytes(megabytes << 20); uint256 v; for (int x = 0; x < 100000; ++x) { insecure_GetRandHash(v); @@ -135,7 +136,7 @@ BOOST_AUTO_TEST_CASE(cuckoocache_hit_rate_ok) * as a lower bound on performance. */ double HitRateThresh = 0.98; - size_t megabytes = 32; + size_t megabytes = 4; for (double load = 0.1; load < 2; load *= 2) { double hits = test_cache>(megabytes, load); BOOST_CHECK(normalize_hit_rate(hits, load) > HitRateThresh); @@ -204,7 +205,7 @@ void test_cache_erase(size_t megabytes) BOOST_AUTO_TEST_CASE(cuckoocache_erase_ok) { - size_t megabytes = 32; + size_t megabytes = 4; test_cache_erase>(megabytes); } @@ -291,7 +292,7 @@ void test_cache_erase_parallel(size_t megabytes) } BOOST_AUTO_TEST_CASE(cuckoocache_erase_parallel_ok) { - size_t megabytes = 32; + size_t megabytes = 4; test_cache_erase_parallel>(megabytes); } @@ -342,13 +343,13 @@ void test_cache_generations() } }; - const uint32_t BLOCK_SIZE = 10000; + const uint32_t BLOCK_SIZE = 1000; // We expect window size 60 to perform reasonably given that each epoch // stores 45% of the cache size (~472k). const uint32_t WINDOW_SIZE = 60; const uint32_t POP_AMOUNT = (BLOCK_SIZE / WINDOW_SIZE) / 2; const double load = 10; - const size_t megabytes = 32; + const size_t megabytes = 4; const size_t bytes = megabytes * (1 << 20); const uint32_t n_insert = static_cast(load * (bytes / sizeof(uint256))); From 9fa51cc6675b47292a888222e7eeaa1c1a1cd359 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 2 Apr 2017 12:51:58 +0200 Subject: [PATCH 05/29] Merge #10072: Remove sources of unreliablility in extended functional tests a4fd89f Make forknotify.py more robust (John Newbery) 1f3d78b Wait for connection to open in bip9-softforks.py (John Newbery) Tree-SHA512: de7d0002ee62ad97059b6f6c89b11f6e9901e3b4164ef6906bcd61e4ca499c277d9034784755966e5baf599869fad611b0b18f5547a384ceb5b7db3cc5bbd132 --- test/functional/bip9-softforks.py | 10 ++++------ test/functional/forknotify.py | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/test/functional/bip9-softforks.py b/test/functional/bip9-softforks.py index e21a396f2e..1175b1b7bc 100755 --- a/test/functional/bip9-softforks.py +++ b/test/functional/bip9-softforks.py @@ -200,16 +200,14 @@ class BIP9SoftForksTest(ComparisonTestFramework): yield TestInstance([[block, False]]) # Restart all - self.test.block_store.close() + self.test.clear_all_connections() stop_nodes(self.nodes) - shutil.rmtree(self.options.tmpdir) + shutil.rmtree(self.options.tmpdir + "/node0") self.setup_chain() self.setup_network() - self.test.block_store = BlockStore(self.options.tmpdir) - self.test.clear_all_connections() self.test.add_all_connections(self.nodes) - NetworkThread().start() # Start up network handling in another thread - + NetworkThread().start() + self.test.test_nodes[0].wait_for_verack() def get_tests(self): for test in itertools.chain( diff --git a/test/functional/forknotify.py b/test/functional/forknotify.py index c2724ba5df..7a365438cc 100755 --- a/test/functional/forknotify.py +++ b/test/functional/forknotify.py @@ -3,6 +3,8 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the -alertnotify option.""" +import os +import time from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * @@ -41,12 +43,19 @@ class ForkNotifyTest(BitcoinTestFramework): self.nodes[1].generate(1) self.sync_all() + # Give bitcoind 10 seconds to write the alert notification + timeout = 10.0 + while timeout > 0: + if os.path.exists(self.alert_filename) and os.path.getsize(self.alert_filename): + break + time.sleep(0.1) + timeout -= 0.1 + else: + assert False, "-alertnotify did not warn of up-version blocks" + with open(self.alert_filename, 'r', encoding='utf8') as f: alert_text = f.read() - if len(alert_text) == 0: - raise AssertionError("-alertnotify did not warn of up-version blocks") - # Mine more up-version blocks, should not get more alerts: self.nodes[1].generate(1) self.sync_all() From 22b21f50cc77276d92583f65b6b99fc65868e0eb Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 2 Apr 2017 15:39:20 +0200 Subject: [PATCH 06/29] Merge #10077: [qa] Add setnetworkactive smoke test fa697b7 [qa] Add setnetworkactive smoke test (MarcoFalke) Tree-SHA512: 7205bae16f551e93383987392702e6853cfb06d4448735815fa116385cbf5deb6c4a8f521efdd43cf3cc59fede3b3d1ffe74e662890b74bcc21b5c13ce1f20b7 --- test/functional/net.py | 54 ++++++++++++++++++++++++++++++++++ test/functional/test_runner.py | 1 + 2 files changed, 55 insertions(+) create mode 100755 test/functional/net.py diff --git a/test/functional/net.py b/test/functional/net.py new file mode 100755 index 0000000000..e9463c7dc7 --- /dev/null +++ b/test/functional/net.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +# Copyright (c) 2017 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +"""Test RPC calls related to net. + +Tests correspond to code in rpc/net.cpp. +""" + +from decimal import Decimal +import time + +from test_framework.test_framework import BitcoinTestFramework +from test_framework.authproxy import JSONRPCException +from test_framework.util import ( + assert_equal, + start_nodes, + connect_nodes_bi, +) + + +class NetTest(BitcoinTestFramework): + def __init__(self): + super().__init__() + self.setup_clean_chain = True + self.num_nodes = 2 + + def setup_network(self): + self.nodes = start_nodes(self.num_nodes, self.options.tmpdir) + connect_nodes_bi(self.nodes, 0, 1) + self.is_network_split = False + self.sync_all() + + def run_test(self): + assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], True) + assert_equal(self.nodes[0].getnetworkinfo()['connections'], 2) # bilateral connection + + self.nodes[0].setnetworkactive(False) + assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], False) + timeout = 3 + while self.nodes[0].getnetworkinfo()['connections'] != 0: + # Wait a bit for all sockets to close + assert timeout > 0, 'not all connections closed in time' + timeout -= 0.1 + time.sleep(0.1) + + self.nodes[0].setnetworkactive(True) + connect_nodes_bi(self.nodes, 0, 1) + assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], True) + assert_equal(self.nodes[0].getnetworkinfo()['connections'], 2) + + +if __name__ == '__main__': + NetTest().main() diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 0a1ee9cebf..cc9d0134c5 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -79,6 +79,7 @@ BASE_SCRIPTS= [ 'decodescript.py', 'blockchain.py', 'disablewallet.py', + 'net.py', 'keypool.py', 'keypool-hd.py', 'p2p-mempool.py', From 198808894959f8071924d2ff40c9f1b418a708d6 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 3 Apr 2017 12:05:43 +0200 Subject: [PATCH 07/29] Merge #10058: No need to use OpenSSL malloc/free 6d5dd60 No need to use OpenSSL malloc/free (Thomas Snider) Tree-SHA512: 29f790067ffd5a10a8e1a621318a0ba445691f57c804aa3b7c8ca372c8408d8c7fe703c42b48018e400fc32e3feff5ab401d97433910ce2c50e69da0b8a6662e --- src/util.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 82bcf74e4d..580bf7248b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -141,26 +141,24 @@ std::atomic fReopenDebugLog(false); CTranslationInterface translationInterface; /** Init OpenSSL library multithreading support */ -static CCriticalSection** ppmutexOpenSSL; +static std::unique_ptr ppmutexOpenSSL; void locking_callback(int mode, int i, const char* file, int line) NO_THREAD_SAFETY_ANALYSIS { if (mode & CRYPTO_LOCK) { - ENTER_CRITICAL_SECTION(*ppmutexOpenSSL[i]); + ENTER_CRITICAL_SECTION(ppmutexOpenSSL[i]); } else { - LEAVE_CRITICAL_SECTION(*ppmutexOpenSSL[i]); + LEAVE_CRITICAL_SECTION(ppmutexOpenSSL[i]); } } -// Init +// Singleton for wrapping OpenSSL setup/teardown. class CInit { public: CInit() { // Init OpenSSL library multithreading support - ppmutexOpenSSL = (CCriticalSection**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(CCriticalSection*)); - for (int i = 0; i < CRYPTO_num_locks(); i++) - ppmutexOpenSSL[i] = new CCriticalSection(); + ppmutexOpenSSL.reset(new CCriticalSection[CRYPTO_num_locks()]); CRYPTO_set_locking_callback(locking_callback); // OpenSSL can optionally load a config file which lists optional loadable modules and engines. @@ -184,9 +182,8 @@ public: RAND_cleanup(); // Shutdown OpenSSL library multithreading support CRYPTO_set_locking_callback(NULL); - for (int i = 0; i < CRYPTO_num_locks(); i++) - delete ppmutexOpenSSL[i]; - OPENSSL_free(ppmutexOpenSSL); + // Clear the set of locks now to maintain symmetry with the constructor. + ppmutexOpenSSL.reset(); } } instance_of_cinit; From f471b75aec9a6cf91e4a503fe015938293737b93 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 3 Apr 2017 13:24:09 +0200 Subject: [PATCH 08/29] Merge #9533: Allow non-power-of-2 signature cache sizes 7482781 Allow non-power-of-2 signature cache sizes (Pieter Wuille) Tree-SHA512: 5731c22b46c5ae81cf6d52000c28e39b243a47d96d91079942a5b5a10db214449217f71aa2195e18f8a3917cb206b04c75dc13e4522eb700a1dbf1819013ba22 --- src/cuckoocache.h | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/cuckoocache.h b/src/cuckoocache.h index ff47e9776b..5837549455 100644 --- a/src/cuckoocache.h +++ b/src/cuckoocache.h @@ -154,7 +154,7 @@ public: * @tparam Element should be a movable and copyable type * @tparam Hash should be a function/callable which takes a template parameter * hash_select and an Element and extracts a hash from it. Should return - * high-entropy hashes for `Hash h; h<0>(e) ... h<7>(e)`. + * high-entropy uint32_t hashes for `Hash h; h<0>(e) ... h<7>(e)`. */ template class cache @@ -193,12 +193,6 @@ private: */ uint32_t epoch_size; - /** hash_mask should be set to appropriately mask out a hash such that every - * masked hash is [0,size), eg, if floor(log2(size)) == 20, then hash_mask - * should be (1<<20)-1 - */ - uint32_t hash_mask; - /** depth_limit determines how many elements insert should try to replace. * Should be set to log2(n)*/ uint8_t depth_limit; @@ -217,14 +211,14 @@ private: */ inline std::array compute_hashes(const Element& e) const { - return {{hash_function.template operator()<0>(e) & hash_mask, - hash_function.template operator()<1>(e) & hash_mask, - hash_function.template operator()<2>(e) & hash_mask, - hash_function.template operator()<3>(e) & hash_mask, - hash_function.template operator()<4>(e) & hash_mask, - hash_function.template operator()<5>(e) & hash_mask, - hash_function.template operator()<6>(e) & hash_mask, - hash_function.template operator()<7>(e) & hash_mask}}; + return {{(uint32_t)((hash_function.template operator()<0>(e) * (uint64_t)size) >> 32), + (uint32_t)((hash_function.template operator()<1>(e) * (uint64_t)size) >> 32), + (uint32_t)((hash_function.template operator()<2>(e) * (uint64_t)size) >> 32), + (uint32_t)((hash_function.template operator()<3>(e) * (uint64_t)size) >> 32), + (uint32_t)((hash_function.template operator()<4>(e) * (uint64_t)size) >> 32), + (uint32_t)((hash_function.template operator()<5>(e) * (uint64_t)size) >> 32), + (uint32_t)((hash_function.template operator()<6>(e) * (uint64_t)size) >> 32), + (uint32_t)((hash_function.template operator()<7>(e) * (uint64_t)size) >> 32)}}; } /* end @@ -305,7 +299,7 @@ public: } /** setup initializes the container to store no more than new_size - * elements. setup rounds down to a power of two size. + * elements. * * setup should only be called once. * @@ -316,8 +310,7 @@ public: { // depth_limit must be at least one otherwise errors can occur. depth_limit = static_cast(std::log2(static_cast(std::max((uint32_t)2, new_size)))); - size = 1 << depth_limit; - hash_mask = size-1; + size = std::max(2, new_size); table.resize(size); collection_flags.setup(size); epoch_flags.resize(size); From 13cdff4989f707efef451c32eb3907dea9acd65d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 5 Apr 2017 07:57:17 +0200 Subject: [PATCH 09/29] Merge #10104: linearize script: Option to use RPC cookie bd41d98 Datadir option in linearize scripts (Andrew Chow) Tree-SHA512: 0d11866b574986c087ec962a8a9fc0b6dfee8175ae20ef827f8b4a143f657c5bffc9f9696e9dabf29b68002003a5b6a7d8ac473231b5c9c81c3a4fa0318f5bd0 --- contrib/linearize/README.md | 3 ++- contrib/linearize/example-linearize.cfg | 1 + contrib/linearize/linearize-hashes.py | 23 ++++++++++++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/contrib/linearize/README.md b/contrib/linearize/README.md index b83de046fe..dd220b98d3 100644 --- a/contrib/linearize/README.md +++ b/contrib/linearize/README.md @@ -11,7 +11,8 @@ https://github.com/dashpay/dash_hash $ ./linearize-hashes.py linearize.cfg > hashlist.txt Required configuration file settings for linearize-hashes: -* RPC: `rpcuser`, `rpcpassword` +* RPC: `datadir` (Required if `rpcuser` and `rpcpassword` are not specified) +* RPC: `rpcuser`, `rpcpassword` (Required if `datadir` is not specified) Optional config file setting for linearize-hashes: * RPC: `host` (Default: `127.0.0.1`) diff --git a/contrib/linearize/example-linearize.cfg b/contrib/linearize/example-linearize.cfg index f1376bf34d..3fea810ea6 100644 --- a/contrib/linearize/example-linearize.cfg +++ b/contrib/linearize/example-linearize.cfg @@ -1,6 +1,7 @@ # bitcoind RPC settings (linearize-hashes) rpcuser=someuser rpcpassword=somepassword +#datadir=~/.bitcoin host=127.0.0.1 port=9998 diff --git a/contrib/linearize/linearize-hashes.py b/contrib/linearize/linearize-hashes.py index ebd9f1e75a..1a2f537443 100755 --- a/contrib/linearize/linearize-hashes.py +++ b/contrib/linearize/linearize-hashes.py @@ -16,6 +16,8 @@ import json import re import base64 import sys +import os +import os.path settings = {} @@ -93,6 +95,14 @@ def get_block_hashes(settings, max_blocks_per_call=10000): height += num_blocks +def get_rpc_cookie(): + # Open the cookie file + with open(os.path.join(os.path.expanduser(settings['datadir']), '.cookie'), 'r') as f: + combined = f.readline() + combined_split = combined.split(":") + settings['rpcuser'] = combined_split[0] + settings['rpcpassword'] = combined_split[1] + if __name__ == '__main__': if len(sys.argv) != 2: print("Usage: linearize-hashes.py CONFIG-FILE") @@ -122,8 +132,15 @@ if __name__ == '__main__': settings['max_height'] = 313000 if 'rev_hash_bytes' not in settings: settings['rev_hash_bytes'] = 'false' + + use_userpass = True + use_datadir = False if 'rpcuser' not in settings or 'rpcpassword' not in settings: - print("Missing username and/or password in cfg file", file=stderr) + use_userpass = False + if 'datadir' in settings and not use_userpass: + use_datadir = True + if not use_userpass and not use_datadir: + print("Missing datadir or username and/or password in cfg file", file=stderr) sys.exit(1) settings['port'] = int(settings['port']) @@ -133,4 +150,8 @@ if __name__ == '__main__': # Force hash byte format setting to be lowercase to make comparisons easier. settings['rev_hash_bytes'] = settings['rev_hash_bytes'].lower() + # Get the rpc user and pass from the cookie if the datadir is set + if use_datadir: + get_rpc_cookie() + get_block_hashes(settings) From 3dcaf47494ca8c84cd0bd17ad59808446fa19dbd Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 10 Apr 2017 09:47:23 +0200 Subject: [PATCH 10/29] Merge #10166: Ignore Doxyfile generated from Doxyfile.in template. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 9eaf718 Ignore Doxyfile generated from Doxyfile.in template. (Pavel Janík) Tree-SHA512: 03d6d0fb4a708d9e41ada8b6d3d277f8c66abc2f07081629ac81ed90a3e5b2d76fa2faab9afb2ee8c91597ee031b3f5c6923d5658019321e290cdf6a70724896 --- doc/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/.gitignore diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 0000000000..38498103bb --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1 @@ +Doxyfile From e5ecff6e8af3b3eb85c56b04904aea635f4e55fa Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 10 Apr 2017 14:19:48 +0200 Subject: [PATCH 11/29] Merge #9949: [bench] Avoid function call arguments which are pointers to uninitialized values 218d915 [bench] Avoid function call arguments which are pointers to uninitialized values (practicalswift) Tree-SHA512: 68d62e9442094f171433291b7f13dba20fc7ead5fd7f2292e1eb97ae51aa2345d40224c4a65c2e5d3552802b3cd0f675a82b6181cf5b77e964355650b25089f0 --- src/bench/checkblock.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp index 018d4f508e..45ac54d62a 100644 --- a/src/bench/checkblock.cpp +++ b/src/bench/checkblock.cpp @@ -20,7 +20,7 @@ static void DeserializeBlockTest(benchmark::State& state) CDataStream stream((const char*)raw_bench::block813851, (const char*)&raw_bench::block813851[sizeof(raw_bench::block813851)], SER_NETWORK, PROTOCOL_VERSION); - char a; + char a = '\0'; stream.write(&a, 1); // Prevent compaction while (state.KeepRunning()) { @@ -35,7 +35,7 @@ static void DeserializeAndCheckBlockTest(benchmark::State& state) CDataStream stream((const char*)raw_bench::block813851, (const char*)&raw_bench::block813851[sizeof(raw_bench::block813851)], SER_NETWORK, PROTOCOL_VERSION); - char a; + char a = '\0'; stream.write(&a, 1); // Prevent compaction Consensus::Params params = Params(CBaseChainParams::MAIN).GetConsensus(); From 23530a88a8802b438dc0a40e253aeae79bb42e4d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 10 Apr 2017 14:44:16 +0200 Subject: [PATCH 12/29] Merge #10135: [p2p] Send the correct error code in reject messages 5d08c9c Send the correct error code in reject messages (John Newbery) Tree-SHA512: 0cd3ef3ae202584b138cc0bbfba4125635822e0c5a755fb9276a604b39286959ab22dabc3104aa5d7e71358cd69d965de2a333ff04bf3e8ed43cf0296ac01264 --- src/net_processing.cpp | 6 +++--- src/validation.cpp | 10 ++++++---- test/functional/p2p-fullblocktest.py | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 1df626b70f..6a32b8455e 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -917,8 +917,8 @@ void PeerLogicValidation::BlockChecked(const CBlock& block, const CValidationSta int nDoS = 0; if (state.IsInvalid(nDoS)) { - if (it != mapBlockSource.end() && State(it->second.first)) { - assert (state.GetRejectCode() < REJECT_INTERNAL); // Blocks are never rejected with internal reject codes + // Don't send reject message with code 0 or an internal reject code. + if (it != mapBlockSource.end() && State(it->second.first) && state.GetRejectCode() > 0 && state.GetRejectCode() < REJECT_INTERNAL) { CBlockReject reject = {(unsigned char)state.GetRejectCode(), state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), hash}; State(it->second.first)->rejects.push_back(reject); if (nDoS > 0 && it->second.second) @@ -2348,7 +2348,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr LogPrint("mempoolrej", "%s from peer=%d was not accepted: %s\n", tx.GetHash().ToString(), pfrom->id, FormatStateMessage(state)); - if (state.GetRejectCode() < REJECT_INTERNAL) // Never send AcceptToMemoryPool's internal codes over P2P + if (state.GetRejectCode() > 0 && state.GetRejectCode() < REJECT_INTERNAL) // Never send AcceptToMemoryPool's internal codes over P2P connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::REJECT, strCommand, (unsigned char)state.GetRejectCode(), state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), inv.hash)); if (nDoS > 0) { diff --git a/src/validation.cpp b/src/validation.cpp index f4095e2ec4..de9fe3bb57 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2185,7 +2185,7 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd LogPrint("bench", " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs]\n", (unsigned)block.vtx.size(), 0.001 * (nTime3 - nTime2), 0.001 * (nTime3 - nTime2) / block.vtx.size(), nInputs <= 1 ? 0 : 0.001 * (nTime3 - nTime2) / (nInputs-1), nTimeConnect * 0.000001); if (!control.Wait()) - return state.DoS(100, false); + return state.DoS(100, error("%s: CheckQueue failed", __func__), REJECT_INVALID, "block-validation-failed"); int64_t nTime4 = GetTimeMicros(); nTimeVerify += nTime4 - nTime2; LogPrint("bench", " - Verify %u txins: %.2fms (%.3fms/txin) [%.2fs]\n", nInputs - 1, 0.001 * (nTime4 - nTime2), nInputs <= 1 ? 0 : 0.001 * (nTime4 - nTime2) / (nInputs-1), nTimeVerify * 0.000001); @@ -3338,10 +3338,12 @@ static bool CheckIndexAgainstCheckpoint(const CBlockIndex* pindexPrev, CValidati return true; int nHeight = pindexPrev->nHeight+1; - // Don't accept any forks from the main chain prior to last checkpoint + // Don't accept any forks from the main chain prior to last checkpoint. + // GetLastCheckpoint finds the last checkpoint in MapCheckpoints that's in our + // MapBlockIndex. CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(chainparams.Checkpoints()); if (pcheckpoint && nHeight < pcheckpoint->nHeight) - return state.DoS(100, error("%s: forked chain older than last checkpoint (height %d)", __func__, nHeight)); + return state.DoS(100, error("%s: forked chain older than last checkpoint (height %d)", __func__, nHeight), REJECT_CHECKPOINT, "bad-fork-prior-to-checkpoint"); return true; } @@ -3471,7 +3473,7 @@ static bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state CBlockIndex* pindexPrev = NULL; BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock); if (mi == mapBlockIndex.end()) - return state.DoS(10, error("%s: prev block not found", __func__), 0, "bad-prevblk"); + return state.DoS(10, error("%s: prev block not found", __func__), 0, "prev-blk-not-found"); pindexPrev = (*mi).second; assert(pindexPrev); diff --git a/test/functional/p2p-fullblocktest.py b/test/functional/p2p-fullblocktest.py index 90ec10758e..f060216860 100755 --- a/test/functional/p2p-fullblocktest.py +++ b/test/functional/p2p-fullblocktest.py @@ -404,7 +404,7 @@ class FullBlockTest(ComparisonTestFramework): # Extend the b26 chain to make sure bitcoind isn't accepting b26 b27 = block(27, spend=out[7]) - yield rejected(RejectResult(0, b'bad-prevblk')) + yield rejected(False) # Now try a too-large-coinbase script tip(15) @@ -416,7 +416,7 @@ class FullBlockTest(ComparisonTestFramework): # Extend the b28 chain to make sure bitcoind isn't accepting b28 b29 = block(29, spend=out[7]) - yield rejected(RejectResult(0, b'bad-prevblk')) + yield rejected(False) # b30 has a max-sized coinbase scriptSig. tip(23) From dccd6970bf042aa75e3ee54a694a3d3cb942aba2 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 10 Apr 2017 15:16:34 +0200 Subject: [PATCH 13/29] Merge #10164: Wallet: reduce excess logic InMempool() 3491476 Wallet: reduce excess logic InMemPool() (Kewde) Tree-SHA512: 554ea2827cfd482281fae0ba3d0a7989dbfeace98a35462732ea08bf3cc94c9564a9ea8ca2fa9905b963367d0b56a490ef0d83ceb6731c8f06187de98b6a7f23 --- src/wallet/wallet.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index f7892af937..0077c398da 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2186,10 +2186,7 @@ CAmount CWalletTx::GetChange() const bool CWalletTx::InMempool() const { LOCK(mempool.cs); - if (mempool.exists(GetHash())) { - return true; - } - return false; + return mempool.exists(GetHash()); } bool CWalletTx::IsTrusted() const From 0db1328a246445a90e995ac5ff1a8ed4576d265f Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 12 Apr 2017 20:15:06 +0200 Subject: [PATCH 14/29] Merge #10177: Changed "Send" button default status from true to false 8c3e6c6 Changed "Send" button default status from true to false (KibbledJiveElkZoo) Tree-SHA512: e60d7481351e88925d99b33bdb616f3c234e93ef052571b9c4a1328186ec9abb8b61b0c4299afcb731edad2634aef6b1adaad121646b6c0c56dc933662904674 --- src/qt/forms/sendcoinsdialog.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index 97f2f036d4..4a210ceacd 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -1221,7 +1221,7 @@ false - true + false From 632956a8066fa80d6dec15c9d169a03e1096f18a Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 17 Apr 2017 04:46:34 -0700 Subject: [PATCH 15/29] Merge #9693: Prevent integer overflow in ReadVarInt. 45f0961 Prevent integer overflow in ReadVarInt. (Gregory Maxwell) Tree-SHA512: 385ea0efb6b59d44c45a49227e5f6fff236b4775544cbeb236312a3fd87fd75c226ac56f7aa1bca66b853639da75a579610074f7582f92cf2ebd4a74bc40f6f0 --- src/serialize.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/serialize.h b/src/serialize.h index 55e1e67d54..99801f7e50 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -352,11 +352,18 @@ I ReadVarInt(Stream& is) I n = 0; while(true) { unsigned char chData = ser_readdata8(is); + if (n > (std::numeric_limits::max() >> 7)) { + throw std::ios_base::failure("ReadVarInt(): size too large"); + } n = (n << 7) | (chData & 0x7F); - if (chData & 0x80) + if (chData & 0x80) { + if (n == std::numeric_limits::max()) { + throw std::ios_base::failure("ReadVarInt(): size too large"); + } n++; - else + } else { return n; + } } } From 383d1819a9a7d912906b51ce9d93e1e5c91260f4 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 18 Apr 2017 08:24:57 +0200 Subject: [PATCH 16/29] Merge #10211: [doc] Contributor fixes & new "finding reviewers" section 3ddd227 [doc] Add blob about finding reviewers. (Kalle Alm) 846dc17 [doc] Wording fixes in CONTRIBUTING.md. (Kalle Alm) Tree-SHA512: 232e6496769f0fba1022da2e9a3add10dcec721e6cc168d552445125849a8c02729a71b7c526bbff30c7428bcdcfdd92b424014fbb6310148392d261408b4044 --- CONTRIBUTING.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 078e0ec756..c9b77c54cc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,8 +37,8 @@ fixes or code moves with actual code changes. Commit messages should be verbose by default consisting of a short subject line (50 chars max), a blank line and detailed explanatory text as separate -paragraph(s); unless the title alone is self-explanatory (like "Corrected typo -in init.cpp") then a single title line is sufficient. Commit messages should be +paragraph(s), unless the title alone is self-explanatory (like "Corrected typo +in init.cpp") in which case a single title line is sufficient. Commit messages should be helpful to people reading your code in the future, so explain the reasoning for your decisions. Further explanation [here](http://chris.beams.io/posts/git-commit/). @@ -225,6 +225,37 @@ discussed extensively on the mailing list and IRC, be accompanied by a widely discussed BIP and have a generally widely perceived technical consensus of being a worthwhile change based on the judgement of the maintainers. +### Finding Reviewers + +As most reviewers are themselves developers with their own projects, the review +process can be quite lengthy, and some amount of patience is required. If you find +that you've been waiting for a pull request to be given attention for several +months, there may be a number of reasons for this, some of which you can do something +about: + + - It may be because of a feature freeze due to an upcoming release. During this time, + only bug fixes are taken into consideration. If your pull request is a new feature, + it will not be prioritized until the release is over. Wait for release. + - It may be because the changes you are suggesting do not appeal to people. Rather than + nits and critique, which require effort and means they care enough to spend time on your + contribution, thundering silence is a good sign of widespread (mild) dislike of a given change + (because people don't assume *others* won't actually like the proposal). Don't take + that personally, though! Instead, take another critical look at what you are suggesting + and see if it: changes too much, is too broad, doesn't adhere to the + [developer notes](doc/developer-notes.md), is dangerous or insecure, is messily written, etc. + Identify and address any of the issues you find. Then ask e.g. on IRC if someone could give + their opinion on the concept itself. + - It may be because your code is too complex for all but a few people. And those people + may not have realized your pull request even exists. A great way to find people who + are qualified and care about the code you are touching is the + [Git Blame feature](https://help.github.com/articles/tracing-changes-in-a-file/). Simply + find the person touching the code you are touching before you and see if you can find + them and give them a nudge. Don't be incessant about the nudging though. + - Finally, if all else fails, ask on IRC or elsewhere for someone to give your pull request + a look. If you think you've been waiting an unreasonably long amount of time (month+) for + no particular reason (few lines changed, etc), this is totally fine. Try to return the favor + when someone else is asking for feedback on their code, and universe balances out. + Release Policy -------------- From a089c9325ebe0d896e6e8e3c305c176b8e32fa09 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 19 Apr 2017 12:29:51 +0200 Subject: [PATCH 17/29] Merge #9827: Improve ScanForWalletTransactions return value 30abce7 Improve ScanForWalletTransactions return value (Russell Yanofsky) Tree-SHA512: 195028553b103052a842b6a37e67410118a20c32475b80f7fd22d6d8622f92eca1c2d84f291d1092bef2161d3187d91052799b533e1e265b7613d51955490b8d --- src/wallet/test/wallet_tests.cpp | 11 +++++++++++ src/wallet/wallet.cpp | 7 ++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index 3313a54549..c23614eef7 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -426,6 +426,17 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup) BOOST_CHECK_EQUAL(response.write(), strprintf("[{\"success\":false,\"error\":{\"code\":-1,\"message\":\"Failed to rescan before time %d, transactions may be missing.\"}},{\"success\":true}]", newTip->GetBlockTimeMax())); ::pwalletMain = backup; } + + // Verify ScanForWalletTransactions does not return null when the scan is + // elided due to the nTimeFirstKey optimization. + { + CWallet wallet; + { + LOCK(wallet.cs_wallet); + wallet.UpdateTimeFirstKey(newTip->GetBlockTime() + 7200 + 1); + } + BOOST_CHECK_EQUAL(newTip, wallet.ScanForWalletTransactions(newTip)); + } } // Verify importwallet RPC starts rescan at earliest block with timestamp diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 0077c398da..0722502479 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1822,16 +1822,17 @@ void CWalletTx::GetAccountAmounts(const std::string& strAccount, CAmount& nRecei * exist in the wallet will be updated. * * Returns pointer to the first block in the last contiguous range that was - * successfully scanned. - * + * successfully scanned or elided (elided if pIndexStart points at a block + * before CWallet::nTimeFirstKey). Returns null if there is no such range, or + * the range doesn't include chainActive.Tip(). */ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) { - CBlockIndex* ret = nullptr; int64_t nNow = GetTime(); const CChainParams& chainParams = Params(); CBlockIndex* pindex = pindexStart; + CBlockIndex* ret = pindexStart; { LOCK2(cs_main, cs_wallet); From a3467dd26986a73edbf0972b67ef1b401e377c4b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 21 Apr 2017 10:59:01 +0200 Subject: [PATCH 18/29] Merge #10228: build: regenerate bitcoin-config.h as necessary 91ab8f5 build: fix bitcoin-config.h regeneration after touching build files (Cory Fields) 3577603 build: remove wonky auto top-level convenience targets (Cory Fields) Tree-SHA512: 2e68634439eeb7eca43cd2858135a583bfe0cf146e021a8384a24f7267aacc6f99bdc7a6d497a04d32e6a03e9446f0f599afb5bd53346dadf19f47d5fb2ea9f9 --- src/Makefile.am | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index 060b9ddc98..0541221117 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -638,6 +638,14 @@ config/stamp-h1: $(top_srcdir)/$(subdir)/config/dash-config.h.in $(top_builddir) $(top_srcdir)/$(subdir)/config/dash-config.h.in: $(am__configure_deps) $(AM_V_at)$(MAKE) -C $(top_srcdir) $(subdir)/config/dash-config.h.in + +config/bitcoin-config.h: config/stamp-h1 + @$(MAKE) -C $(top_builddir) $(subdir)/$(@) +config/stamp-h1: $(top_srcdir)/$(subdir)/config/bitcoin-config.h.in $(top_builddir)/config.status + $(AM_V_at)$(MAKE) -C $(top_builddir) $(subdir)/$(@) +$(top_srcdir)/$(subdir)/config/bitcoin-config.h.in: $(am__configure_deps) + $(AM_V_at)$(MAKE) -C $(top_srcdir) $(subdir)/config/bitcoin-config.h.in + clean-local: -$(MAKE) -C secp256k1 clean -$(MAKE) -C univalue clean From 317b797e2af6bb96b805c7fb89d7c40e4c6e8dac Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 26 Apr 2017 11:43:52 +0200 Subject: [PATCH 19/29] Merge #9670: contrib: github-merge improvements b508424 contrib: github-merge improvements (Wladimir J. van der Laan) Tree-SHA512: 56a34e887716bf6bfcd1b6520f6b9a1bb742e1ad17e75618caf982af71fceb75d50caec1bf4279cb9a2f7a74319f1bcec4c824682841bd6e994acc0991616451 --- contrib/devtools/github-merge.py | 55 +++++++++++++++----------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/contrib/devtools/github-merge.py b/contrib/devtools/github-merge.py index 3fee39143d..03ccf5b624 100755 --- a/contrib/devtools/github-merge.py +++ b/contrib/devtools/github-merge.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2016 The Bitcoin Core developers +# Copyright (c) 2016-2017 Bitcoin Core Developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -15,7 +15,7 @@ # In case of a clean merge that is accepted by the user, the local branch with # name $BRANCH is overwritten with the merged result, and optionally pushed. from __future__ import division,print_function,unicode_literals -import os +import os,sys from sys import stdin,stdout,stderr import argparse import hashlib @@ -127,6 +127,9 @@ def tree_sha512sum(commit='HEAD'): raise IOError('Non-zero return value executing git cat-file') return overall.hexdigest() +def print_merge_details(pull, title, branch, base_branch, head_branch): + print('%s#%s%s %s %sinto %s%s' % (ATTR_RESET+ATTR_PR,pull,ATTR_RESET,title,ATTR_RESET+ATTR_PR,branch,ATTR_RESET)) + subprocess.check_call([GIT,'log','--graph','--topo-order','--pretty=format:'+COMMIT_FORMAT,base_branch+'..'+head_branch]) def parse_arguments(): epilog = ''' @@ -171,7 +174,7 @@ def main(): info = retrieve_pr_info(repo,pull) if info is None: exit(1) - title = info['title'] + title = info['title'].strip() # precedence order for destination branch argument: # - command line argument # - githubmerge.branch setting @@ -256,8 +259,7 @@ def main(): printf("ERROR: Cannot update message.",file=stderr) exit(4) - print('%s#%s%s %s %sinto %s%s' % (ATTR_RESET+ATTR_PR,pull,ATTR_RESET,title,ATTR_RESET+ATTR_PR,branch,ATTR_RESET)) - subprocess.check_call([GIT,'log','--graph','--topo-order','--pretty=format:'+COMMIT_FORMAT,base_branch+'..'+head_branch]) + print_merge_details(pull, title, branch, base_branch, head_branch) print() # Run test command if configured. @@ -276,12 +278,6 @@ def main(): print("Difference with github ignored.",file=stderr) else: exit(6) - reply = ask_prompt("Press 'd' to accept the diff.") - if reply.lower() == 'd': - print("Diff accepted.",file=stderr) - else: - print("ERROR: Diff rejected.",file=stderr) - exit(6) else: # Verify the result manually. print("Dropping you on a shell so you can try building/testing the merged source.",file=stderr) @@ -290,12 +286,6 @@ def main(): if os.path.isfile('/etc/debian_version'): # Show pull number on Debian default prompt os.putenv('debian_chroot',pull) subprocess.call([BASH,'-i']) - reply = ask_prompt("Type 'm' to accept the merge.") - if reply.lower() == 'm': - print("Merge accepted.",file=stderr) - else: - print("ERROR: Merge rejected.",file=stderr) - exit(7) second_sha512 = tree_sha512sum() if first_sha512 != second_sha512: @@ -303,16 +293,19 @@ def main(): exit(8) # Sign the merge commit. - reply = ask_prompt("Type 's' to sign off on the merge.") - if reply == 's': - try: - subprocess.check_call([GIT,'commit','-q','--gpg-sign','--amend','--no-edit']) - except subprocess.CalledProcessError as e: - print("Error signing, exiting.",file=stderr) + print_merge_details(pull, title, branch, base_branch, head_branch) + while True: + reply = ask_prompt("Type 's' to sign off on the above merge, or 'x' to reject and exit.").lower() + if reply == 's': + try: + subprocess.check_call([GIT,'commit','-q','--gpg-sign','--amend','--no-edit']) + break + except subprocess.CalledProcessError as e: + print("Error signing, exiting.",file=stderr) + exit(1) + elif reply == 'x': + print("Not signing off on merge, exiting.",file=stderr) exit(1) - else: - print("Not signing off on merge, exiting.",file=stderr) - exit(1) # Put the result in branch. subprocess.check_call([GIT,'checkout','-q',branch]) @@ -326,9 +319,13 @@ def main(): subprocess.call([GIT,'branch','-q','-D',local_merge_branch],stderr=devnull) # Push the result. - reply = ask_prompt("Type 'push' to push the result to %s, branch %s." % (host_repo,branch)) - if reply.lower() == 'push': - subprocess.check_call([GIT,'push',host_repo,'refs/heads/'+branch]) + while True: + reply = ask_prompt("Type 'push' to push the result to %s, branch %s, or 'x' to exit without pushing." % (host_repo,branch)).lower() + if reply == 'push': + subprocess.check_call([GIT,'push',host_repo,'refs/heads/'+branch]) + break + elif reply == 'x': + exit(1) if __name__ == '__main__': main() From 0d2f2b36178ace7a0d710666bf444931f100c245 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 26 Apr 2017 10:27:25 +0200 Subject: [PATCH 20/29] Merge #10273: [scripts] Minor improvements to `macdeployqtplus` script. e8babc4 Use `with` in `macdeployqtplus` script. (Chris Gavin) 4f3ac7d Remove unused variable from `macdeployqtplus` script. (Chris Gavin) Tree-SHA512: 0259506b36f3bfcc64ada951dcd4fdab1611ef76a39f92effd1163b6d8fab06bdbf50784b4b22f8b1483697c3029c12cfee5372b442ab445887ac4f928f6de80 --- contrib/macdeploy/macdeployqtplus | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 7a22d99bbc..4207cb7319 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -301,7 +301,6 @@ def copyFramework(framework, path, verbose): if os.path.exists(fromContentsDir): toContentsDir = os.path.join(path, framework.destinationVersionContentsDirectory) shutil.copytree(fromContentsDir, toContentsDir, symlinks=True) - contentslinkfrom = os.path.join(path, framework.destinationContentsDirectory) if verbose >= 3: print("Copied Contents:", fromContentsDir) print(" to:", toContentsDir) @@ -674,9 +673,8 @@ else: if verbose >= 2: print("+ Installing qt.conf +") -f = open(os.path.join(applicationBundle.resourcesPath, "qt.conf"), "wb") -f.write(qt_conf.encode()) -f.close() +with open(os.path.join(applicationBundle.resourcesPath, "qt.conf"), "wb") as f: + f.write(qt_conf.encode()) # ------------------------------------------------ From 55dc3dae52877fd5a1cfeaa69b08db61d4ef675d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 1 Jun 2017 10:42:13 +0200 Subject: [PATCH 21/29] Merge #10486: devtools: Retry after signing fails in github-merge 1983c87 devtools: Retry after signing fails in github-merge (Wladimir J. van der Laan) Tree-SHA512: f5ef91c93f4e53c9b234e7dc3ac398c6715144021d92c8592174d02c672ae99d27e88faefd52239c2a74c8e49cfd3a979e0229580016ce9a74829bdb0af206ec --- contrib/devtools/github-merge.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/devtools/github-merge.py b/contrib/devtools/github-merge.py index 03ccf5b624..a96bb7a6ba 100755 --- a/contrib/devtools/github-merge.py +++ b/contrib/devtools/github-merge.py @@ -301,8 +301,7 @@ def main(): subprocess.check_call([GIT,'commit','-q','--gpg-sign','--amend','--no-edit']) break except subprocess.CalledProcessError as e: - print("Error signing, exiting.",file=stderr) - exit(1) + print("Error while signing, asking again.",file=stderr) elif reply == 'x': print("Not signing off on merge, exiting.",file=stderr) exit(1) From b708ea819ae83d0bf045b5180c315c94866da35b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 1 Jun 2017 13:19:27 +0200 Subject: [PATCH 22/29] Merge #10469: Fixing typo in rpcdump.cpp 16d94d3 Fixing typo in rpcdump.cpp (James Evans) Tree-SHA512: 84ef1b91c719131196ebed6b865e282b77bee7699614e15884ba59010239a3bbc1380dc8f856c83338f071e3eb3ca41c6b10f830816e6c794531cf6a965d63a9 --- src/wallet/rpcdump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index a054c09f46..a50abea436 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -333,7 +333,7 @@ UniValue removeprunedfunds(const JSONRPCRequest& request) if (request.fHelp || request.params.size() != 1) throw std::runtime_error( "removeprunedfunds \"txid\"\n" - "\nDeletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will effect wallet balances.\n" + "\nDeletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.\n" "\nArguments:\n" "1. \"txid\" (string, required) The hex-encoded id of the transaction you are deleting\n" "\nExamples:\n" From f5706315563c5b20d742bfe6445c4b00469f54a3 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 5 Jun 2017 16:05:15 +0200 Subject: [PATCH 23/29] Merge #10514: Bugfix: missing == 0 after randrange 9aa215b Bugfixes: missing == 0 after randrange (Pieter Wuille) Tree-SHA512: 160657ac09553f23ad7a3966c753a30ba938ce6f7ccfd34a4ef0d05d73d712362f7eef97e44a96e37a181b8347caa9d8e1584cc4485f69674ab2de3d8a247373 --- src/test/coins_tests.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index 5220e34382..42ab30431a 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE(coins_cache_simulation_test) } // One every 10 iterations, remove a random entry from the cache - if (insecure_rand() % 10) { + if (insecure_rand() % 10 == 0) { COutPoint out(txids[insecure_rand() % txids.size()], 0); int cacheid = insecure_rand() % stack.size(); stack[cacheid]->Uncache(out); @@ -430,13 +430,13 @@ BOOST_AUTO_TEST_CASE(updatecoins_simulation_test) } // One every 10 iterations, remove a random entry from the cache - if (utxoset.size() > 1 && insecure_rand() % 30) { + if (utxoset.size() > 1 && insecure_rand() % 30 == 0) { stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(utxoset)->first); } - if (disconnected_coins.size() > 1 && insecure_rand() % 30) { + if (disconnected_coins.size() > 1 && insecure_rand() % 30 == 0) { stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(disconnected_coins)->first); } - if (duplicate_coins.size() > 1 && insecure_rand() % 30) { + if (duplicate_coins.size() > 1 && insecure_rand() % 30 == 0) { stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(duplicate_coins)->first); } From 31bb4622a668458680268b55064dda2681410538 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 6 Jun 2017 23:46:16 +0200 Subject: [PATCH 24/29] Merge #10538: [trivial] Fix typo: "occurrences" (misspelled as "occurrances") b083db6 [trivial] Fix typo: "occurrences" (misspelled as "occurrances") (practicalswift) Tree-SHA512: 5141526dbbbbe797ef103fcbdc0a1318648214973214607e35cc0e99abfc4dd547e3ef15fe21976c53a78b03dff140fe76e5c92a0f7e7d2b08081215983a8616 --- src/coins.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coins.cpp b/src/coins.cpp index 1f8baa2b1b..801b94d79c 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -91,7 +91,7 @@ void AddCoins(CCoinsViewCache& cache, const CTransaction &tx, int nHeight) { const uint256& txid = tx.GetHash(); for (size_t i = 0; i < tx.vout.size(); ++i) { // Pass fCoinbase as the possible_overwrite flag to AddCoin, in order to correctly - // deal with the pre-BIP30 occurrances of duplicate coinbase transactions. + // deal with the pre-BIP30 occurrences of duplicate coinbase transactions. cache.AddCoin(COutPoint(txid, i), Coin(tx.vout[i], nHeight, fCoinbase), fCoinbase); } } From 742744f25f494759f1e7c71bc05be3657d531dc9 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 6 Jun 2017 23:51:30 +0200 Subject: [PATCH 25/29] Merge #10522: [wallet] Remove unused variables a8c09af Remove unused variables (practicalswift) Tree-SHA512: 34807dc3a0471c83b086f430b66465602c8f6a3a158b54ace2ec8afb746f1f5907f7dfcde5a4bad4041df9721ec46b61681b2dbf89725c9c8c4c5ad0ca99f78f --- src/wallet/db.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index 4d85d445ee..199c8402f6 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -211,7 +211,6 @@ bool CDB::Recover(const std::string& filename, void *callbackDataIn, bool (*reco { CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION); CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION); - std::string strType, strErr; if (!(*recoverKVcallback)(callbackDataIn, ssKey, ssValue)) continue; } From eecc724362d1a5450dca1d4cba77ceda05999fc1 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 12 Jun 2017 15:40:18 -0700 Subject: [PATCH 26/29] Merge #10564: Return early in IsBanned. bf376eacc Return early in IsBanned. (Gregory Maxwell) Tree-SHA512: d8ed4aaf9a7523b00effa4ac17cec3be1ec1f5c5ce64d89833fbc8f3d73d13b022043354fbcf2682b2af05070d115e1fc0cc0b122197e9ddee5959c3fb9dd16d --- src/net.cpp | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index e65a35fabc..13a3efa232 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -467,35 +467,31 @@ void CConnman::ClearBanned() bool CConnman::IsBanned(CNetAddr ip) { - bool fResult = false; + LOCK(cs_setBanned); + for (banmap_t::iterator it = setBanned.begin(); it != setBanned.end(); it++) { - LOCK(cs_setBanned); - for (banmap_t::iterator it = setBanned.begin(); it != setBanned.end(); it++) - { - CSubNet subNet = (*it).first; - CBanEntry banEntry = (*it).second; + CSubNet subNet = (*it).first; + CBanEntry banEntry = (*it).second; - if(subNet.Match(ip) && GetTime() < banEntry.nBanUntil) - fResult = true; + if (subNet.Match(ip) && GetTime() < banEntry.nBanUntil) { + return true; } } - return fResult; + return false; } bool CConnman::IsBanned(CSubNet subnet) { - bool fResult = false; + LOCK(cs_setBanned); + banmap_t::iterator i = setBanned.find(subnet); + if (i != setBanned.end()) { - LOCK(cs_setBanned); - banmap_t::iterator i = setBanned.find(subnet); - if (i != setBanned.end()) - { - CBanEntry banEntry = (*i).second; - if (GetTime() < banEntry.nBanUntil) - fResult = true; + CBanEntry banEntry = (*i).second; + if (GetTime() < banEntry.nBanUntil) { + return true; } } - return fResult; + return false; } void CConnman::Ban(const CNetAddr& addr, const BanReason &banReason, int64_t bantimeoffset, bool sinceUnixEpoch) { From e7a21faa2b1e2e224d49a1ed362c1eefb192f7ca Mon Sep 17 00:00:00 2001 From: NicolasDorier Date: Sun, 12 May 2019 00:12:59 -0500 Subject: [PATCH 27/29] Merge Bitcoin#9960: Trivial: Add const modifier to GetHDChain and IsHDEnabled Signed-off-by: Pasta --- src/wallet/wallet.cpp | 2 +- src/wallet/wallet.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 0722502479..9f7d84769d 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1604,7 +1604,7 @@ bool CWallet::GetDecryptedHDChain(CHDChain& hdChainRet) return true; } -bool CWallet::IsHDEnabled() +bool CWallet::IsHDEnabled() const { CHDChain hdChainCurrent; return GetHDChain(hdChainCurrent); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 26095893b9..1884f7b9da 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1164,7 +1164,7 @@ public: */ /* Returns true if HD is enabled */ - bool IsHDEnabled(); + bool IsHDEnabled() const; /* Generates a new HD chain */ void GenerateNewHDChain(); /* Set the HD chain model (chain child index counters) */ From 2f63322cdc1ec003ea5e0a12a84dc8327bd645fc Mon Sep 17 00:00:00 2001 From: Pasta Date: Wed, 15 May 2019 21:21:54 -0500 Subject: [PATCH 28/29] dashify "Finding reviewers" section to be more relevant Signed-off-by: Pasta --- CONTRIBUTING.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c9b77c54cc..e8ce37f967 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -227,11 +227,10 @@ a worthwhile change based on the judgement of the maintainers. ### Finding Reviewers -As most reviewers are themselves developers with their own projects, the review -process can be quite lengthy, and some amount of patience is required. If you find -that you've been waiting for a pull request to be given attention for several -months, there may be a number of reasons for this, some of which you can do something -about: +The review process is normally fairly responsive on the Dash Core repository, however +this might not always be the case. If you find that you've been waiting +for a pull request to be given attention for several months, there may be a number +of reasons for this, some of which you can do something about: - It may be because of a feature freeze due to an upcoming release. During this time, only bug fixes are taken into consideration. If your pull request is a new feature, @@ -243,15 +242,15 @@ about: that personally, though! Instead, take another critical look at what you are suggesting and see if it: changes too much, is too broad, doesn't adhere to the [developer notes](doc/developer-notes.md), is dangerous or insecure, is messily written, etc. - Identify and address any of the issues you find. Then ask e.g. on IRC if someone could give - their opinion on the concept itself. + Identify and address any of the issues you find. Then ask e.g. on the forum or on a community + discord if someone could give their opinion on the concept itself. - It may be because your code is too complex for all but a few people. And those people may not have realized your pull request even exists. A great way to find people who are qualified and care about the code you are touching is the [Git Blame feature](https://help.github.com/articles/tracing-changes-in-a-file/). Simply find the person touching the code you are touching before you and see if you can find them and give them a nudge. Don't be incessant about the nudging though. - - Finally, if all else fails, ask on IRC or elsewhere for someone to give your pull request + - Finally, if all else fails, ask on discord or elsewhere for someone to give your pull request a look. If you think you've been waiting an unreasonably long amount of time (month+) for no particular reason (few lines changed, etc), this is totally fine. Try to return the favor when someone else is asking for feedback on their code, and universe balances out. From 67c735b1567f9d99907bf4fdf1e5d8e94f4c23d2 Mon Sep 17 00:00:00 2001 From: Pasta Date: Thu, 16 May 2019 09:57:15 -0500 Subject: [PATCH 29/29] s/bitcoin-config.h/dash-config.h/ Signed-off-by: Pasta --- src/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 0541221117..4d793ccbf6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -639,12 +639,12 @@ $(top_srcdir)/$(subdir)/config/dash-config.h.in: $(am__configure_deps) $(AM_V_at)$(MAKE) -C $(top_srcdir) $(subdir)/config/dash-config.h.in -config/bitcoin-config.h: config/stamp-h1 +config/dash-config.h: config/stamp-h1 @$(MAKE) -C $(top_builddir) $(subdir)/$(@) -config/stamp-h1: $(top_srcdir)/$(subdir)/config/bitcoin-config.h.in $(top_builddir)/config.status +config/stamp-h1: $(top_srcdir)/$(subdir)/config/dash-config.h.in $(top_builddir)/config.status $(AM_V_at)$(MAKE) -C $(top_builddir) $(subdir)/$(@) -$(top_srcdir)/$(subdir)/config/bitcoin-config.h.in: $(am__configure_deps) - $(AM_V_at)$(MAKE) -C $(top_srcdir) $(subdir)/config/bitcoin-config.h.in +$(top_srcdir)/$(subdir)/config/dash-config.h.in: $(am__configure_deps) + $(AM_V_at)$(MAKE) -C $(top_srcdir) $(subdir)/config/dash-config.h.in clean-local: -$(MAKE) -C secp256k1 clean