From aefeef25b8e4364613e90a37ae80cc88c363074f Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sat, 5 Jan 2019 15:06:38 +0100 Subject: [PATCH 01/12] Merge #14357: streams: Fix broken streams_vector_reader test. Remove unused seek(size_t). 4f4993fe2a Remove UBSan suppression (practicalswift) 958e1a307e streams: Remove unused seek(size_t) (practicalswift) Pull request description: Fix broken `streams_vector_reader` test. Remove unused `seek(size_t)`. Before this change the test `streams_vector_reader` triggered an unintended unsigned integer wraparound. It tried so seek using a negative value in `reader.seek(-6)`. Changes in this PR: * Fix broken `VectorReader::seek(size_t)` test case * Remove unused `seek(size_t)` Tree-SHA512: 6c6affd680626363eef9e496748f2f86a522325abab9d6b13161f41125cdc29ceb36c2c1509c90b8ff108d606df7629e55e094cc2b6253b05a892b81ce176b71 --- src/streams.h | 20 ++++---------------- src/test/streams_tests.cpp | 10 +++++----- test/sanitizer_suppressions/ubsan | 1 - 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/src/streams.h b/src/streams.h index 9731fed249..319e1f50d7 100644 --- a/src/streams.h +++ b/src/streams.h @@ -121,12 +121,6 @@ class CVectorWriter { return nType; } - void seek(size_t nSize) - { - nPos += nSize; - if(nPos > vchData.size()) - vchData.resize(nPos); - } size_t size() const { return vchData.size() - nPos; @@ -157,9 +151,11 @@ public: * @param[in] pos Starting position. Vector index where reads should start. */ VectorReader(int type, int version, const std::vector& data, size_t pos) - : m_type(type), m_version(version), m_data(data) + : m_type(type), m_version(version), m_data(data), m_pos(pos) { - seek(pos); + if (m_pos > m_data.size()) { + throw std::ios_base::failure("VectorReader(...): end of data (m_pos > m_data.size())"); + } } /** @@ -202,14 +198,6 @@ public: memcpy(dst, m_data.data() + m_pos, n); m_pos = pos_next; } - - void seek(size_t n) - { - m_pos += n; - if (m_pos > m_data.size()) { - throw std::ios_base::failure("VectorReader::seek(): end of data"); - } - } }; /** Double ended buffer combining vector and stream-like interfaces. diff --git a/src/test/streams_tests.cpp b/src/test/streams_tests.cpp index 34e0c587ed..8c847f9cd7 100644 --- a/src/test/streams_tests.cpp +++ b/src/test/streams_tests.cpp @@ -103,15 +103,15 @@ BOOST_AUTO_TEST_CASE(streams_vector_reader) BOOST_CHECK_THROW(reader >> d, std::ios_base::failure); // Read a 4 bytes as a signed int from the beginning of the buffer. - reader.seek(-6); - reader >> d; + VectorReader new_reader(SER_NETWORK, INIT_PROTO_VERSION, vch, 0); + new_reader >> d; BOOST_CHECK_EQUAL(d, 67370753); // 1,255,3,4 in little-endian base-256 - BOOST_CHECK_EQUAL(reader.size(), 2); - BOOST_CHECK(!reader.empty()); + BOOST_CHECK_EQUAL(new_reader.size(), 2); + BOOST_CHECK(!new_reader.empty()); // Reading after end of byte vector throws an error even if the reader is // not totally empty. - BOOST_CHECK_THROW(reader >> d, std::ios_base::failure); + BOOST_CHECK_THROW(new_reader >> d, std::ios_base::failure); } BOOST_AUTO_TEST_CASE(streams_vector_reader_rvalue) diff --git a/test/sanitizer_suppressions/ubsan b/test/sanitizer_suppressions/ubsan index d1d752ede7..d55119b266 100644 --- a/test/sanitizer_suppressions/ubsan +++ b/test/sanitizer_suppressions/ubsan @@ -28,7 +28,6 @@ unsigned-integer-overflow:policy/fees.cpp unsigned-integer-overflow:prevector.h unsigned-integer-overflow:script/interpreter.cpp unsigned-integer-overflow:stl_bvector.h -unsigned-integer-overflow:streams.h unsigned-integer-overflow:txmempool.cpp unsigned-integer-overflow:util/strencodings.cpp unsigned-integer-overflow:validation.cpp From 7c3c6ef71f242716240a6e91ce96828e18ba9203 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 4 Feb 2019 19:51:00 +0100 Subject: [PATCH 02/12] Merge #12255: Update bitcoin.service to conform to init.md bad1716c6d30fdf4be6d5050a04e1211f920bbd6 init: Modify docs and add release note for 12255 (Carl Dong) b0c7b54d0c2e116d61e686b1adfdea6a1f7f02fe init: Use systemd automatic directory creation (Carl Dong) Pull request description: - `-datadir` option specified. - Ask systemd to create and set the right mode for PID directory, configuration directory, and data directory. - Tell systemd our group so it will set the right owner for aforementioned directories. More information: https://www.freedesktop.org/software/systemd/man/systemd.exec.html Tree-SHA512: a6fad1efa2be433c1fdd863df3ff232736ed709a9e281f51a003b40987d8c213dc64a52bc13a19c85bf85680e78f0be112ecaf32ac274b1ff93bac84a1208845 --- contrib/init/dashd.service | 34 ++++++++++++++++++---- doc/init.md | 18 +++++++++++- doc/release-notes/release-notes-pr12255.md | 17 +++++++++++ 3 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 doc/release-notes/release-notes-pr12255.md diff --git a/contrib/init/dashd.service b/contrib/init/dashd.service index 574fd4bb41..ed384937b9 100644 --- a/contrib/init/dashd.service +++ b/contrib/init/dashd.service @@ -5,21 +5,45 @@ # See "man systemd.service" for details. # Note that almost all daemon options could be specified in -# /etc/dash/dash.conf +# /etc/dash/dash.conf, except for those explicitly specified as arguments +# in ExecStart= [Unit] Description=Dash daemon After=network.target [Service] -ExecStart=/usr/bin/dashd -daemon -conf=/etc/dash/dash.conf -pid=/run/dashd/dashd.pid -# Creates /run/dash owned by dashcore -RuntimeDirectory=dashd -User=dashcore +ExecStart=/usr/bin/dashd -daemon \ + -pid=/run/dashd/dashd.pid \ + -conf=/etc/dash/dash.conf \ + -datadir=/var/lib/dashd + +# Process management +#################### + Type=forking PIDFile=/run/dashd/dashd.pid Restart=on-failure +# Directory creation and permissions +#################################### + +# Run as dash:dash +User=dashcore +Group=dashcore + +# /run/dashd +RuntimeDirectory=dashd +RuntimeDirectoryMode=0710 + +# /etc/dash +ConfigurationDirectory=dash +ConfigurationDirectoryMode=0710 + +# /var/lib/dashd +StateDirectory=dashd +StateDirectoryMode=0710 + # Hardening measures #################### diff --git a/doc/init.md b/doc/init.md index 3b2cf629a6..3ec428be71 100644 --- a/doc/init.md +++ b/doc/init.md @@ -56,7 +56,7 @@ All three configurations assume several paths that might need to be adjusted. Binary: `/usr/bin/dashd` Configuration file: `/etc/dashcore/dash.conf` Data directory: `/var/lib/dashd` -PID file: `/var/run/dashd/dashd.pid` (OpenRC and Upstart) or `/var/lib/dashd/dashd.pid` (systemd) +PID file: `/var/run/dashd/dashd.pid` (OpenRC and Upstart) or `/run/dashd/dashd.pid` (systemd) Lock file: `/var/lock/subsys/dashd` (CentOS) The configuration file, PID directory (if applicable) and data directory @@ -65,6 +65,22 @@ reasons to make the configuration file and data directory only readable by the dashcore user and group. Access to dash-cli and other dashd rpc clients can then be controlled by group membership. +NOTE: When using the systemd .service file, the creation of the aforementioned +directories and the setting of their permissions is automatically handled by +systemd. Directories are given a permission of 710, giving the dashcore user and group +access to files under it _if_ the files themselves give permission to the +dashcore user and group to do so (e.g. when `-sysperms` is specified). This does not allow +for the listing of files under the directory. + +NOTE: It is not currently possible to override `datadir` in +`/etc/dash/dash.conf` with the current systemd, OpenRC, and Upstart init +files out-of-the-box. This is because the command line options specified in the +init files take precedence over the configurations in +`/etc/dash/dash.conf`. However, some init systems have their own +configuration mechanisms that would allow for overriding the command line +options specified in the init files (e.g. setting `BITCOIND_DATADIR` for +OpenRC). + ### macOS Binary: `/usr/local/bin/dashd` diff --git a/doc/release-notes/release-notes-pr12255.md b/doc/release-notes/release-notes-pr12255.md new file mode 100644 index 0000000000..4e99b30e5b --- /dev/null +++ b/doc/release-notes/release-notes-pr12255.md @@ -0,0 +1,17 @@ +systemd init file +========= + +The systemd init file (`contrib/init/dashd.service`) has been changed to use +`/var/lib/dashd` as the data directory instead of `~dash/.dash`. This +change makes Dash Core more consistent with other services, and makes the +systemd init config more consistent with existing Upstart and OpenRC configs. + +The configuration, PID, and data directories are now completely managed by +systemd, which will take care of their creation, permissions, etc. See +[`systemd.exec (5)`](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#RuntimeDirectory=) +for more details. + +When using the provided init files under `contrib/init`, overriding the +`datadir` option in `/etc/dash/dash.conf` will have no effect. This is +because the command line arguments specified in the init files take precedence +over the options specified in `/etc/dash/dash.conf`. From 03f2c9f8f02ec76b7371c5eb1b843187652634a8 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 6 Feb 2019 16:59:50 +0100 Subject: [PATCH 03/12] Merge #15091: GUI: fix model overlay header sync e8db6b8044424a6fbb4b0a80acffc8c7fbf6be8b Qt: Fix update headers-count (Jonas Schnelli) 7bb45e4b7a71e0ff0e2bbeba5367022758efa5d4 Qt: update header count regardless of update delay (Jonas Schnelli) Pull request description: Update the block and header tip is constraint to have a minimal distance of 250ms between updates... which can lead to miss the last header update. The modal overlay then assumes we are still in header sync and the view get stuck in "syncing headers,..." (while it's actually syncing blocks). This removes the 250ms minimal delta for header updates as well as it fixes the correct display of how header updates should update the labels. Tree-SHA512: 57608dac822b135cd604fc6ba1c80f25c0202a6e20bb140362026615d4bf243ef4fcc254a11bad36419c554a222a2f4947438d4ce44aa14041d1874751643d68 --- src/qt/clientmodel.cpp | 4 ++-- src/qt/modaloverlay.cpp | 8 +++++++- src/qt/modaloverlay.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 6fb1e42e77..2e32e8b3f8 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -263,8 +263,8 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, int heig clientmodel->cachedBestHeaderHeight = height; clientmodel->cachedBestHeaderTime = blockTime; } - // if we are in-sync, update the UI regardless of last update time - if (!initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) { + // if we are in-sync or if we notify a header update, update the UI regardless of last update time + if (fHeader || !initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) { //pass an async signal to the UI thread QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection, Q_ARG(int, height), diff --git a/src/qt/modaloverlay.cpp b/src/qt/modaloverlay.cpp index c43115c04b..bd0d72cb0c 100644 --- a/src/qt/modaloverlay.cpp +++ b/src/qt/modaloverlay.cpp @@ -85,6 +85,7 @@ void ModalOverlay::setKnownBestHeight(int count, const QDateTime& blockDate) if (count > bestHeaderHeight) { bestHeaderHeight = count; bestHeaderDate = blockDate; + UpdateHeaderSyncLabel(); } } @@ -150,11 +151,16 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri if (estimateNumHeadersLeft < HEADER_HEIGHT_DELTA_SYNC && hasBestHeader) { ui->numberOfBlocksLeft->setText(QString::number(bestHeaderHeight - count)); } else { - ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1)...").arg(bestHeaderHeight)); + UpdateHeaderSyncLabel(); ui->expectedTimeLeft->setText(tr("Unknown...")); } } +void ModalOverlay::UpdateHeaderSyncLabel() { + int est_headers_left = bestHeaderDate.secsTo(QDateTime::currentDateTime()) / Params().GetConsensus().nPowTargetSpacing; + ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1, %2%)...").arg(bestHeaderHeight).arg(QString::number(100.0 / (bestHeaderHeight + est_headers_left) * bestHeaderHeight, 'f', 1))); +} + void ModalOverlay::toggleVisibility() { showHide(layerIsVisible, true); diff --git a/src/qt/modaloverlay.h b/src/qt/modaloverlay.h index 122d294bb0..66b4f060f1 100644 --- a/src/qt/modaloverlay.h +++ b/src/qt/modaloverlay.h @@ -47,6 +47,7 @@ private: bool layerIsVisible; bool userClosed; bool foreverHidden; + void UpdateHeaderSyncLabel(); }; #endif // BITCOIN_QT_MODALOVERLAY_H From 7de99cb5add80acda72ca8f0671b6b8ae39ac4ba Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 6 Feb 2019 22:42:26 +0100 Subject: [PATCH 04/12] Merge #15343: [doc] netaddress: Make IPv4 loopback comment more descriptive 87aa0b48afe5a070e6e11e502a1803da6add5197 netaddress: Make IPv4 loopback comment more descriptive (Carl Dong) 6180b5f32bbcd7ef18db772290954161806e609e netaddress: Fix indentation in IsLocal (Carl Dong) Pull request description: This also makes the comment match the IPv6 comment just below this hunk. Tree-SHA512: 9b91195e71e18156c9e013f63a6d430c67951aabb4a0c2f48f3bf852570c13887572b9e2fa52f4e1beba8685a9cae8949d4d03cd618a78f88566cf9e85dc64a8 --- src/netaddress.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netaddress.cpp b/src/netaddress.cpp index 8c4ff4a2af..a8ee84b760 100644 --- a/src/netaddress.cpp +++ b/src/netaddress.cpp @@ -418,7 +418,7 @@ bool CNetAddr::IsLocal() const return true; } - return false; + return false; } bool CNetAddr::IsValid() const From b115016807e75c9fdd8440a77bc96b28d85e71d1 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 7 Feb 2019 10:15:25 -0500 Subject: [PATCH 05/12] Merge #15350: qa: Drop RPC connection if --usecli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6440e61375 qa: Drop RPC connection if --usecli (João Barbosa) Pull request description: Drop the RPC connection used in `TestNode.wait_for_rpc_connection` if `--usecli` is set. If the connection is kept and not used the `Connection: close` header is never sent and so the connection only closes due to timeout (30 sec). It might be sensible to revert e98a9eede2fb48ff33a020acc888cbcd83e24bbf in a follow up, however it changes the shutdown behavior. Tree-SHA512: 2a8ee68b82ab612a556390aae521379e592c39ea0a7855a119282e6fe4cbf02ecafe7a5e2ee37d480f2c0600fa64791117a80fecc7bbe6bbb354107972b3b320 --- test/functional/test_framework/test_node.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 9643f571fb..c0b052dfe0 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -221,12 +221,15 @@ class TestNode(): raise FailedToStartError(self._node_msg( 'dashd exited with status {} during initialization'.format(self.process.returncode))) try: - self.rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.chain, self.rpchost), self.index, timeout=self.rpc_timeout, coveragedir=self.coverage_dir) - self.rpc.getblockcount() + rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.chain, self.rpchost), self.index, timeout=self.rpc_timeout, coveragedir=self.coverage_dir) + rpc.getblockcount() # If the call to getblockcount() succeeds then the RPC connection is up + self.log.debug("RPC successfully started") + if self.use_cli: + return + self.rpc = rpc self.rpc_connected = True self.url = self.rpc.url - self.log.debug("RPC successfully started") return except IOError as e: if e.errno != errno.ECONNREFUSED: # Port not yet open? From eab6110ab69ac86c4d51a22eee076f23d3876a02 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 8 Feb 2019 10:35:06 -0500 Subject: [PATCH 06/12] Merge #15365: wallet: Add lock annotation for mapAddressBook faa46475d7 wallet: Add lock annotation for mapAddressBook (MarcoFalke) Pull request description: This adds lock annotations for `mapAddressBook` and also moves one lock from inside `GetDestValues` to the caller to be in line with the other methods (`eraseDestData`, `addDestData`, ...) Tree-SHA512: cef9397523e2f5717d4a9a6b2da1fe07042484a51b3c067ae64425768637f334350a2c3db4ab7e00af99b2a587f6b656b68ee1195f6a3db6d47298d0b2b6174a --- src/interfaces/wallet.cpp | 1 + src/qt/test/addressbooktests.cpp | 1 + src/wallet/rpcwallet.cpp | 2 +- src/wallet/wallet.cpp | 5 ++--- src/wallet/wallet.h | 14 +++++++------- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 2cdab7c37c..b3501afcc3 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -264,6 +264,7 @@ public: } std::vector getDestValues(const std::string& prefix) override { + LOCK(m_wallet.cs_wallet); return m_wallet.GetDestValues(prefix); } void lockCoin(const COutPoint& output) override diff --git a/src/qt/test/addressbooktests.cpp b/src/qt/test/addressbooktests.cpp index b12d58a1f2..56a4b5ab45 100644 --- a/src/qt/test/addressbooktests.cpp +++ b/src/qt/test/addressbooktests.cpp @@ -92,6 +92,7 @@ void TestAddAddressesToSendBook() } auto check_addbook_size = [wallet](int expected_size) { + LOCK(wallet->cs_wallet); QCOMPARE(static_cast(wallet->mapAddressBook.size()), expected_size); }; diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 0d23aa9e36..0344606ffb 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1726,7 +1726,7 @@ static void MaybePushAddress(UniValue & entry, const CTxDestination &dest) * @param ret The UniValue into which the result is stored. * @param filter The "is mine" filter bool. */ -static void ListTransactions(CWallet * const pwallet, const CWalletTx& wtx, const std::string& strAccount, int nMinDepth, bool fLong, UniValue& ret, const isminefilter& filter) EXCLUSIVE_LOCKS_REQUIRED(cs_main) +static void ListTransactions(CWallet* const pwallet, const CWalletTx& wtx, const std::string& strAccount, int nMinDepth, bool fLong, UniValue& ret, const isminefilter& filter) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pwallet->cs_wallet) { CAmount nFee; std::string strSentAccount; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a4ac6784e9..91bdf84b46 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4165,7 +4165,7 @@ bool CWallet::SetAddressBook(const CTxDestination& address, const std::string& s { bool fUpdated = false; { - LOCK(cs_wallet); // mapAddressBook + LOCK(cs_wallet); std::map::iterator mi = mapAddressBook.find(address); fUpdated = mi != mapAddressBook.end(); mapAddressBook[address].name = strName; @@ -4182,7 +4182,7 @@ bool CWallet::SetAddressBook(const CTxDestination& address, const std::string& s bool CWallet::DelAddressBook(const CTxDestination& address) { { - LOCK(cs_wallet); // mapAddressBook + LOCK(cs_wallet); // Delete destdata tuples associated with address std::string strAddress = EncodeDestination(address); @@ -4916,7 +4916,6 @@ bool CWallet::GetDestData(const CTxDestination &dest, const std::string &key, st std::vector CWallet::GetDestValues(const std::string& prefix) const { - LOCK(cs_wallet); std::vector values; for (const auto& address : mapAddressBook) { for (const auto& data : address.second.destdata) { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index ba9bb6e21e..2f3fda8748 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -905,7 +905,7 @@ public: int64_t nOrderPosNext GUARDED_BY(cs_wallet) = 0; uint64_t nAccountingEntryNumber = 0; - std::map mapAddressBook; + std::map mapAddressBook GUARDED_BY(cs_wallet); std::set setLockedCoins GUARDED_BY(cs_wallet); @@ -1013,15 +1013,15 @@ public: bool LoadCScript(const CScript& redeemScript); //! Adds a destination data tuple to the store, and saves it to disk - bool AddDestData(const CTxDestination &dest, const std::string &key, const std::string &value); + bool AddDestData(const CTxDestination& dest, const std::string& key, const std::string& value) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); //! Erases a destination data tuple in the store and on disk - bool EraseDestData(const CTxDestination &dest, const std::string &key); + bool EraseDestData(const CTxDestination& dest, const std::string& key) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); //! Adds a destination data tuple to the store, without saving it to disk - void LoadDestData(const CTxDestination &dest, const std::string &key, const std::string &value); + void LoadDestData(const CTxDestination& dest, const std::string& key, const std::string& value) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); //! Look up a destination data tuple in the store, return true if found false otherwise - bool GetDestData(const CTxDestination &dest, const std::string &key, std::string *value) const; + bool GetDestData(const CTxDestination& dest, const std::string& key, std::string* value) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); //! Get all destination values matching a prefix. - std::vector GetDestValues(const std::string& prefix) const; + std::vector GetDestValues(const std::string& prefix) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); //! Adds a watch-only address to the store, and saves it to disk. bool AddWatchOnly(const CScript& dest, int64_t nCreateTime) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); @@ -1185,7 +1185,7 @@ public: bool DelAddressBook(const CTxDestination& address); - const std::string& GetLabelName(const CScript& scriptPubKey) const; + const std::string& GetLabelName(const CScript& scriptPubKey) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); void GetScriptForMining(std::shared_ptr &script); From 1de247956ca63f3954abe7aa6e0fd05061d06367 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 8 Feb 2019 10:40:13 -0500 Subject: [PATCH 07/12] Merge #15370: test_runner: Remove unused --force option fae8b8bb1a qa: Add tool-prefix to functional test readme (MarcoFalke) faf3d22725 test_runner: Remove unused --force option (MarcoFalke) Pull request description: When someone calls the script they already have all intention to call it, no need to specify a redundant `--force`. The functional tests are still disabled on the travis windows cross builds, where they'd run into issues when run under Wine. Tree-SHA512: ada0dd9b3c0cd28c5832a12c5e04c029dc3bfe5ddf366fd0abc24fb7914d2e0f0a873fe756ade7ba780a561abe9bc731838c289accc421deda481269e08514cd --- .travis.yml | 3 ++- test/functional/README.md | 1 + test/functional/test_runner.py | 9 --------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7ea3b7dc67..156ad28704 100644 --- a/.travis.yml +++ b/.travis.yml @@ -215,10 +215,11 @@ after_success: BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" - stage: test - name: 'Win64 [GOAL: deploy] [no gui tests]' + name: 'Win64 [GOAL: deploy] [no gui or functional tests]' env: >- HOST=x86_64-w64-mingw32 PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64" + RUN_FUNCTIONAL_TESTS=false GOAL="deploy" BITCOIN_CONFIG="--enable-reduce-exports --disable-gui-tests" diff --git a/test/functional/README.md b/test/functional/README.md index 9b306b410a..84cfced8ee 100644 --- a/test/functional/README.md +++ b/test/functional/README.md @@ -43,6 +43,7 @@ don't have test cases for. - `mining` for tests for mining features, eg `mining_prioritisetransaction.py` - `p2p` for tests that explicitly test the p2p interface, eg `p2p_disconnect_ban.py` - `rpc` for tests for individual RPC methods or features, eg `rpc_listtransactions.py` + - `tool` for tests for tools, eg `tool_wallet.py` - `wallet` for tests for wallet features, eg `wallet_keypool.py` - use an underscore to separate words - exception: for tests for specific RPCs or command line options which don't include underscores, name the test after the exact RPC or argument name, eg `rpc_decodescript.py`, not `rpc_decode_script.py` diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 2fa8978c63..5211086f2a 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -7,8 +7,6 @@ This module calls down into individual test cases via subprocess. It will forward all unrecognized arguments onto the individual test scripts. -Functional tests are disabled on Windows by default. Use --force to run them anyway. - For a description of arguments recognized by test scripts, see `test/functional/test_framework/test_framework.py:BitcoinTestFramework.main`. @@ -236,7 +234,6 @@ def main(): parser.add_argument('--ci', action='store_true', help='Run checks and code that are usually only enabled in a continuous integration environment') parser.add_argument('--exclude', '-x', help='specify a comma-separated-list of scripts to exclude.') parser.add_argument('--extended', action='store_true', help='run the extended test suite in addition to the basic tests') - parser.add_argument('--force', '-f', action='store_true', help='run tests even on platforms where they are disabled by default (e.g. windows).') parser.add_argument('--help', '-h', '-?', action='store_true', help='print help text and exit') parser.add_argument('--jobs', '-j', type=int, default=4, help='how many test scripts to run in parallel. Default=4.') parser.add_argument('--keepcache', '-k', action='store_true', help='the default behavior is to flush the cache directory on startup. --keepcache retains the cache from the previous testrun.') @@ -271,12 +268,6 @@ def main(): enable_utils = config["components"].getboolean("ENABLE_UTILS") enable_bitcoind = config["components"].getboolean("ENABLE_BITCOIND") - if config["environment"]["EXEEXT"] == ".exe" and not args.force: - # https://github.com/bitcoin/bitcoin/commit/d52802551752140cf41f0d9a225a43e84404d3e9 - # https://github.com/bitcoin/bitcoin/pull/5677#issuecomment-136646964 - print("Tests currently disabled on Windows by default. Use --force option to enable") - sys.exit(0) - if not (enable_wallet and enable_utils and enable_bitcoind): print("No functional tests to run. Wallet, utils, and dashd must all be enabled") print("Rerun `configure` with -enable-wallet, -with-utils and -with-daemon and rerun make") From ae4bea60520c5935fabb4e6db7cc919a9505b020 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 8 Feb 2019 14:41:19 -0500 Subject: [PATCH 08/12] Merge #15357: rpc: Don't ignore `-maxtxfee` when wallet is disabled dfbf117bbb Move maxTxFee initialization to init.cpp (Jordan Baczuk) Pull request description: Resolves #15355 Tree-SHA512: 6eafacc6a3b0589fb645b0080fd3c01598566df1bd7ee7929284853866a23493960fbd4d6f9c3417e192f8a21706d9f593197734f6189e046e4747991305a0b8 --- src/init.cpp | 16 ++++++++++++++++ src/wallet/init.cpp | 15 --------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index a9d7e8e608..8444f013a3 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1445,6 +1445,22 @@ bool AppInitParameterInteraction() dustRelayFee = CFeeRate(n); } + // This is required by both the wallet and node + if (gArgs.IsArgSet("-maxtxfee")) + { + CAmount nMaxFee = 0; + if (!ParseMoney(gArgs.GetArg("-maxtxfee", ""), nMaxFee)) + return InitError(AmountErrMsg("maxtxfee", gArgs.GetArg("-maxtxfee", ""))); + if (nMaxFee > HIGH_MAX_TX_FEE) + InitWarning(_("-maxtxfee is set very high! Fees this large could be paid on a single transaction.")); + maxTxFee = nMaxFee; + if (CFeeRate(maxTxFee, 1000) < ::minRelayTxFee) + { + return InitError(strprintf(_("Invalid amount for -maxtxfee=: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)"), + gArgs.GetArg("-maxtxfee", ""), ::minRelayTxFee.ToString())); + } + } + fRequireStandard = !gArgs.GetBoolArg("-acceptnonstdtxn", !chainparams.RequireStandard()); if (chainparams.RequireStandard() && !fRequireStandard) return InitError(strprintf("acceptnonstdtxn is not currently supported for %s chain", chainparams.NetworkIDString())); diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index eec3396cfc..b505003469 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -189,21 +189,6 @@ bool WalletInit::ParameterInteraction() const InitWarning(AmountHighWarn("-minrelaytxfee") + " " + _("The wallet will avoid paying less than the minimum relay fee.")); - if (gArgs.IsArgSet("-maxtxfee")) - { - CAmount nMaxFee = 0; - if (!ParseMoney(gArgs.GetArg("-maxtxfee", ""), nMaxFee)) - return InitError(AmountErrMsg("maxtxfee", gArgs.GetArg("-maxtxfee", ""))); - if (nMaxFee > HIGH_MAX_TX_FEE) - InitWarning(_("-maxtxfee is set very high! Fees this large could be paid on a single transaction.")); - maxTxFee = nMaxFee; - if (CFeeRate(maxTxFee, 1000) < ::minRelayTxFee) - { - return InitError(strprintf(_("Invalid amount for -maxtxfee=: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)"), - gArgs.GetArg("-maxtxfee", ""), ::minRelayTxFee.ToString())); - } - } - if (gArgs.IsArgSet("-walletbackupsdir")) { if (!fs::is_directory(gArgs.GetArg("-walletbackupsdir", ""))) { InitWarning(strprintf(_("Warning: incorrect parameter %s, path must exist! Using default path."), "-walletbackupsdir")); From 7e05caae39358b45ce21b1bb3cdf1adef4b14454 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 11 Feb 2019 08:34:10 -0500 Subject: [PATCH 09/12] Merge #15373: Move ParseConfirmTarget from rpc/mining to rpc/util 50e647210d Move ParseConfirmTarget from rpc/mining to rpc/util (Russell Yanofsky) Pull request description: Util is a better home since it's called both by wallet and mining code. Suggested https://github.com/bitcoin/bitcoin/pull/15288#discussion_r254449444 Tree-SHA512: 4320caf2a3f70d2885c421de04f2ec68ff3f6519258c5155fc46e245dc1765fd15c81f260af5096318f24ff9deb88fc3c5ef40eec8b7393f467f5b963d17215b --- src/rpc/mining.cpp | 10 ---------- src/rpc/mining.h | 3 --- src/rpc/util.cpp | 12 ++++++++++++ src/rpc/util.h | 3 +++ 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index c54dd266df..dbb0892f0c 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -40,16 +40,6 @@ #include #include -unsigned int ParseConfirmTarget(const UniValue& value) -{ - int target = value.get_int(); - unsigned int max_target = ::feeEstimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE); - if (target < 1 || (unsigned int)target > max_target) { - throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid conf_target, must be between %u - %u", 1, max_target)); - } - return (unsigned int)target; -} - /** * Return average network hashes per second based on the last 'lookup' blocks, * or from the last difficulty change if 'lookup' is nonpositive. diff --git a/src/rpc/mining.h b/src/rpc/mining.h index 8d46273159..be9a973315 100644 --- a/src/rpc/mining.h +++ b/src/rpc/mining.h @@ -12,7 +12,4 @@ /** Generate blocks (mine) */ UniValue generateBlocks(std::shared_ptr coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript); -/** Check bounds on a command line confirm target */ -unsigned int ParseConfirmTarget(const UniValue& value); - #endif diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index 149ca16eb6..66707c0fa8 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -4,10 +4,12 @@ #include #include +#include #include #include #include #include +#include // Converts a hex string to a public key if possible CPubKey HexToPubKey(const std::string& hex_in) @@ -92,6 +94,16 @@ UniValue DescribeAddress(const CTxDestination& dest) return boost::apply_visitor(DescribeAddressVisitor(), dest); } +unsigned int ParseConfirmTarget(const UniValue& value) +{ + int target = value.get_int(); + unsigned int max_target = ::feeEstimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE); + if (target < 1 || (unsigned int)target > max_target) { + throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid conf_target, must be between %u - %u", 1, max_target)); + } + return (unsigned int)target; +} + std::string RPCHelpMan::ToString() const { std::string ret; diff --git a/src/rpc/util.h b/src/rpc/util.h index 90185391df..6d2995becb 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -25,6 +25,9 @@ CScript CreateMultisigRedeemscript(const int required, const std::vector Date: Tue, 12 Feb 2019 16:39:27 -0500 Subject: [PATCH 10/12] Merge #15216: Scripts and tools: Replace script name with a special parameter 8c9b8a3668 Replace script name with special parameter (Hennadii Stepanov) Pull request description: This PR improves UX; all others shell scripts ~(excluding travis linters)~ in the bitcoin repo have this feature. Before: ![screenshot from 2019-01-20 17-45-42](https://user-images.githubusercontent.com/32963518/51442159-b5cfec80-1ce2-11e9-8017-3b0b464ccaf8.png) After: ![screenshot from 2019-01-20 18-30-27](https://user-images.githubusercontent.com/32963518/51442166-bf595480-1ce2-11e9-9520-481518c3b288.png) cc: @jamesob @laanwj Tree-SHA512: 7924e5658a2efe81fd5591390ca5af1ff0558bd9d5693363b9f8addedb1d6b90aa16f11c9b361c6fdfbd931a959255817473a240c175dee95aefc7d2d4a10a36 --- test/lint/lint-whitespace.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/lint/lint-whitespace.sh b/test/lint/lint-whitespace.sh index a7b309a000..bd1ead500b 100755 --- a/test/lint/lint-whitespace.sh +++ b/test/lint/lint-whitespace.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (c) 2017 The Bitcoin Core developers +# Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # @@ -12,11 +12,11 @@ export LC_ALL=C while getopts "?" opt; do case $opt in ?) - echo "Usage: .lint-whitespace.sh [N]" - echo " COMMIT_RANGE='' .lint-whitespace.sh" - echo " .lint-whitespace.sh -?" + echo "Usage: $0 [N]" + echo " COMMIT_RANGE='' $0" + echo " $0 -?" echo "Checks unstaged changes, the previous N commits, or a commit range." - echo "COMMIT_RANGE='47ba2c3...ee50c9e' .lint-whitespace.sh" + echo "COMMIT_RANGE='47ba2c3...ee50c9e' $0" exit 0 ;; esac From 06925a14647f72fffcb2ee8f8b9027fab5f7801b Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 15 Feb 2019 07:16:10 -0500 Subject: [PATCH 11/12] Partial Merge #15413: tests: Add missing cs_main locks required when accessing pcoinsdbview, pcoinsTip or pblocktree 543ef7d626 tests: Add missing cs_main locks required when accessing pcoinsdbview, pcoinsTip or pblocktree (practicalswift) Pull request description: Add missing `cs_main` locks required when accessing `pcoinsdbview`, `pcoinsTip` or `pblocktree`. This is a subset of #15192: split up requested by MarcoFalke in https://github.com/bitcoin/bitcoin/pull/15192#issuecomment-462827372. The end goal is to get the corresponding `GUARDED_BY(...)`:s in (see #15192). Tree-SHA512: 0eb1987dba1a2f1faf0910c421f6d90a20b8a253486eb3301d5bca66d128b19120664e3a8580bdce7b428df817284faf94243250bf561f91d2d31a52d134aa67 --- src/test/txvalidationcache_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp index e548a19490..662ec3e3af 100644 --- a/src/test/txvalidationcache_tests.cpp +++ b/src/test/txvalidationcache_tests.cpp @@ -114,7 +114,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup) // should fail. // Capture this interaction with the upgraded_nop argument: set it when evaluating // any script flag that is implemented as an upgraded NOP code. -static void ValidateCheckInputsForAllFlags(const CTransaction &tx, uint32_t failing_flags, bool add_to_cache) +static void ValidateCheckInputsForAllFlags(const CTransaction &tx, uint32_t failing_flags, bool add_to_cache) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { PrecomputedTransactionData txdata(tx); // If we add many more flags, this loop can get too expensive, but we can From 7006a38ba59d6d379e179203576216bbd7076730 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 19 Feb 2019 16:30:36 +0100 Subject: [PATCH 12/12] Merge #15404: [test] Remove -txindex to start nodes 8e4b4f683a0b342cec24cd51b1e98433034ea2ea Address test todos by removing -txindex to nodes. Originally added when updating getrawtransaction to stop searching unspent utxos. (Amiti Uttarwar) Pull request description: Original todos added when removing getrawtransaction default behavior of searching unspent utxos. Tree-SHA512: d080953c3b0d2e5dca2265a15966dc25985a614c9cc86271ecd6276178ce428c85e262c24df92501695c32fed7beec0339b989f03cce91b57fb2efba201b7809 --- doc/REST-interface.md | 3 +- test/functional/interface_rest.py | 35 ++++++++++------------- test/functional/rpc_psbt.py | 8 +++--- test/functional/rpc_rawtransaction.py | 1 - test/functional/test_framework/util.py | 4 +-- test/functional/wallet_abandonconflict.py | 3 +- test/functional/wallet_basic.py | 3 +- 7 files changed, 25 insertions(+), 32 deletions(-) diff --git a/doc/REST-interface.md b/doc/REST-interface.md index 985fb4690c..3f9b0012f8 100644 --- a/doc/REST-interface.md +++ b/doc/REST-interface.md @@ -31,7 +31,8 @@ Supported API Given a transaction hash: returns a transaction in binary, hex-encoded binary, or JSON formats. -For full TX query capability, one must enable the transaction index via "txindex=1" command line / configuration option. +By default, this endpoint will only search the mempool. +To query for a confirmed transaction, enable the transaction index via "txindex=1" command line / configuration option. #### Blocks `GET /rest/block/.` diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py index 6ca1a1666f..266856be2a 100755 --- a/test/functional/interface_rest.py +++ b/test/functional/interface_rest.py @@ -41,8 +41,7 @@ class RESTTest (BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 2 - # TODO: remove -txindex. Currently required for getrawtransaction call. - self.extra_args = [["-rest", "-txindex"], []] + self.extra_args = [["-rest"], []] def test_rest_request(self, uri, http_method='GET', req_type=ReqType.JSON, body='', status=200, ret_type=RetType.JSON): rest_uri = '/rest' + uri @@ -86,15 +85,17 @@ class RESTTest (BitcoinTestFramework): txid = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.1) self.sync_all() - self.nodes[1].generatetoaddress(1, not_related_address) - self.sync_all() - bb_hash = self.nodes[0].getbestblockhash() - assert_equal(self.nodes[1].getbalance(), Decimal("0.1")) - - self.log.info("Load the transaction using the /tx URI") + self.log.info("Test the /tx URI") json_obj = self.test_rest_request("/tx/{}".format(txid)) + assert_equal(json_obj['txid'], txid) + + # Check hex format response + hex_response = self.test_rest_request("/tx/{}".format(txid), req_type=ReqType.HEX, ret_type=RetType.OBJ) + assert_greater_than_or_equal(int(hex_response.getheader('content-length')), + json_obj['size']*2) + spent = (json_obj['vin'][0]['txid'], json_obj['vin'][0]['vout']) # get the vin to later check for utxo (should be spent by then) # get n of 0.1 outpoint n, = filter_output_indices_by_value(json_obj['vout'], Decimal('0.1')) @@ -102,9 +103,14 @@ class RESTTest (BitcoinTestFramework): self.log.info("Query an unspent TXO using the /getutxos URI") - json_obj = self.test_rest_request("/getutxos/{}-{}".format(*spending)) + self.nodes[1].generatetoaddress(1, not_related_address) + self.sync_all() + bb_hash = self.nodes[0].getbestblockhash() + + assert_equal(self.nodes[1].getbalance(), Decimal("0.1")) # Check chainTip response + json_obj = self.test_rest_request("/getutxos/{}-{}".format(*spending)) assert_equal(json_obj['chaintipHash'], bb_hash) # Make sure there is one utxo @@ -269,17 +275,6 @@ class RESTTest (BitcoinTestFramework): json_obj = self.test_rest_request("/headers/5/{}".format(bb_hash)) assert_equal(len(json_obj), 5) # now we should have 5 header objects - self.log.info("Test the /tx URI") - - tx_hash = block_json_obj['tx'][0]['txid'] - json_obj = self.test_rest_request("/tx/{}".format(tx_hash)) - assert_equal(json_obj['txid'], tx_hash) - - # Check hex format response - hex_response = self.test_rest_request("/tx/{}".format(tx_hash), req_type=ReqType.HEX, ret_type=RetType.OBJ) - assert_greater_than_or_equal(int(hex_response.getheader('content-length')), - json_obj['size']*2) - self.log.info("Test tx inclusion in the /mempool and /block URIs") # Make 3 tx and mine them on node 1 diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py index 8ffbf373e2..14266da325 100755 --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -99,11 +99,11 @@ class PSBTTest(BitcoinTestFramework): node1_addr = self.nodes[1].getnewaddress() node2_addr = self.nodes[2].getnewaddress() txid1 = self.nodes[0].sendtoaddress(node1_addr, 13) - txid2 =self.nodes[0].sendtoaddress(node2_addr, 13) - self.nodes[0].generate(6) + txid2 = self.nodes[0].sendtoaddress(node2_addr, 13) + blockhash = self.nodes[0].generate(6)[0] self.sync_all() - vout1 = find_output(self.nodes[1], txid1, 13) - vout2 = find_output(self.nodes[2], txid2, 13) + vout1 = find_output(self.nodes[1], txid1, 13, blockhash=blockhash) + vout2 = find_output(self.nodes[2], txid2, 13, blockhash=blockhash) # Create a psbt spending outputs from nodes 1 and 2 psbt_orig = self.nodes[0].createpsbt([{"txid":txid1, "vout":vout1}, {"txid":txid2, "vout":vout2}], {self.nodes[0].getnewaddress():25.999}) diff --git a/test/functional/rpc_rawtransaction.py b/test/functional/rpc_rawtransaction.py index 3eebc6215d..79c54c5960 100755 --- a/test/functional/rpc_rawtransaction.py +++ b/test/functional/rpc_rawtransaction.py @@ -42,7 +42,6 @@ class RawTransactionsTest(BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 3 - # TODO: remove -txindex. Currently required for getrawtransaction call. self.extra_args = [["-txindex"], ["-txindex"], ["-txindex"]] def setup_network(self): diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 1d10b04b8f..138c9fd9f7 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -505,12 +505,12 @@ def force_finish_mnsync(node): # Transaction/Block functions ############################# -def find_output(node, txid, amount): +def find_output(node, txid, amount, *, blockhash=None): """ Return index to output of txid with value amount Raises exception if there is none. """ - txdata = node.getrawtransaction(txid, 1) + txdata = node.getrawtransaction(txid, 1, blockhash) for i in range(len(txdata["vout"])): if txdata["vout"][i]["value"] == amount: return i diff --git a/test/functional/wallet_abandonconflict.py b/test/functional/wallet_abandonconflict.py index db9e4c08ef..2ec22ee6ef 100755 --- a/test/functional/wallet_abandonconflict.py +++ b/test/functional/wallet_abandonconflict.py @@ -24,8 +24,7 @@ from test_framework.util import ( class AbandonConflictTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 2 - # TODO: remove -txindex. Currently required for getrawtransaction call. - self.extra_args = [["-minrelaytxfee=0.00001", "-txindex"], []] + self.extra_args = [["-minrelaytxfee=0.00001"], []] def run_test(self): self.nodes[1].generate(100) diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py index b71d979ba3..46afffab33 100755 --- a/test/functional/wallet_basic.py +++ b/test/functional/wallet_basic.py @@ -22,8 +22,7 @@ class WalletTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 4 self.setup_clean_chain = True - # TODO: remove -txindex. Currently required for getrawtransaction call. - self.extra_args = [['-txindex', '-usehd={:d}'.format(i%2==0)] for i in range(4)] + self.extra_args = [['-usehd={:d}'.format(i%2==0)] for i in range(4)] def setup_network(self): self.add_nodes(4, self.extra_args)