aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/README.md2
-rw-r--r--contrib/bitcoind.bash-completion2
-rw-r--r--contrib/debian/examples/bitcoin.conf2
-rwxr-xr-xcontrib/gitian-build.sh6
-rw-r--r--contrib/gitian-descriptors/README.md10
-rw-r--r--contrib/gitian-keys/README.md2
-rw-r--r--contrib/init/bitcoind.conf4
-rw-r--r--contrib/init/bitcoind.openrc4
-rw-r--r--contrib/linearize/README.md2
-rw-r--r--contrib/rpm/README.md14
-rw-r--r--doc/REST-interface.md12
-rw-r--r--doc/developer-notes.md2
-rw-r--r--src/addrdb.h2
-rw-r--r--src/chain.h2
-rw-r--r--src/dbwrapper.cpp2
-rw-r--r--src/dbwrapper.h2
-rw-r--r--src/httpserver.cpp2
-rw-r--r--src/init.cpp2
-rw-r--r--src/merkleblock.h2
-rw-r--r--src/miner.cpp2
-rw-r--r--src/miner.h2
-rw-r--r--src/qt/bitcoin.cpp2
-rw-r--r--src/qt/modaloverlay.h2
-rw-r--r--src/qt/networkstyle.cpp2
-rw-r--r--src/qt/optionsmodel.cpp2
-rw-r--r--src/qt/optionsmodel.h14
-rw-r--r--src/qt/paymentserver.cpp2
-rw-r--r--src/qt/paymentserver.h2
-rw-r--r--src/qt/test/paymentservertests.cpp2
-rw-r--r--src/qt/test/paymentservertests.h2
-rw-r--r--src/qt/test/rpcnestedtests.cpp4
-rw-r--r--src/qt/test/test_main.cpp2
-rw-r--r--src/qt/transactionrecord.cpp2
-rw-r--r--src/qt/transactionrecord.h2
-rw-r--r--src/qt/transactiontablemodel.h2
-rw-r--r--src/qt/walletmodeltransaction.cpp8
-rw-r--r--src/qt/walletmodeltransaction.h8
-rw-r--r--src/scheduler.h2
-rw-r--r--src/script/script.h6
-rw-r--r--src/streams.h4
-rw-r--r--src/support/allocators/secure.h8
-rw-r--r--src/support/allocators/zeroafterfree.h8
-rw-r--r--src/sync.h2
-rw-r--r--src/test/blockencodings_tests.cpp2
-rw-r--r--src/test/coins_tests.cpp6
-rw-r--r--src/test/data/tx_invalid.json2
-rw-r--r--src/test/prevector_tests.cpp4
-rw-r--r--src/test/script_tests.cpp2
-rw-r--r--src/txmempool.h2
-rw-r--r--src/versionbits.cpp2
-rw-r--r--src/wallet/db.cpp12
-rw-r--r--src/wallet/db.h2
-rw-r--r--src/wallet/rpcwallet.cpp4
-rw-r--r--src/wallet/wallet.cpp2
-rwxr-xr-xtest/functional/blockchain.py4
-rwxr-xr-xtest/functional/bumpfee.py5
-rwxr-xr-xtest/functional/example_test.py2
-rwxr-xr-xtest/functional/fundrawtransaction.py3
-rwxr-xr-xtest/functional/getblocktemplate_longpoll.py2
-rwxr-xr-xtest/functional/keypool.py3
-rwxr-xr-xtest/functional/multiwallet.py12
-rwxr-xr-xtest/functional/net.py2
-rwxr-xr-xtest/functional/pruning.py4
-rwxr-xr-xtest/functional/rawtransactions.py2
-rwxr-xr-xtest/functional/rpcbind_test.py4
-rwxr-xr-xtest/functional/test_framework/test_framework.py115
-rwxr-xr-xtest/functional/test_framework/test_node.py134
-rw-r--r--test/functional/test_framework/util.py4
-rwxr-xr-xtest/functional/test_runner.py4
-rwxr-xr-xtest/functional/wallet-dump.py3
-rwxr-xr-xtest/functional/wallet-encryption.py3
71 files changed, 310 insertions, 204 deletions
diff --git a/contrib/README.md b/contrib/README.md
index 6f750106e4..34c4cfc55a 100644
--- a/contrib/README.md
+++ b/contrib/README.md
@@ -35,7 +35,7 @@ PGP keys used for signing Bitcoin Core [Gitian release](/doc/release-process.md)
Scripts and notes for Mac builds.
### [RPM](/contrib/rpm) ###
-RPM spec file for building bitcoin-core on RPM based distributions
+RPM spec file for building bitcoin-core on RPM based distributions.
### [Gitian-build](/contrib/gitian-build.sh) ###
Script for running full Gitian builds.
diff --git a/contrib/bitcoind.bash-completion b/contrib/bitcoind.bash-completion
index af87e97d80..cccd4bde0d 100644
--- a/contrib/bitcoind.bash-completion
+++ b/contrib/bitcoind.bash-completion
@@ -30,7 +30,7 @@ _bitcoind() {
;;
*)
- # only parse -help if senseful
+ # only parse -help if sensible
if [[ -z "$cur" || "$cur" =~ ^- ]]; then
local helpopts
helpopts=$($bitcoind -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' )
diff --git a/contrib/debian/examples/bitcoin.conf b/contrib/debian/examples/bitcoin.conf
index 1029a51073..14a59fdf6b 100644
--- a/contrib/debian/examples/bitcoin.conf
+++ b/contrib/debian/examples/bitcoin.conf
@@ -76,7 +76,7 @@
#rpcuser=Ulysseys
#rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593
#
-# The second method `rpcauth` can be added to server startup argument. It is set at intialization time
+# The second method `rpcauth` can be added to server startup argument. It is set at initialization time
# using the output from the script in share/rpcuser/rpcuser.py after providing a username:
#
# ./share/rpcuser/rpcuser.py alice
diff --git a/contrib/gitian-build.sh b/contrib/gitian-build.sh
index 6ee5df4703..d94c7f4f8e 100755
--- a/contrib/gitian-build.sh
+++ b/contrib/gitian-build.sh
@@ -40,15 +40,15 @@ version Version number, commit, or branch to build. If building a commit or bra
Options:
-c|--commit Indicate that the version argument is for a commit or branch
-u|--url Specify the URL of the repository. Default is https://github.com/bitcoin/bitcoin
--v|--verify Verify the gitian build
--b|--build Do a gitian build
+-v|--verify Verify the Gitian build
+-b|--build Do a Gitian build
-s|--sign Make signed binaries for Windows and Mac OSX
-B|--buildsign Build both signed and unsigned binaries
-o|--os Specify which Operating Systems the build is for. Default is lwx. l for linux, w for windows, x for osx
-j Number of processes to use. Default 2
-m Memory to allocate in MiB. Default 2000
--kvm Use KVM instead of LXC
---setup Setup the gitian building environment. Uses KVM. If you want to use lxc, use the --lxc option. Only works on Debian-based systems (Ubuntu, Debian)
+--setup Set up the Gitian building environment. Uses KVM. If you want to use lxc, use the --lxc option. Only works on Debian-based systems (Ubuntu, Debian)
--detach-sign Create the assert file for detached signing. Will not commit anything.
--no-commit Do not commit anything to git
-h|--help Print this help message
diff --git a/contrib/gitian-descriptors/README.md b/contrib/gitian-descriptors/README.md
index 6149706596..d9dbfd3cb3 100644
--- a/contrib/gitian-descriptors/README.md
+++ b/contrib/gitian-descriptors/README.md
@@ -1,4 +1,4 @@
-### Gavin's notes on getting gitian builds up and running using KVM
+### Gavin's notes on getting Gitian builds up and running using KVM
These instructions distilled from
[https://help.ubuntu.com/community/KVM/Installation](https://help.ubuntu.com/community/KVM/Installation).
@@ -56,10 +56,10 @@ Here's a description of Gavin's setup on OSX 10.6:
4. Inside the running Ubuntu desktop, install:
- sudo apt-get install debootstrap lxc ruby apache2 git apt-cacher-ng python-vm-builder
+ sudo apt-get install debootstrap lxc ruby apache2 git apt-cacher-ng python-vm-builder
5. Still inside Ubuntu, tell gitian-builder to use LXC, then follow the "Once you've got the right hardware and software" instructions above:
- export USE_LXC=1
- git clone git://github.com/bitcoin/bitcoin.git
- ... etc
+ export USE_LXC=1
+ git clone git://github.com/bitcoin/bitcoin.git
+ ... etc
diff --git a/contrib/gitian-keys/README.md b/contrib/gitian-keys/README.md
index 439910330d..4b0b7a2615 100644
--- a/contrib/gitian-keys/README.md
+++ b/contrib/gitian-keys/README.md
@@ -3,7 +3,7 @@ PGP keys
This folder contains the public keys of developers and active contributors.
-The keys are mainly used to sign git commits or the build results of gitian
+The keys are mainly used to sign git commits or the build results of Gitian
builds.
You can import the keys into gpg as follows. Also, make sure to fetch the
diff --git a/contrib/init/bitcoind.conf b/contrib/init/bitcoind.conf
index f9554eecde..de4ea0ed52 100644
--- a/contrib/init/bitcoind.conf
+++ b/contrib/init/bitcoind.conf
@@ -30,12 +30,12 @@ pre-start script
echo
echo "This password is security critical to securing wallets "
echo "and must not be the same as the rpcuser setting."
- echo "You can generate a suitable random password using the following"
+ echo "You can generate a suitable random password using the following "
echo "command from the shell:"
echo
echo "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'"
echo
- echo "It is also recommended that you also set alertnotify so you are "
+ echo "It is recommended that you also set alertnotify so you are "
echo "notified of problems:"
echo
echo "ie: alertnotify=echo %%s | mail -s \"Bitcoin Alert\"" \
diff --git a/contrib/init/bitcoind.openrc b/contrib/init/bitcoind.openrc
index eda1a96fb4..50377c0995 100644
--- a/contrib/init/bitcoind.openrc
+++ b/contrib/init/bitcoind.openrc
@@ -76,12 +76,12 @@ checkconfig()
eerror ""
eerror "This password is security critical to securing wallets "
eerror "and must not be the same as the rpcuser setting."
- eerror "You can generate a suitable random password using the following"
+ eerror "You can generate a suitable random password using the following "
eerror "command from the shell:"
eerror ""
eerror "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'"
eerror ""
- eerror "It is also recommended that you also set alertnotify so you are "
+ eerror "It is recommended that you also set alertnotify so you are "
eerror "notified of problems:"
eerror ""
eerror "ie: alertnotify=echo %%s | mail -s \"Bitcoin Alert\"" \
diff --git a/contrib/linearize/README.md b/contrib/linearize/README.md
index f2a2ab2768..2985106982 100644
--- a/contrib/linearize/README.md
+++ b/contrib/linearize/README.md
@@ -46,7 +46,7 @@ linearize-hashes.py.
(Default: `1000*1000*1000 bytes`)
* `netmagic`: Network magic number.
* `out_of_order_cache_sz`: If out-of-order blocks are being read, the block can
-be written to a cache so that the blockchain doesn't have to be seeked again.
+be written to a cache so that the blockchain doesn't have to be sought again.
This option specifies the cache size. (Default: `100*1000*1000 bytes`)
* `rev_hash_bytes`: If true, the block hash list written by linearize-hashes.py
will be byte-reversed when read by linearize-data.py. See the linearize-hashes
diff --git a/contrib/rpm/README.md b/contrib/rpm/README.md
index 4ab2f35680..e1e0745fd6 100644
--- a/contrib/rpm/README.md
+++ b/contrib/rpm/README.md
@@ -84,16 +84,16 @@ If you would prefer not to build the GUI at all, you can pass the switch
The desktop and KDE meta files are created in the spec file itself with the
`cat` command. This is done to allow easy distribution specific changes without
-needing to use any patches. A specific time stamp is given to the files so that
+needing to use any patches. A specific timestamp is given to the files so that
it does not they do not appear to have been updated every time the package is
-built. If you do make changes to them, you probably should update time stamp
-assigned to them in the `touch` command that specifies the time stamp.
+built. If you do make changes to them, you probably should update timestamp
+assigned to them in the `touch` command that specifies the timestamp.
## SVG, PNG, and XPM Icons
The `bitcoin.svg` file is from the source listed as `Source100`. It is used as
the source for the PNG and XPM files. The generated PNG and XPM files are given
-the same time stamp as the source SVG file as a means of indicating they are
+the same timestamp as the source SVG file as a means of indicating they are
derived from it.
## Systemd
@@ -105,10 +105,10 @@ distributions that still receive vendor updates do in fact use systemd.
The files to control the service are created in the RPM spec file itself using
the `cat` command. This is done to make it easy to modify for other
distributions that may implement things differently without needing to patch
-source. A specific time stamp is given to the files so that they do not appear
+source. A specific timestamp is given to the files so that they do not appear
to have been updated every time the package is built. If you do make changes to
-them, you probably should update the time stamp assigned to them in the `touch`
-command that specifies the time stamp.
+them, you probably should update the timestamp assigned to them in the `touch`
+command that specifies the timestamp.
## SELinux
diff --git a/doc/REST-interface.md b/doc/REST-interface.md
index caf6782886..7a17c175bd 100644
--- a/doc/REST-interface.md
+++ b/doc/REST-interface.md
@@ -8,14 +8,14 @@ The interface runs on the same port as the JSON-RPC interface, by default port 8
Supported API
-------------
-####Transactions
+#### Transactions
`GET /rest/tx/<TX-HASH>.<bin|hex|json>`
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.
-####Blocks
+#### Blocks
`GET /rest/block/<BLOCK-HASH>.<bin|hex|json>`
`GET /rest/block/notxdetails/<BLOCK-HASH>.<bin|hex|json>`
@@ -25,12 +25,12 @@ The HTTP request and response are both handled entirely in-memory, thus making m
With the /notxdetails/ option JSON response will only contain the transaction hash instead of the complete transaction details. The option only affects the JSON response.
-####Blockheaders
+#### Blockheaders
`GET /rest/headers/<COUNT>/<BLOCK-HASH>.<bin|hex|json>`
Given a block hash: returns <COUNT> amount of blockheaders in upward direction.
-####Chaininfos
+#### Chaininfos
`GET /rest/chaininfo.json`
Returns various state info regarding block chain processing.
@@ -48,7 +48,7 @@ Only supports JSON as output format.
* softforks : (array) status of softforks in progress
* bip9_softforks : (object) status of BIP9 softforks in progress
-####Query UTXO set
+#### Query UTXO set
`GET /rest/getutxos/<checkmempool>/<txid>-<n>/<txid>-<n>/.../<txid>-<n>.<bin|hex|json>`
The getutxo command allows querying of the UTXO set given a set of outpoints.
@@ -81,7 +81,7 @@ $ curl localhost:18332/rest/getutxos/checkmempool/b2cdfd7b89def827ff8af7cd9bff76
}
```
-####Memory pool
+#### Memory pool
`GET /rest/mempool/info.json`
Returns various information about the TX mempool.
diff --git a/doc/developer-notes.md b/doc/developer-notes.md
index d783a7a8ae..461d7e1dc6 100644
--- a/doc/developer-notes.md
+++ b/doc/developer-notes.md
@@ -4,7 +4,7 @@ Developer Notes
Various coding styles have been used during the history of the codebase,
and the result is not very consistent. However, we're now trying to converge to
a single style, which is specified below. When writing patches, favor the new
-style over attempting to mimick the surrounding style, except for move-only
+style over attempting to mimic the surrounding style, except for move-only
commits.
Do not submit patches solely to modify the style of existing code.
diff --git a/src/addrdb.h b/src/addrdb.h
index 6cb36dfac4..8105ebc9b3 100644
--- a/src/addrdb.h
+++ b/src/addrdb.h
@@ -61,7 +61,7 @@ public:
banReason = BanReasonUnknown;
}
- std::string banReasonToString()
+ std::string banReasonToString() const
{
switch (banReason) {
case BanReasonNodeMisbehaving:
diff --git a/src/chain.h b/src/chain.h
index 1223539e73..02db9ec771 100644
--- a/src/chain.h
+++ b/src/chain.h
@@ -216,7 +216,7 @@ public:
//! (memory only) Sequential id assigned to distinguish order in which blocks are received.
int32_t nSequenceId;
- //! (memory only) Maximum nTime in the chain upto and including this block.
+ //! (memory only) Maximum nTime in the chain up to and including this block.
unsigned int nTimeMax;
void SetNull()
diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp
index 3e72c5bb9b..72eeeef2c3 100644
--- a/src/dbwrapper.cpp
+++ b/src/dbwrapper.cpp
@@ -190,7 +190,7 @@ bool CDBWrapper::IsEmpty()
}
CDBIterator::~CDBIterator() { delete piter; }
-bool CDBIterator::Valid() { return piter->Valid(); }
+bool CDBIterator::Valid() const { return piter->Valid(); }
void CDBIterator::SeekToFirst() { piter->SeekToFirst(); }
void CDBIterator::Next() { piter->Next(); }
diff --git a/src/dbwrapper.h b/src/dbwrapper.h
index 7575d207ae..54092f9f59 100644
--- a/src/dbwrapper.h
+++ b/src/dbwrapper.h
@@ -130,7 +130,7 @@ public:
parent(_parent), piter(_piter) { };
~CDBIterator();
- bool Valid();
+ bool Valid() const;
void SeekToFirst();
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index 86b37f79bb..ba3b0d1a68 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -416,7 +416,7 @@ bool InitHTTPServer()
LogPrintf("HTTP: creating work queue of depth %d\n", workQueueDepth);
workQueue = new WorkQueue<HTTPClosure>(workQueueDepth);
- // tranfer ownership to eventBase/HTTP via .release()
+ // transfer ownership to eventBase/HTTP via .release()
eventBase = base_ctr.release();
eventHTTP = http_ctr.release();
return true;
diff --git a/src/init.cpp b/src/init.cpp
index d79c2967b9..f9a63348fd 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -69,7 +69,7 @@
bool fFeeEstimatesInitialized = false;
static const bool DEFAULT_PROXYRANDOMIZE = true;
static const bool DEFAULT_REST_ENABLE = false;
-static const bool DEFAULT_DISABLE_SAFEMODE = false;
+static const bool DEFAULT_DISABLE_SAFEMODE = true;
static const bool DEFAULT_STOPAFTERBLOCKIMPORT = false;
std::unique_ptr<CConnman> g_connman;
diff --git a/src/merkleblock.h b/src/merkleblock.h
index f590c487de..20f2b36886 100644
--- a/src/merkleblock.h
+++ b/src/merkleblock.h
@@ -63,7 +63,7 @@ protected:
bool fBad;
/** helper function to efficiently calculate the number of nodes at given height in the merkle tree */
- unsigned int CalcTreeWidth(int height) {
+ unsigned int CalcTreeWidth(int height) const {
return (nTransactions+(1 << height)-1) >> height;
}
diff --git a/src/miner.cpp b/src/miner.cpp
index 403d3d4e4a..f1942ec570 100644
--- a/src/miner.cpp
+++ b/src/miner.cpp
@@ -224,7 +224,7 @@ void BlockAssembler::onlyUnconfirmed(CTxMemPool::setEntries& testSet)
}
}
-bool BlockAssembler::TestPackage(uint64_t packageSize, int64_t packageSigOpsCost)
+bool BlockAssembler::TestPackage(uint64_t packageSize, int64_t packageSigOpsCost) const
{
// TODO: switch to weight-based accounting for packages instead of vsize-based accounting.
if (nBlockWeight + WITNESS_SCALE_FACTOR * packageSize >= nBlockMaxWeight)
diff --git a/src/miner.h b/src/miner.h
index 5c9cfd78f0..685b4e0cc8 100644
--- a/src/miner.h
+++ b/src/miner.h
@@ -187,7 +187,7 @@ private:
/** Remove confirmed (inBlock) entries from given set */
void onlyUnconfirmed(CTxMemPool::setEntries& testSet);
/** Test if a new package would "fit" in the block */
- bool TestPackage(uint64_t packageSize, int64_t packageSigOpsCost);
+ bool TestPackage(uint64_t packageSize, int64_t packageSigOpsCost) const;
/** Perform checks on each transaction in a package:
* locktime, premature-witness, serialized size (if necessary)
* These checks should always succeed, and they're here
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index 2b6bd354a0..3fd58a2f9a 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -227,7 +227,7 @@ public:
void requestShutdown();
/// Get process return value
- int getReturnValue() { return returnValue; }
+ int getReturnValue() const { return returnValue; }
/// Get window identifier of QMainWindow (BitcoinGUI)
WId getMainWinId() const;
diff --git a/src/qt/modaloverlay.h b/src/qt/modaloverlay.h
index 21ccdbd839..cda23f9540 100644
--- a/src/qt/modaloverlay.h
+++ b/src/qt/modaloverlay.h
@@ -32,7 +32,7 @@ public Q_SLOTS:
// will show or hide the modal layer
void showHide(bool hide = false, bool userRequested = false);
void closeClicked();
- bool isLayerVisible() { return layerIsVisible; }
+ bool isLayerVisible() const { return layerIsVisible; }
protected:
bool eventFilter(QObject * obj, QEvent * ev);
diff --git a/src/qt/networkstyle.cpp b/src/qt/networkstyle.cpp
index 93092501c9..4b81c54d36 100644
--- a/src/qt/networkstyle.cpp
+++ b/src/qt/networkstyle.cpp
@@ -44,7 +44,7 @@ NetworkStyle::NetworkStyle(const QString &_appName, const int iconColorHueShift,
// loop through pixels
for(int x=0;x<img.width();x++)
{
- // preserve alpha because QColor::getHsl doesen't return the alpha value
+ // preserve alpha because QColor::getHsl doesn't return the alpha value
a = qAlpha(scL[x]);
QColor col(scL[x]);
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 77efef3e3c..e9960a01b1 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -441,7 +441,7 @@ void OptionsModel::setRestartRequired(bool fRequired)
return settings.setValue("fRestartRequired", fRequired);
}
-bool OptionsModel::isRestartRequired()
+bool OptionsModel::isRestartRequired() const
{
QSettings settings;
return settings.value("fRestartRequired", false).toBool();
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h
index 78529fbdcc..0ac82a4148 100644
--- a/src/qt/optionsmodel.h
+++ b/src/qt/optionsmodel.h
@@ -59,18 +59,18 @@ public:
void setDisplayUnit(const QVariant &value);
/* Explicit getters */
- bool getHideTrayIcon() { return fHideTrayIcon; }
- bool getMinimizeToTray() { return fMinimizeToTray; }
- bool getMinimizeOnClose() { return fMinimizeOnClose; }
- int getDisplayUnit() { return nDisplayUnit; }
- QString getThirdPartyTxUrls() { return strThirdPartyTxUrls; }
+ bool getHideTrayIcon() const { return fHideTrayIcon; }
+ bool getMinimizeToTray() const { return fMinimizeToTray; }
+ bool getMinimizeOnClose() const { return fMinimizeOnClose; }
+ int getDisplayUnit() const { return nDisplayUnit; }
+ QString getThirdPartyTxUrls() const { return strThirdPartyTxUrls; }
bool getProxySettings(QNetworkProxy& proxy) const;
- bool getCoinControlFeatures() { return fCoinControlFeatures; }
+ bool getCoinControlFeatures() const { return fCoinControlFeatures; }
const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; }
/* Restart flag helper */
void setRestartRequired(bool fRequired);
- bool isRestartRequired();
+ bool isRestartRequired() const;
private:
/* Qt-only settings */
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp
index 67fe320185..d4137d280f 100644
--- a/src/qt/paymentserver.cpp
+++ b/src/qt/paymentserver.cpp
@@ -620,7 +620,7 @@ void PaymentServer::fetchRequest(const QUrl& url)
netManager->get(netRequest);
}
-void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipient, QByteArray transaction)
+void PaymentServer::fetchPaymentACK(CWallet* wallet, const SendCoinsRecipient& recipient, QByteArray transaction)
{
const payments::PaymentDetails& details = recipient.paymentRequest.getDetails();
if (!details.has_payment_url())
diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h
index 2fe6e3e7b1..f845c4c7c8 100644
--- a/src/qt/paymentserver.h
+++ b/src/qt/paymentserver.h
@@ -113,7 +113,7 @@ public Q_SLOTS:
void uiReady();
// Submit Payment message to a merchant, get back PaymentACK:
- void fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipient, QByteArray transaction);
+ void fetchPaymentACK(CWallet* wallet, const SendCoinsRecipient& recipient, QByteArray transaction);
// Handle an incoming URI, URI with local file scheme or file
void handleURIOrFile(const QString& s);
diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp
index d9fb869821..c7830071ed 100644
--- a/src/qt/test/paymentservertests.cpp
+++ b/src/qt/test/paymentservertests.cpp
@@ -205,7 +205,7 @@ void PaymentServerTests::paymentServerTests()
delete server;
}
-void RecipientCatcher::getRecipient(SendCoinsRecipient r)
+void RecipientCatcher::getRecipient(const SendCoinsRecipient& r)
{
recipient = r;
}
diff --git a/src/qt/test/paymentservertests.h b/src/qt/test/paymentservertests.h
index 9ffcbb02ac..faf167f2c6 100644
--- a/src/qt/test/paymentservertests.h
+++ b/src/qt/test/paymentservertests.h
@@ -26,7 +26,7 @@ class RecipientCatcher : public QObject
Q_OBJECT
public Q_SLOTS:
- void getRecipient(SendCoinsRecipient r);
+ void getRecipient(const SendCoinsRecipient& r);
public:
SendCoinsRecipient recipient;
diff --git a/src/qt/test/rpcnestedtests.cpp b/src/qt/test/rpcnestedtests.cpp
index e2abfb3742..cd9ab23457 100644
--- a/src/qt/test/rpcnestedtests.cpp
+++ b/src/qt/test/rpcnestedtests.cpp
@@ -69,13 +69,13 @@ void RPCNestedTests::rpcNestedTests()
RPCConsole::RPCExecuteCommandLine(result, "getblockchaininfo "); //whitespace at the end will be tolerated
QVERIFY(result.substr(0,1) == "{");
- (RPCConsole::RPCExecuteCommandLine(result, "getblockchaininfo()[\"chain\"]")); //Quote path identifier are allowed, but look after a child contaning the quotes in the key
+ (RPCConsole::RPCExecuteCommandLine(result, "getblockchaininfo()[\"chain\"]")); //Quote path identifier are allowed, but look after a child containing the quotes in the key
QVERIFY(result == "null");
(RPCConsole::RPCExecuteCommandLine(result, "createrawtransaction [] {} 0")); //parameter not in brackets are allowed
(RPCConsole::RPCExecuteCommandLine(result2, "createrawtransaction([],{},0)")); //parameter in brackets are allowed
QVERIFY(result == result2);
- (RPCConsole::RPCExecuteCommandLine(result2, "createrawtransaction( [], {} , 0 )")); //whitespace between parametres is allowed
+ (RPCConsole::RPCExecuteCommandLine(result2, "createrawtransaction( [], {} , 0 )")); //whitespace between parameters is allowed
QVERIFY(result == result2);
RPCConsole::RPCExecuteCommandLine(result, "getblock(getbestblockhash())[tx][0]", &filtered);
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp
index 1b28a285f1..80a00a634a 100644
--- a/src/qt/test/test_main.cpp
+++ b/src/qt/test/test_main.cpp
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
bool fInvalid = false;
// Prefer the "minimal" platform for the test instead of the normal default
- // platform ("xcb", "windows", or "cocoa") so tests can't unintentially
+ // platform ("xcb", "windows", or "cocoa") so tests can't unintentionally
// interfere with any background GUIs and don't require extra resources.
#if defined(WIN32)
_putenv_s("QT_QPA_PLATFORM", "minimal");
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp
index 2ece0d0f28..36d98ce49d 100644
--- a/src/qt/transactionrecord.cpp
+++ b/src/qt/transactionrecord.cpp
@@ -248,7 +248,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
status.needsUpdate = false;
}
-bool TransactionRecord::statusUpdateNeeded()
+bool TransactionRecord::statusUpdateNeeded() const
{
AssertLockHeld(cs_main);
return status.cur_num_blocks != chainActive.Height() || status.needsUpdate;
diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h
index 59f681224f..a26e676142 100644
--- a/src/qt/transactionrecord.h
+++ b/src/qt/transactionrecord.h
@@ -140,7 +140,7 @@ public:
/** Return whether a status update is needed.
*/
- bool statusUpdateNeeded();
+ bool statusUpdateNeeded() const;
};
#endif // BITCOIN_QT_TRANSACTIONRECORD_H
diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h
index 80aeb64c41..b1f81498b2 100644
--- a/src/qt/transactiontablemodel.h
+++ b/src/qt/transactiontablemodel.h
@@ -79,7 +79,7 @@ public:
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const;
- bool processingQueuedTransactions() { return fProcessingQueuedTransactions; }
+ bool processingQueuedTransactions() const { return fProcessingQueuedTransactions; }
private:
CWallet* wallet;
diff --git a/src/qt/walletmodeltransaction.cpp b/src/qt/walletmodeltransaction.cpp
index 8bc9ef725e..eae2c27f8a 100644
--- a/src/qt/walletmodeltransaction.cpp
+++ b/src/qt/walletmodeltransaction.cpp
@@ -22,12 +22,12 @@ WalletModelTransaction::~WalletModelTransaction()
delete walletTransaction;
}
-QList<SendCoinsRecipient> WalletModelTransaction::getRecipients()
+QList<SendCoinsRecipient> WalletModelTransaction::getRecipients() const
{
return recipients;
}
-CWalletTx *WalletModelTransaction::getTransaction()
+CWalletTx *WalletModelTransaction::getTransaction() const
{
return walletTransaction;
}
@@ -37,7 +37,7 @@ unsigned int WalletModelTransaction::getTransactionSize()
return (!walletTransaction ? 0 : ::GetVirtualTransactionSize(*walletTransaction));
}
-CAmount WalletModelTransaction::getTransactionFee()
+CAmount WalletModelTransaction::getTransactionFee() const
{
return fee;
}
@@ -79,7 +79,7 @@ void WalletModelTransaction::reassignAmounts(int nChangePosRet)
}
}
-CAmount WalletModelTransaction::getTotalTransactionAmount()
+CAmount WalletModelTransaction::getTotalTransactionAmount() const
{
CAmount totalTransactionAmount = 0;
for (const SendCoinsRecipient &rcp : recipients)
diff --git a/src/qt/walletmodeltransaction.h b/src/qt/walletmodeltransaction.h
index 64922efada..d7ecd7aa8c 100644
--- a/src/qt/walletmodeltransaction.h
+++ b/src/qt/walletmodeltransaction.h
@@ -22,15 +22,15 @@ public:
explicit WalletModelTransaction(const QList<SendCoinsRecipient> &recipients);
~WalletModelTransaction();
- QList<SendCoinsRecipient> getRecipients();
+ QList<SendCoinsRecipient> getRecipients() const;
- CWalletTx *getTransaction();
+ CWalletTx *getTransaction() const;
unsigned int getTransactionSize();
void setTransactionFee(const CAmount& newFee);
- CAmount getTransactionFee();
+ CAmount getTransactionFee() const;
- CAmount getTotalTransactionAmount();
+ CAmount getTotalTransactionAmount() const;
void newPossibleKeyChange(CWallet *wallet);
CReserveKey *getPossibleKeyChange();
diff --git a/src/scheduler.h b/src/scheduler.h
index 0365d668b2..cc2f01f2ff 100644
--- a/src/scheduler.h
+++ b/src/scheduler.h
@@ -81,7 +81,7 @@ private:
int nThreadsServicingQueue;
bool stopRequested;
bool stopWhenEmpty;
- bool shouldStop() { return stopRequested || (stopWhenEmpty && taskQueue.empty()); }
+ bool shouldStop() const { return stopRequested || (stopWhenEmpty && taskQueue.empty()); }
};
/**
diff --git a/src/script/script.h b/src/script/script.h
index 711ffa97f8..587f2d26eb 100644
--- a/src/script/script.h
+++ b/src/script/script.h
@@ -377,6 +377,12 @@ private:
int64_t m_value;
};
+/**
+ * We use a prevector for the script to reduce the considerable memory overhead
+ * of vectors in cases where they normally contain a small number of small elements.
+ * Tests in October 2015 showed use of this reduced dbcache memory usage by 23%
+ * and made an initial sync 13% faster.
+ */
typedef prevector<28, unsigned char> CScriptBase;
/** Serialized script, used inside transaction inputs and outputs */
diff --git a/src/streams.h b/src/streams.h
index a9668b68bc..a3fc919714 100644
--- a/src/streams.h
+++ b/src/streams.h
@@ -332,7 +332,7 @@ public:
//
bool eof() const { return size() == 0; }
CDataStream* rdbuf() { return this; }
- int in_avail() { return size(); }
+ int in_avail() const { return size(); }
void SetType(int n) { nType = n; }
int GetType() const { return nType; }
@@ -648,7 +648,7 @@ public:
}
// return the current reading position
- uint64_t GetPos() {
+ uint64_t GetPos() const {
return nReadPos;
}
diff --git a/src/support/allocators/secure.h b/src/support/allocators/secure.h
index f20f424941..39347c73bb 100644
--- a/src/support/allocators/secure.h
+++ b/src/support/allocators/secure.h
@@ -26,13 +26,13 @@ struct secure_allocator : public std::allocator<T> {
typedef typename base::reference reference;
typedef typename base::const_reference const_reference;
typedef typename base::value_type value_type;
- secure_allocator() throw() {}
- secure_allocator(const secure_allocator& a) throw() : base(a) {}
+ secure_allocator() noexcept {}
+ secure_allocator(const secure_allocator& a) noexcept : base(a) {}
template <typename U>
- secure_allocator(const secure_allocator<U>& a) throw() : base(a)
+ secure_allocator(const secure_allocator<U>& a) noexcept : base(a)
{
}
- ~secure_allocator() throw() {}
+ ~secure_allocator() noexcept {}
template <typename _Other>
struct rebind {
typedef secure_allocator<_Other> other;
diff --git a/src/support/allocators/zeroafterfree.h b/src/support/allocators/zeroafterfree.h
index 581d5d6318..618874ceee 100644
--- a/src/support/allocators/zeroafterfree.h
+++ b/src/support/allocators/zeroafterfree.h
@@ -22,13 +22,13 @@ struct zero_after_free_allocator : public std::allocator<T> {
typedef typename base::reference reference;
typedef typename base::const_reference const_reference;
typedef typename base::value_type value_type;
- zero_after_free_allocator() throw() {}
- zero_after_free_allocator(const zero_after_free_allocator& a) throw() : base(a) {}
+ zero_after_free_allocator() noexcept {}
+ zero_after_free_allocator(const zero_after_free_allocator& a) noexcept : base(a) {}
template <typename U>
- zero_after_free_allocator(const zero_after_free_allocator<U>& a) throw() : base(a)
+ zero_after_free_allocator(const zero_after_free_allocator<U>& a) noexcept : base(a)
{
}
- ~zero_after_free_allocator() throw() {}
+ ~zero_after_free_allocator() noexcept {}
template <typename _Other>
struct rebind {
typedef zero_after_free_allocator<_Other> other;
diff --git a/src/sync.h b/src/sync.h
index 4921aedf39..ddaf62b3b3 100644
--- a/src/sync.h
+++ b/src/sync.h
@@ -280,7 +280,7 @@ public:
Release();
}
- operator bool()
+ operator bool() const
{
return fHaveGrant;
}
diff --git a/src/test/blockencodings_tests.cpp b/src/test/blockencodings_tests.cpp
index 10a40fea3c..812e8534cd 100644
--- a/src/test/blockencodings_tests.cpp
+++ b/src/test/blockencodings_tests.cpp
@@ -51,7 +51,7 @@ static CBlock BuildBlockTestCase() {
return block;
}
-// Number of shared use_counts we expect for a tx we havent touched
+// Number of shared use_counts we expect for a tx we haven't touched
// == 2 (mempool + our copy from the GetSharedTx call)
#define SHARED_TX_OFFSET 2
diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp
index e24431528a..37ddf83f5e 100644
--- a/src/test/coins_tests.cpp
+++ b/src/test/coins_tests.cpp
@@ -89,8 +89,8 @@ public:
BOOST_CHECK_EQUAL(DynamicMemoryUsage(), ret);
}
- CCoinsMap& map() { return cacheCoins; }
- size_t& usage() { return cachedCoinsUsage; }
+ CCoinsMap& map() const { return cacheCoins; }
+ size_t& usage() const { return cachedCoinsUsage; }
};
} // namespace
@@ -275,7 +275,7 @@ UtxoData::iterator FindRandomFrom(const std::set<COutPoint> &utxoSet) {
// except the emphasis is on testing the functionality of UpdateCoins
// random txs are created and UpdateCoins is used to update the cache stack
// In particular it is tested that spending a duplicate coinbase tx
-// has the expected effect (the other duplicate is overwitten at all cache levels)
+// has the expected effect (the other duplicate is overwritten at all cache levels)
BOOST_AUTO_TEST_CASE(updatecoins_simulation_test)
{
bool spent_a_duplicate_coinbase = false;
diff --git a/src/test/data/tx_invalid.json b/src/test/data/tx_invalid.json
index 2235bd0ae7..09442b7f9f 100644
--- a/src/test/data/tx_invalid.json
+++ b/src/test/data/tx_invalid.json
@@ -205,7 +205,7 @@
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4259839 CHECKSEQUENCEVERIFY 1"]],
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000feff40000100000000000000000000000000", "P2SH,CHECKSEQUENCEVERIFY"],
-["By-time locks, with argument just beyond txin.nSequence (but within numerical boundries)"],
+["By-time locks, with argument just beyond txin.nSequence (but within numerical boundaries)"],
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4194305 CHECKSEQUENCEVERIFY 1"]],
"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000", "P2SH,CHECKSEQUENCEVERIFY"],
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4259839 CHECKSEQUENCEVERIFY 1"]],
diff --git a/src/test/prevector_tests.cpp b/src/test/prevector_tests.cpp
index 345c4a2148..841282873f 100644
--- a/src/test/prevector_tests.cpp
+++ b/src/test/prevector_tests.cpp
@@ -152,11 +152,11 @@ public:
pre_vector.assign(n, value);
}
- Size size() {
+ Size size() const {
return real_vector.size();
}
- Size capacity() {
+ Size capacity() const {
return pre_vector.capacity();
}
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp
index 06b8274f2d..17374edcc4 100644
--- a/src/test/script_tests.cpp
+++ b/src/test/script_tests.cpp
@@ -450,7 +450,7 @@ public:
return array;
}
- std::string GetComment()
+ std::string GetComment() const
{
return comment;
}
diff --git a/src/txmempool.h b/src/txmempool.h
index 6723ea8e6c..0b183cbd90 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -606,7 +606,7 @@ public:
return mapTx.size();
}
- uint64_t GetTotalTxSize()
+ uint64_t GetTotalTxSize() const
{
LOCK(cs);
return totalTxSize;
diff --git a/src/versionbits.cpp b/src/versionbits.cpp
index 04a692d826..59588023ad 100644
--- a/src/versionbits.cpp
+++ b/src/versionbits.cpp
@@ -107,7 +107,7 @@ ThresholdState AbstractThresholdConditionChecker::GetStateFor(const CBlockIndex*
// return the numerical statistics of blocks signalling the specified BIP9 condition in this current period
BIP9Stats AbstractThresholdConditionChecker::GetStateStatisticsFor(const CBlockIndex* pindex, const Consensus::Params& params) const
{
- BIP9Stats stats;
+ BIP9Stats stats = {};
stats.period = Period(params);
stats.threshold = Threshold(params);
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index b12d46e40a..d2fe4866fa 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -101,8 +101,10 @@ bool CDBEnv::Open(const fs::path& pathIn)
DB_RECOVER |
nEnvFlags,
S_IRUSR | S_IWUSR);
- if (ret != 0)
+ if (ret != 0) {
+ dbenv->close(0);
return error("CDBEnv::Open: Error %d opening database environment: %s\n", ret, DbEnv::strerror(ret));
+ }
fDbEnvInit = true;
fMockDb = false;
@@ -196,9 +198,9 @@ bool CDB::Recover(const std::string& filename, void *callbackDataIn, bool (*reco
DB_BTREE, // Database type
DB_CREATE, // Flags
0);
- if (ret > 0)
- {
+ if (ret > 0) {
LogPrintf("Cannot create database file %s\n", filename);
+ pdbCopy->close(0);
return false;
}
@@ -536,8 +538,10 @@ bool CDB::Rewrite(CWalletDBWrapper& dbw, const char* pszSkip)
env->CloseDb(strFile);
if (pdbCopy->close(0))
fSuccess = false;
- delete pdbCopy;
+ } else {
+ pdbCopy->close(0);
}
+ delete pdbCopy;
}
if (fSuccess) {
Db dbA(env->dbenv, 0);
diff --git a/src/wallet/db.h b/src/wallet/db.h
index 3614e34fbb..6f3cfe9557 100644
--- a/src/wallet/db.h
+++ b/src/wallet/db.h
@@ -45,7 +45,7 @@ public:
void Reset();
void MakeMock();
- bool IsMock() { return fMockDb; }
+ bool IsMock() const { return fMockDb; }
/**
* Verify that database file strFile is OK. If it is not,
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index a6176c3485..75f836a29d 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -1134,7 +1134,7 @@ public:
SignatureData sigs;
// This check is to make sure that the script we created can actually be solved for and signed by us
// if we were to have the private keys. This is just to make sure that the script is valid and that,
- // if found in a transaction, we would still accept and relay that transcation.
+ // if found in a transaction, we would still accept and relay that transaction.
if (!ProduceSignature(DummySignatureCreator(pwallet), witscript, sigs) ||
!VerifyScript(sigs.scriptSig, witscript, &sigs.scriptWitness, MANDATORY_SCRIPT_VERIFY_FLAGS | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, DummySignatureCreator(pwallet).Checker())) {
return false;
@@ -1159,7 +1159,7 @@ public:
SignatureData sigs;
// This check is to make sure that the script we created can actually be solved for and signed by us
// if we were to have the private keys. This is just to make sure that the script is valid and that,
- // if found in a transaction, we would still accept and relay that transcation.
+ // if found in a transaction, we would still accept and relay that transaction.
if (!ProduceSignature(DummySignatureCreator(pwallet), witscript, sigs) ||
!VerifyScript(sigs.scriptSig, witscript, &sigs.scriptWitness, MANDATORY_SCRIPT_VERIFY_FLAGS | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, DummySignatureCreator(pwallet).Checker())) {
return false;
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 599e74149c..489952e309 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2571,7 +2571,7 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nC
if (nChangePosInOut != -1) {
tx.vout.insert(tx.vout.begin() + nChangePosInOut, wtx.tx->vout[nChangePosInOut]);
- // we dont have the normal Create/Commit cycle, and dont want to risk reusing change,
+ // we don't have the normal Create/Commit cycle, and don't want to risk reusing change,
// so just remove the key from the keypool here.
reservekey.KeepKey();
}
diff --git a/test/functional/blockchain.py b/test/functional/blockchain.py
index a7034e6bcd..0812e1b0df 100755
--- a/test/functional/blockchain.py
+++ b/test/functional/blockchain.py
@@ -139,13 +139,13 @@ class BlockchainTest(BitcoinTestFramework):
self.nodes[0].generate(6)
assert_equal(self.nodes[0].getblockcount(), 206)
self.log.debug('Node should not stop at this height')
- assert_raises(subprocess.TimeoutExpired, lambda: self.bitcoind_processes[0].wait(timeout=3))
+ assert_raises(subprocess.TimeoutExpired, lambda: self.nodes[0].process.wait(timeout=3))
try:
self.nodes[0].generate(1)
except (ConnectionError, http.client.BadStatusLine):
pass # The node already shut down before response
self.log.debug('Node should stop at this height...')
- self.bitcoind_processes[0].wait(timeout=BITCOIND_PROC_WAIT_TIMEOUT)
+ self.nodes[0].process.wait(timeout=BITCOIND_PROC_WAIT_TIMEOUT)
self.nodes[0] = self.start_node(0, self.options.tmpdir)
assert_equal(self.nodes[0].getblockcount(), 207)
diff --git a/test/functional/bumpfee.py b/test/functional/bumpfee.py
index 9237f09240..9633ffdebb 100755
--- a/test/functional/bumpfee.py
+++ b/test/functional/bumpfee.py
@@ -41,8 +41,7 @@ class BumpFeeTest(BitcoinTestFramework):
self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir, extra_args)
# Encrypt wallet for test_locked_wallet_fails test
- self.nodes[1].encryptwallet(WALLET_PASSPHRASE)
- self.bitcoind_processes[1].wait()
+ self.nodes[1].node_encrypt_wallet(WALLET_PASSPHRASE)
self.nodes[1] = self.start_node(1, self.options.tmpdir, extra_args[1])
self.nodes[1].walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)
@@ -90,7 +89,7 @@ def test_simple_bumpfee_succeeds(rbf_node, peer_node, dest_address):
bumped_tx = rbf_node.bumpfee(rbfid)
assert_equal(bumped_tx["errors"], [])
assert bumped_tx["fee"] - abs(rbftx["fee"]) > 0
- # check that bumped_tx propogates, original tx was evicted and has a wallet conflict
+ # check that bumped_tx propagates, original tx was evicted and has a wallet conflict
sync_mempools((rbf_node, peer_node))
assert bumped_tx["txid"] in rbf_node.getrawmempool()
assert bumped_tx["txid"] in peer_node.getrawmempool()
diff --git a/test/functional/example_test.py b/test/functional/example_test.py
index 7709524f23..79940a4264 100755
--- a/test/functional/example_test.py
+++ b/test/functional/example_test.py
@@ -200,7 +200,7 @@ class ExampleTest(BitcoinTestFramework):
node2.add_connection(connections[1])
node2.wait_for_verack()
- self.log.info("Wait for node2 reach current tip. Test that it has propogated all the blocks to us")
+ self.log.info("Wait for node2 reach current tip. Test that it has propagated all the blocks to us")
getdata_request = msg_getdata()
for block in blocks:
diff --git a/test/functional/fundrawtransaction.py b/test/functional/fundrawtransaction.py
index e52e773918..f2f4efcf28 100755
--- a/test/functional/fundrawtransaction.py
+++ b/test/functional/fundrawtransaction.py
@@ -451,8 +451,7 @@ class RawTransactionsTest(BitcoinTestFramework):
self.stop_node(0)
self.stop_node(2)
self.stop_node(3)
- self.nodes[1].encryptwallet("test")
- self.bitcoind_processes[1].wait(timeout=BITCOIND_PROC_WAIT_TIMEOUT)
+ self.nodes[1].node_encrypt_wallet("test")
self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir)
# This test is not meant to test fee estimation and we'd like
diff --git a/test/functional/getblocktemplate_longpoll.py b/test/functional/getblocktemplate_longpoll.py
index bbe1dda5f7..cca30e2688 100755
--- a/test/functional/getblocktemplate_longpoll.py
+++ b/test/functional/getblocktemplate_longpoll.py
@@ -17,7 +17,7 @@ class LongpollThread(threading.Thread):
self.longpollid = templat['longpollid']
# create a new connection to the node, we can't use the same
# connection from two threads
- self.node = get_rpc_proxy(node.url, 1, timeout=600)
+ self.node = get_rpc_proxy(node.url, 1, timeout=600, coveragedir=node.coverage_dir)
def run(self):
self.node.getblocktemplate({'longpollid':self.longpollid})
diff --git a/test/functional/keypool.py b/test/functional/keypool.py
index e8be559918..3e7bb0ee07 100755
--- a/test/functional/keypool.py
+++ b/test/functional/keypool.py
@@ -17,8 +17,7 @@ class KeyPoolTest(BitcoinTestFramework):
assert(addr_before_encrypting_data['hdmasterkeyid'] == wallet_info_old['hdmasterkeyid'])
# Encrypt wallet and wait to terminate
- nodes[0].encryptwallet('test')
- self.bitcoind_processes[0].wait()
+ nodes[0].node_encrypt_wallet('test')
# Restart node 0
nodes[0] = self.start_node(0, self.options.tmpdir)
# Keep creating keys
diff --git a/test/functional/multiwallet.py b/test/functional/multiwallet.py
index 5679f40503..fc6e8e325f 100755
--- a/test/functional/multiwallet.py
+++ b/test/functional/multiwallet.py
@@ -35,11 +35,15 @@ class MultiWalletTest(BitcoinTestFramework):
self.nodes[0] = self.start_node(0, self.options.tmpdir, self.extra_args[0])
- w1 = self.nodes[0] / "wallet/w1"
+ w1 = self.nodes[0].get_wallet_rpc("w1")
+ w2 = self.nodes[0].get_wallet_rpc("w2")
+ w3 = self.nodes[0].get_wallet_rpc("w3")
+ wallet_bad = self.nodes[0].get_wallet_rpc("bad")
+
w1.generate(1)
# accessing invalid wallet fails
- assert_raises_jsonrpc(-18, "Requested wallet does not exist or is not loaded", (self.nodes[0] / "wallet/bad").getwalletinfo)
+ assert_raises_jsonrpc(-18, "Requested wallet does not exist or is not loaded", wallet_bad.getwalletinfo)
# accessing wallet RPC without using wallet endpoint fails
assert_raises_jsonrpc(-19, "Wallet file not specified", self.nodes[0].getwalletinfo)
@@ -50,14 +54,12 @@ class MultiWalletTest(BitcoinTestFramework):
w1_name = w1_info['walletname']
assert_equal(w1_name, "w1")
- # check w1 wallet balance
- w2 = self.nodes[0] / "wallet/w2"
+ # check w2 wallet balance
w2_info = w2.getwalletinfo()
assert_equal(w2_info['immature_balance'], 0)
w2_name = w2_info['walletname']
assert_equal(w2_name, "w2")
- w3 = self.nodes[0] / "wallet/w3"
w3_name = w3.getwalletinfo()['walletname']
assert_equal(w3_name, "w3")
diff --git a/test/functional/net.py b/test/functional/net.py
index 3ba3764cf9..1e63d38035 100755
--- a/test/functional/net.py
+++ b/test/functional/net.py
@@ -85,7 +85,7 @@ class NetTest(BitcoinTestFramework):
added_nodes = self.nodes[0].getaddednodeinfo(ip_port)
assert_equal(len(added_nodes), 1)
assert_equal(added_nodes[0]['addednode'], ip_port)
- # check that a non-existant node returns an error
+ # check that a non-existent node returns an error
assert_raises_jsonrpc(-24, "Node has not been added",
self.nodes[0].getaddednodeinfo, '1.1.1.1')
diff --git a/test/functional/pruning.py b/test/functional/pruning.py
index 0af91e0658..3e00a34ac4 100755
--- a/test/functional/pruning.py
+++ b/test/functional/pruning.py
@@ -136,7 +136,7 @@ class PruneTest(BitcoinTestFramework):
self.log.info("Invalidating block %s at height %d" % (badhash,invalidheight))
self.nodes[1].invalidateblock(badhash)
- # We've now switched to our previously mined-24 block fork on node 1, but thats not what we want
+ # We've now switched to our previously mined-24 block fork on node 1, but that's not what we want
# So invalidate that fork as well, until we're on the same chain as node 0/2 (but at an ancestor 288 blocks ago)
mainchainhash = self.nodes[0].getblockhash(invalidheight - 1)
curhash = self.nodes[1].getblockhash(invalidheight - 1)
@@ -199,7 +199,7 @@ class PruneTest(BitcoinTestFramework):
goalbesthash = self.mainchainhash2
# As of 0.10 the current block download logic is not able to reorg to the original chain created in
- # create_chain_with_stale_blocks because it doesn't know of any peer thats on that chain from which to
+ # create_chain_with_stale_blocks because it doesn't know of any peer that's on that chain from which to
# redownload its missing blocks.
# Invalidate the reorg_test chain in node 0 as well, it can successfully switch to the original chain
# because it has all the block data.
diff --git a/test/functional/rawtransactions.py b/test/functional/rawtransactions.py
index 6272fc69b7..b6b90d6781 100755
--- a/test/functional/rawtransactions.py
+++ b/test/functional/rawtransactions.py
@@ -2,7 +2,7 @@
# Copyright (c) 2014-2016 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 the rawtranscation RPCs.
+"""Test the rawtransaction RPCs.
Test the following RPCs:
- createrawtransaction
diff --git a/test/functional/rpcbind_test.py b/test/functional/rpcbind_test.py
index 951685aa76..20808207b2 100755
--- a/test/functional/rpcbind_test.py
+++ b/test/functional/rpcbind_test.py
@@ -37,7 +37,7 @@ class RPCBindTest(BitcoinTestFramework):
base_args += ['-rpcallowip=' + x for x in allow_ips]
binds = ['-rpcbind='+addr for addr in addresses]
self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir, [base_args + binds], connect_to)
- pid = self.bitcoind_processes[0].pid
+ pid = self.nodes[0].process.pid
assert_equal(set(get_bind_addrs(pid)), set(expected))
self.stop_nodes()
@@ -49,7 +49,7 @@ class RPCBindTest(BitcoinTestFramework):
base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips]
self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir, [base_args])
# connect to node through non-loopback interface
- node = get_rpc_proxy(rpc_url(get_datadir_path(self.options.tmpdir, 0), 0, "%s:%d" % (rpchost, rpcport)), 0)
+ node = get_rpc_proxy(rpc_url(get_datadir_path(self.options.tmpdir, 0), 0, "%s:%d" % (rpchost, rpcport)), 0, coveragedir=self.options.coveragedir)
node.getnetworkinfo()
self.stop_nodes()
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index e562d11938..7903bb0045 100755
--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -5,15 +5,12 @@
"""Base class for RPC testing."""
from collections import deque
-import errno
from enum import Enum
-import http.client
import logging
import optparse
import os
import pdb
import shutil
-import subprocess
import sys
import tempfile
import time
@@ -21,6 +18,7 @@ import traceback
from .authproxy import JSONRPCException
from . import coverage
+from .test_node import TestNode
from .util import (
MAX_NODES,
PortSeed,
@@ -28,12 +26,9 @@ from .util import (
check_json_precision,
connect_nodes_bi,
disconnect_nodes,
- get_rpc_proxy,
initialize_datadir,
- get_datadir_path,
log_filename,
p2p_port,
- rpc_url,
set_node_times,
sync_blocks,
sync_mempools,
@@ -70,7 +65,6 @@ class BitcoinTestFramework(object):
self.num_nodes = 4
self.setup_clean_chain = False
self.nodes = []
- self.bitcoind_processes = {}
self.mocktime = 0
def add_options(self, parser):
@@ -213,64 +207,62 @@ class BitcoinTestFramework(object):
def start_node(self, i, dirname, extra_args=None, rpchost=None, timewait=None, binary=None, stderr=None):
"""Start a bitcoind and return RPC connection to it"""
- datadir = os.path.join(dirname, "node" + str(i))
+ if extra_args is None:
+ extra_args = []
if binary is None:
binary = os.getenv("BITCOIND", "bitcoind")
- args = [binary, "-datadir=" + datadir, "-server", "-keypool=1", "-discover=0", "-rest", "-logtimemicros", "-debug", "-debugexclude=libevent", "-debugexclude=leveldb", "-mocktime=" + str(self.mocktime), "-uacomment=testnode%d" % i]
- if extra_args is not None:
- args.extend(extra_args)
- self.bitcoind_processes[i] = subprocess.Popen(args, stderr=stderr)
- self.log.debug("initialize_chain: bitcoind started, waiting for RPC to come up")
- self._wait_for_bitcoind_start(self.bitcoind_processes[i], datadir, i, rpchost)
- self.log.debug("initialize_chain: RPC successfully started")
- proxy = get_rpc_proxy(rpc_url(datadir, i, rpchost), i, timeout=timewait)
+ node = TestNode(i, dirname, extra_args, rpchost, timewait, binary, stderr, self.mocktime, coverage_dir=self.options.coveragedir)
+ node.start()
+ node.wait_for_rpc_connection()
- if self.options.coveragedir:
- coverage.write_all_rpc_commands(self.options.coveragedir, proxy)
+ if self.options.coveragedir is not None:
+ coverage.write_all_rpc_commands(self.options.coveragedir, node.rpc)
- return proxy
+ return node
def start_nodes(self, num_nodes, dirname, extra_args=None, rpchost=None, timewait=None, binary=None):
"""Start multiple bitcoinds, return RPC connections to them"""
if extra_args is None:
- extra_args = [None] * num_nodes
+ extra_args = [[]] * num_nodes
if binary is None:
binary = [None] * num_nodes
assert_equal(len(extra_args), num_nodes)
assert_equal(len(binary), num_nodes)
- rpcs = []
+ nodes = []
try:
for i in range(num_nodes):
- rpcs.append(self.start_node(i, dirname, extra_args[i], rpchost, timewait=timewait, binary=binary[i]))
+ nodes.append(TestNode(i, dirname, extra_args[i], rpchost, timewait=timewait, binary=binary[i], stderr=None, mocktime=self.mocktime, coverage_dir=self.options.coveragedir))
+ nodes[i].start()
+ for node in nodes:
+ node.wait_for_rpc_connection()
except:
# If one node failed to start, stop the others
- # TODO: abusing self.nodes in this way is a little hacky.
- # Eventually we should do a better job of tracking nodes
- self.nodes.extend(rpcs)
self.stop_nodes()
- self.nodes = []
raise
- return rpcs
+
+ if self.options.coveragedir is not None:
+ for node in nodes:
+ coverage.write_all_rpc_commands(self.options.coveragedir, node.rpc)
+
+ return nodes
def stop_node(self, i):
"""Stop a bitcoind test node"""
-
- self.log.debug("Stopping node %d" % i)
- try:
- self.nodes[i].stop()
- except http.client.CannotSendRequest as e:
- self.log.exception("Unable to stop node")
- return_code = self.bitcoind_processes[i].wait(timeout=BITCOIND_PROC_WAIT_TIMEOUT)
- del self.bitcoind_processes[i]
- assert_equal(return_code, 0)
+ self.nodes[i].stop_node()
+ while not self.nodes[i].is_node_stopped():
+ time.sleep(0.1)
def stop_nodes(self):
"""Stop multiple bitcoind test nodes"""
+ for node in self.nodes:
+ # Issue RPC to stop nodes
+ node.stop_node()
- for i in range(len(self.nodes)):
- self.stop_node(i)
- assert not self.bitcoind_processes.values() # All connections must be gone now
+ for node in self.nodes:
+ # Wait for nodes to stop
+ while not node.is_node_stopped():
+ time.sleep(0.1)
def assert_start_raises_init_error(self, i, dirname, extra_args=None, expected_msg=None):
with tempfile.SpooledTemporaryFile(max_size=2**16) as log_stderr:
@@ -279,6 +271,8 @@ class BitcoinTestFramework(object):
self.stop_node(i)
except Exception as e:
assert 'bitcoind exited' in str(e) # node must have shutdown
+ self.nodes[i].running = False
+ self.nodes[i].process = None
if expected_msg is not None:
log_stderr.seek(0)
stderr = log_stderr.read().decode('utf-8')
@@ -292,7 +286,7 @@ class BitcoinTestFramework(object):
raise AssertionError(assert_msg)
def wait_for_node_exit(self, i, timeout):
- self.bitcoind_processes[i].wait(timeout)
+ self.nodes[i].process.wait(timeout)
def split_network(self):
"""
@@ -389,18 +383,13 @@ class BitcoinTestFramework(object):
args = [os.getenv("BITCOIND", "bitcoind"), "-server", "-keypool=1", "-datadir=" + datadir, "-discover=0"]
if i > 0:
args.append("-connect=127.0.0.1:" + str(p2p_port(0)))
- self.bitcoind_processes[i] = subprocess.Popen(args)
- self.log.debug("initialize_chain: bitcoind started, waiting for RPC to come up")
- self._wait_for_bitcoind_start(self.bitcoind_processes[i], datadir, i)
- self.log.debug("initialize_chain: RPC successfully started")
+ self.nodes.append(TestNode(i, cachedir, extra_args=[], rpchost=None, timewait=None, binary=None, stderr=None, mocktime=self.mocktime, coverage_dir=None))
+ self.nodes[i].args = args
+ self.nodes[i].start()
- self.nodes = []
- for i in range(MAX_NODES):
- try:
- self.nodes.append(get_rpc_proxy(rpc_url(get_datadir_path(cachedir, i), i), i))
- except:
- self.log.exception("Error connecting to node %d" % i)
- sys.exit(1)
+ # Wait for RPC connections to be ready
+ for node in self.nodes:
+ node.wait_for_rpc_connection()
# Create a 200-block-long chain; each of the 4 first nodes
# gets 25 mature blocks and 25 immature.
@@ -444,30 +433,6 @@ class BitcoinTestFramework(object):
for i in range(num_nodes):
initialize_datadir(test_dir, i)
- def _wait_for_bitcoind_start(self, process, datadir, i, rpchost=None):
- """Wait for bitcoind to start.
-
- This means that RPC is accessible and fully initialized.
- Raise an exception if bitcoind exits during initialization."""
- while True:
- if process.poll() is not None:
- raise Exception('bitcoind exited with status %i during initialization' % process.returncode)
- try:
- # Check if .cookie file to be created
- rpc = get_rpc_proxy(rpc_url(datadir, i, rpchost), i, coveragedir=self.options.coveragedir)
- rpc.getblockcount()
- break # break out of loop on success
- except IOError as e:
- if e.errno != errno.ECONNREFUSED: # Port not yet open?
- raise # unknown IO error
- except JSONRPCException as e: # Initialization phase
- if e.error['code'] != -28: # RPC in warmup?
- raise # unknown JSON RPC exception
- except ValueError as e: # cookie file not found and no rpcuser or rpcassword. bitcoind still starting
- if "No RPC credentials" not in str(e):
- raise
- time.sleep(0.25)
-
class ComparisonTestFramework(BitcoinTestFramework):
"""Test framework for doing p2p comparison testing
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
new file mode 100755
index 0000000000..66f89d43f4
--- /dev/null
+++ b/test/functional/test_framework/test_node.py
@@ -0,0 +1,134 @@
+#!/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.
+"""Class for bitcoind node under test"""
+
+import errno
+import http.client
+import logging
+import os
+import subprocess
+import time
+
+from .util import (
+ assert_equal,
+ get_rpc_proxy,
+ rpc_url,
+)
+from .authproxy import JSONRPCException
+
+class TestNode():
+ """A class for representing a bitcoind node under test.
+
+ This class contains:
+
+ - state about the node (whether it's running, etc)
+ - a Python subprocess.Popen object representing the running process
+ - an RPC connection to the node
+
+ To make things easier for the test writer, a bit of magic is happening under the covers.
+ Any unrecognised messages will be dispatched to the RPC connection."""
+
+ def __init__(self, i, dirname, extra_args, rpchost, timewait, binary, stderr, mocktime, coverage_dir):
+ self.index = i
+ self.datadir = os.path.join(dirname, "node" + str(i))
+ self.rpchost = rpchost
+ self.rpc_timeout = timewait
+ if binary is None:
+ self.binary = os.getenv("BITCOIND", "bitcoind")
+ else:
+ self.binary = binary
+ self.stderr = stderr
+ self.coverage_dir = coverage_dir
+ # Most callers will just need to add extra args to the standard list below. For those callers that need more flexibity, they can just set the args property directly.
+ self.extra_args = extra_args
+ self.args = [self.binary, "-datadir=" + self.datadir, "-server", "-keypool=1", "-discover=0", "-rest", "-logtimemicros", "-debug", "-debugexclude=libevent", "-debugexclude=leveldb", "-mocktime=" + str(mocktime), "-uacomment=testnode%d" % i]
+
+ self.running = False
+ self.process = None
+ self.rpc_connected = False
+ self.rpc = None
+ self.url = None
+ self.log = logging.getLogger('TestFramework.node%d' % i)
+
+ def __getattr__(self, *args, **kwargs):
+ """Dispatches any unrecognised messages to the RPC connection."""
+ assert self.rpc_connected and self.rpc is not None, "Error: no RPC connection"
+ return self.rpc.__getattr__(*args, **kwargs)
+
+ def start(self):
+ """Start the node."""
+ self.process = subprocess.Popen(self.args + self.extra_args, stderr=self.stderr)
+ self.running = True
+ self.log.debug("bitcoind started, waiting for RPC to come up")
+
+ def wait_for_rpc_connection(self):
+ """Sets up an RPC connection to the bitcoind process. Returns False if unable to connect."""
+
+ # Wait for up to 10 seconds for the RPC server to respond
+ for _ in range(40):
+ assert not self.process.poll(), "bitcoind exited with status %i during initialization" % self.process.returncode
+ try:
+ self.rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.rpchost), self.index, coveragedir=self.coverage_dir)
+ self.rpc.getblockcount()
+ # If the call to getblockcount() succeeds then the RPC connection is up
+ 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?
+ raise # unknown IO error
+ except JSONRPCException as e: # Initialization phase
+ if e.error['code'] != -28: # RPC in warmup?
+ raise # unknown JSON RPC exception
+ except ValueError as e: # cookie file not found and no rpcuser or rpcassword. bitcoind still starting
+ if "No RPC credentials" not in str(e):
+ raise
+ time.sleep(0.25)
+ raise AssertionError("Unable to connect to bitcoind")
+
+ def get_wallet_rpc(self, wallet_name):
+ assert self.rpc_connected
+ assert self.rpc
+ wallet_path = "wallet/%s" % wallet_name
+ return self.rpc / wallet_path
+
+ def stop_node(self):
+ """Stop the node."""
+ if not self.running:
+ return
+ self.log.debug("Stopping node")
+ try:
+ self.stop()
+ except http.client.CannotSendRequest:
+ self.log.exception("Unable to stop node.")
+
+ def is_node_stopped(self):
+ """Checks whether the node has stopped.
+
+ Returns True if the node has stopped. False otherwise.
+ This method is responsible for freeing resources (self.process)."""
+ if not self.running:
+ return True
+ return_code = self.process.poll()
+ if return_code is not None:
+ # process has stopped. Assert that it didn't return an error code.
+ assert_equal(return_code, 0)
+ self.running = False
+ self.process = None
+ self.log.debug("Node stopped")
+ return True
+ return False
+
+ def node_encrypt_wallet(self, passphrase):
+ """"Encrypts the wallet.
+
+ This causes bitcoind to shutdown, so this method takes
+ care of cleaning up resources."""
+ self.encryptwallet(passphrase)
+ while not self.is_node_stopped():
+ time.sleep(0.1)
+ self.rpc = None
+ self.rpc_connected = False
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index acca72aa86..4098fd8615 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -204,7 +204,7 @@ def rpc_port(n):
return PORT_MIN + PORT_RANGE + n + (MAX_NODES * PortSeed.n) % (PORT_RANGE - 1 - MAX_NODES)
def rpc_url(datadir, i, rpchost=None):
- rpc_u, rpc_p = get_auth_cookie(datadir, i)
+ rpc_u, rpc_p = get_auth_cookie(datadir)
host = '127.0.0.1'
port = rpc_port(i)
if rpchost:
@@ -232,7 +232,7 @@ def initialize_datadir(dirname, n):
def get_datadir_path(dirname, n):
return os.path.join(dirname, "node" + str(n))
-def get_auth_cookie(datadir, n):
+def get_auth_cookie(datadir):
user = None
password = None
if os.path.isfile(os.path.join(datadir, "bitcoin.conf")):
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index 93f180555d..d248a6c005 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -170,7 +170,7 @@ def main():
Help text and arguments for individual test script:''',
formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('--coverage', action='store_true', help='generate a basic coverage report for the RPC interface')
- parser.add_argument('--exclude', '-x', help='specify a comma-seperated-list of scripts to exclude.')
+ 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')
@@ -352,7 +352,7 @@ def print_results(test_results, max_len_name, runtime):
class TestHandler:
"""
- Trigger the testscrips passed in via the list.
+ Trigger the test scripts passed in via the list.
"""
def __init__(self, num_tests_parallel, tests_dir, tmpdir, test_list=None, flags=None):
diff --git a/test/functional/wallet-dump.py b/test/functional/wallet-dump.py
index 569cc46e6c..61ad00330b 100755
--- a/test/functional/wallet-dump.py
+++ b/test/functional/wallet-dump.py
@@ -94,8 +94,7 @@ class WalletDumpTest(BitcoinTestFramework):
assert_equal(found_addr_rsv, 90*2) # 90 keys plus 100% internal keys
#encrypt wallet, restart, unlock and dump
- self.nodes[0].encryptwallet('test')
- self.bitcoind_processes[0].wait()
+ self.nodes[0].node_encrypt_wallet('test')
self.nodes[0] = self.start_node(0, self.options.tmpdir, self.extra_args[0])
self.nodes[0].walletpassphrase('test', 10)
# Should be a no-op:
diff --git a/test/functional/wallet-encryption.py b/test/functional/wallet-encryption.py
index ba72918fe1..8fea4140db 100755
--- a/test/functional/wallet-encryption.py
+++ b/test/functional/wallet-encryption.py
@@ -30,8 +30,7 @@ class WalletEncryptionTest(BitcoinTestFramework):
assert_equal(len(privkey), 52)
# Encrypt the wallet
- self.nodes[0].encryptwallet(passphrase)
- self.bitcoind_processes[0].wait(timeout=BITCOIND_PROC_WAIT_TIMEOUT)
+ self.nodes[0].node_encrypt_wallet(passphrase)
self.nodes[0] = self.start_node(0, self.options.tmpdir)
# Test that the wallet is encrypted