diff options
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | doc/README.md | 1 | ||||
-rw-r--r-- | doc/build-unix.md | 22 | ||||
-rw-r--r-- | doc/man/bitcoin-cli.1 | 18 | ||||
-rw-r--r-- | doc/man/bitcoin-qt.1 | 44 | ||||
-rw-r--r-- | doc/man/bitcoin-tx.1 | 10 | ||||
-rw-r--r-- | doc/man/bitcoind.1 | 44 | ||||
-rw-r--r-- | doc/release-notes.md | 67 | ||||
-rw-r--r-- | doc/release-process.md | 5 | ||||
-rw-r--r-- | src/chainparams.cpp | 2 | ||||
-rw-r--r-- | src/net.cpp | 19 | ||||
-rw-r--r-- | src/net.h | 2 | ||||
-rw-r--r-- | src/netbase.cpp | 3 | ||||
-rw-r--r-- | src/protocol.h | 2 | ||||
-rw-r--r-- | src/qt/coincontroldialog.cpp | 23 | ||||
-rw-r--r-- | src/qt/coincontroldialog.h | 2 | ||||
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 20 | ||||
-rw-r--r-- | src/streams.h | 2 | ||||
-rw-r--r-- | src/sync.cpp | 4 | ||||
-rw-r--r-- | src/validation.cpp | 2 | ||||
-rw-r--r-- | src/wallet/test/wallet_tests.cpp | 2 | ||||
-rwxr-xr-x | test/functional/feature_uacomment.py | 2 | ||||
-rwxr-xr-x | test/functional/test_framework/mininode.py | 2 | ||||
-rwxr-xr-x | test/functional/test_runner.py | 14 |
24 files changed, 159 insertions, 159 deletions
diff --git a/configure.ac b/configure.ac index 8e779f3225..2b6ee1dc3f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) -define(_CLIENT_VERSION_MINOR, 15) +define(_CLIENT_VERSION_MINOR, 16) define(_CLIENT_VERSION_REVISION, 99) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, false) @@ -934,8 +934,8 @@ if test x$use_pkgconfig = xyes; then m4_ifdef( [PKG_CHECK_MODULES], [ - PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)]) - PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)]) + PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)]) + PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)]) BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])]) if test x$use_qr != xno; then BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])]) diff --git a/doc/README.md b/doc/README.md index 988019869e..ddb239f60c 100644 --- a/doc/README.md +++ b/doc/README.md @@ -42,6 +42,7 @@ The following are developer notes on how to build Bitcoin on your native platfor - [Unix Build Notes](build-unix.md) - [Windows Build Notes](build-windows.md) - [OpenBSD Build Notes](build-openbsd.md) +- [NetBSD Build Notes](build-netbsd.md) - [Gitian Building Guide](gitian-building.md) Development diff --git a/doc/build-unix.md b/doc/build-unix.md index af567cadeb..b823c23e0c 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -2,7 +2,8 @@ UNIX BUILD NOTES ==================== Some notes on how to build Bitcoin Core in Unix. -(for OpenBSD specific instructions, see [build-openbsd.md](build-openbsd.md)) +(For BSD specific instructions, see [build-openbsd.md](build-openbsd.md) and/or +[build-netbsd.md](build-netbsd.md)) Note --------------------- @@ -61,8 +62,13 @@ tuned to conserve memory with additional CXXFLAGS: ./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" -Dependency Build Instructions: Ubuntu & Debian ----------------------------------------------- + +## Linux Distribution Specific Instructions + +### Ubuntu & Debian + +#### Dependency Build Instructions + Build requirements: sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 @@ -104,8 +110,7 @@ ZMQ dependencies (provides ZMQ API 4.x): sudo apt-get install libzmq3-dev -Dependencies for the GUI: Ubuntu & Debian ------------------------------------------ +#### Dependencies for the GUI If you want to build Bitcoin-Qt, make sure that the required packages for Qt development are installed. Either Qt 5 or Qt 4 are necessary to build the GUI. @@ -127,8 +132,11 @@ libqrencode (optional) can be installed with: Once these are installed, they will be found by configure and a bitcoin-qt executable will be built by default. -Dependency Build Instructions: Fedora -------------------------------------- + +### Fedora + +#### Dependency Build Instructions + Build requirements: sudo dnf install gcc-c++ libtool make autoconf automake openssl-devel libevent-devel boost-devel libdb4-devel libdb4-cxx-devel python3 diff --git a/doc/man/bitcoin-cli.1 b/doc/man/bitcoin-cli.1 index 6787638443..168a68cb30 100644 --- a/doc/man/bitcoin-cli.1 +++ b/doc/man/bitcoin-cli.1 @@ -1,9 +1,9 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. -.TH BITCOIN-CLI "1" "September 2017" "bitcoin-cli v0.15.99.0" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. +.TH BITCOIN-CLI "1" "January 2018" "bitcoin-cli v0.16.99.0" "User Commands" .SH NAME -bitcoin-cli \- manual page for bitcoin-cli v0.15.99.0 +bitcoin-cli \- manual page for bitcoin-cli v0.16.99.0 .SH DESCRIPTION -Bitcoin Core RPC client version v0.15.99.0 +Bitcoin Core RPC client version v0.16.99.0 .SS "Usage:" .TP bitcoin\-cli [options] <command> [params] @@ -25,6 +25,14 @@ Specify configuration file (default: bitcoin.conf) \fB\-datadir=\fR<dir> .IP Specify data directory +.HP +\fB\-getinfo\fR +.IP +Get general information from the remote server. Note that unlike +server\-side RPC calls, the results of \fB\-getinfo\fR is the result of +multiple non\-atomic requests. Some entries in the result may +represent results from different states (e.g. wallet balance may +be as of a different block from the chain state reported) .PP Chain selection options: .HP @@ -88,7 +96,7 @@ Send RPC for non\-default wallet on RPC server (argument is wallet filename in bitcoind directory, required if bitcoind/\-Qt runs with multiple wallets) .SH COPYRIGHT -Copyright (C) 2009-2017 The Bitcoin Core developers +Copyright (C) 2009-2018 The Bitcoin Core developers Please contribute if you find Bitcoin Core useful. Visit <https://bitcoincore.org> for further information about the software. diff --git a/doc/man/bitcoin-qt.1 b/doc/man/bitcoin-qt.1 index ae35d50ac3..a8c55fb0b3 100644 --- a/doc/man/bitcoin-qt.1 +++ b/doc/man/bitcoin-qt.1 @@ -1,9 +1,9 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. -.TH BITCOIN-QT "1" "September 2017" "bitcoin-qt v0.15.99.0" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. +.TH BITCOIN-QT "1" "January 2018" "bitcoin-qt v0.16.99.0" "User Commands" .SH NAME -bitcoin-qt \- manual page for bitcoin-qt v0.15.99.0 +bitcoin-qt \- manual page for bitcoin-qt v0.16.99.0 .SH DESCRIPTION -Bitcoin Core version v0.15.99.0 (64\-bit) +Bitcoin Core version v0.16.99.0 (64\-bit) Usage: .IP bitcoin\-qt [command\-line options] @@ -32,7 +32,7 @@ block hash) If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: -0000000000000000003b9ce759c2a087d52abc4266f8f4ebd6d768b89defa50a, +0000000000000000005214481d2d96f898e3d5416e43359c145944a909d242e0, testnet: 0000000002e9e7b00e1f6dc5123a04aad68dd0f0968d8c7aa45f6640795c37b1) .HP @@ -52,6 +52,11 @@ Set database cache size in megabytes (4 to 16384, default: 450) .IP Imports blocks from external blk000??.dat file on startup .HP +\fB\-debuglogfile=\fR<file> +.IP +Specify location of debug log file: this can be an absolute path or a +path relative to the data directory (default: debug.log) +.HP \fB\-maxorphantx=\fR<n> .IP Keep at most <n> unconnectable transactions in memory (default: 100) @@ -76,7 +81,7 @@ Extra transactions to keep in memory for compact block reconstructions .HP \fB\-par=\fR<n> .IP -Set the number of script verification threads (\fB\-2\fR to 16, 0 = auto, <0 = +Set the number of script verification threads (\fB\-6\fR to 16, 0 = auto, <0 = leave that many cores free, default: 0) .HP \fB\-pid=\fR<file> @@ -117,7 +122,8 @@ Connection options: .HP \fB\-addnode=\fR<ip> .IP -Add a node to connect to and attempt to keep the connection open +Add a node to connect to and attempt to keep the connection open (see +the `addnode` RPC command help for more info) .HP \fB\-banscore=\fR<n> .IP @@ -136,7 +142,8 @@ for IPv6 \fB\-connect=\fR<ip> .IP Connect only to the specified node(s); \fB\-connect\fR=\fI\,0\/\fR disables automatic -connections +connections (the rules for this peer are the same as for +\fB\-addnode\fR) .HP \fB\-discover\fR .IP @@ -258,6 +265,18 @@ Tries to keep outbound traffic under the given target (in MiB per 24h), .PP Wallet options: .HP +\fB\-addresstype\fR +.IP +What type of addresses to use ("legacy", "p2sh\-segwit", or "bech32", +default: "p2sh\-segwit") +.HP +\fB\-changetype\fR +.IP +What type of change to use ("legacy", "p2sh\-segwit", or "bech32"). +Default is same as \fB\-addresstype\fR, except when +\fB\-addresstype\fR=\fI\,p2sh\-segwit\/\fR a native segwit output is used when +sending to a native segwit address) +.HP \fB\-disablewallet\fR .IP Do not load the wallet and disable wallet RPC calls @@ -307,7 +326,7 @@ confirmation on average within n blocks (default: 6) .HP \fB\-walletrbf\fR .IP -Send transactions with full\-RBF opt\-in enabled (default: 0) +Send transactions with full\-RBF opt\-in enabled (RPC only, default: 0) .HP \fB\-upgradewallet\fR .IP @@ -321,6 +340,11 @@ Specify wallet file (within data directory) (default: wallet.dat) .IP Make the wallet broadcast transactions (default: 1) .HP +\fB\-walletdir=\fR<dir> +.IP +Specify directory to hold wallets (default: <datadir>/wallets if it +exists, otherwise <datadir>) +.HP \fB\-walletnotify=\fR<cmd> .IP Execute command when a wallet transaction changes (%s in cmd is replaced @@ -542,7 +566,7 @@ Show splash screen on startup (default: 1) .IP Reset all settings changed in the GUI .SH COPYRIGHT -Copyright (C) 2009-2017 The Bitcoin Core developers +Copyright (C) 2009-2018 The Bitcoin Core developers Please contribute if you find Bitcoin Core useful. Visit <https://bitcoincore.org> for further information about the software. diff --git a/doc/man/bitcoin-tx.1 b/doc/man/bitcoin-tx.1 index 8b72fbde05..8e6994ac07 100644 --- a/doc/man/bitcoin-tx.1 +++ b/doc/man/bitcoin-tx.1 @@ -1,9 +1,9 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. -.TH BITCOIN-TX "1" "September 2017" "bitcoin-tx v0.15.99.0" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. +.TH BITCOIN-TX "1" "January 2018" "bitcoin-tx v0.16.99.0" "User Commands" .SH NAME -bitcoin-tx \- manual page for bitcoin-tx v0.15.99.0 +bitcoin-tx \- manual page for bitcoin-tx v0.16.99.0 .SH DESCRIPTION -Bitcoin Core bitcoin\-tx utility version v0.15.99.0 +Bitcoin Core bitcoin\-tx utility version v0.16.99.0 .SS "Usage:" .TP bitcoin\-tx [options] <hex\-tx> [commands] @@ -112,7 +112,7 @@ set=NAME:JSON\-STRING .IP Set register NAME to given JSON\-STRING .SH COPYRIGHT -Copyright (C) 2009-2017 The Bitcoin Core developers +Copyright (C) 2009-2018 The Bitcoin Core developers Please contribute if you find Bitcoin Core useful. Visit <https://bitcoincore.org> for further information about the software. diff --git a/doc/man/bitcoind.1 b/doc/man/bitcoind.1 index baf747436f..8728965b2a 100644 --- a/doc/man/bitcoind.1 +++ b/doc/man/bitcoind.1 @@ -1,9 +1,9 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. -.TH BITCOIND "1" "September 2017" "bitcoind v0.15.99.0" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. +.TH BITCOIND "1" "January 2018" "bitcoind v0.16.99.0" "User Commands" .SH NAME -bitcoind \- manual page for bitcoind v0.15.99.0 +bitcoind \- manual page for bitcoind v0.16.99.0 .SH DESCRIPTION -Bitcoin Core Daemon version v0.15.99.0 +Bitcoin Core Daemon version v0.16.99.0 .SS "Usage:" .TP bitcoind [options] @@ -33,7 +33,7 @@ block hash) If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: -0000000000000000003b9ce759c2a087d52abc4266f8f4ebd6d768b89defa50a, +0000000000000000005214481d2d96f898e3d5416e43359c145944a909d242e0, testnet: 0000000002e9e7b00e1f6dc5123a04aad68dd0f0968d8c7aa45f6640795c37b1) .HP @@ -57,6 +57,11 @@ Set database cache size in megabytes (4 to 16384, default: 450) .IP Imports blocks from external blk000??.dat file on startup .HP +\fB\-debuglogfile=\fR<file> +.IP +Specify location of debug log file: this can be an absolute path or a +path relative to the data directory (default: debug.log) +.HP \fB\-maxorphantx=\fR<n> .IP Keep at most <n> unconnectable transactions in memory (default: 100) @@ -81,7 +86,7 @@ Extra transactions to keep in memory for compact block reconstructions .HP \fB\-par=\fR<n> .IP -Set the number of script verification threads (\fB\-2\fR to 16, 0 = auto, <0 = +Set the number of script verification threads (\fB\-6\fR to 16, 0 = auto, <0 = leave that many cores free, default: 0) .HP \fB\-pid=\fR<file> @@ -122,7 +127,8 @@ Connection options: .HP \fB\-addnode=\fR<ip> .IP -Add a node to connect to and attempt to keep the connection open +Add a node to connect to and attempt to keep the connection open (see +the `addnode` RPC command help for more info) .HP \fB\-banscore=\fR<n> .IP @@ -141,7 +147,8 @@ for IPv6 \fB\-connect=\fR<ip> .IP Connect only to the specified node(s); \fB\-connect\fR=\fI\,0\/\fR disables automatic -connections +connections (the rules for this peer are the same as for +\fB\-addnode\fR) .HP \fB\-discover\fR .IP @@ -263,6 +270,18 @@ Tries to keep outbound traffic under the given target (in MiB per 24h), .PP Wallet options: .HP +\fB\-addresstype\fR +.IP +What type of addresses to use ("legacy", "p2sh\-segwit", or "bech32", +default: "p2sh\-segwit") +.HP +\fB\-changetype\fR +.IP +What type of change to use ("legacy", "p2sh\-segwit", or "bech32"). +Default is same as \fB\-addresstype\fR, except when +\fB\-addresstype\fR=\fI\,p2sh\-segwit\/\fR a native segwit output is used when +sending to a native segwit address) +.HP \fB\-disablewallet\fR .IP Do not load the wallet and disable wallet RPC calls @@ -312,7 +331,7 @@ confirmation on average within n blocks (default: 6) .HP \fB\-walletrbf\fR .IP -Send transactions with full\-RBF opt\-in enabled (default: 0) +Send transactions with full\-RBF opt\-in enabled (RPC only, default: 0) .HP \fB\-upgradewallet\fR .IP @@ -326,6 +345,11 @@ Specify wallet file (within data directory) (default: wallet.dat) .IP Make the wallet broadcast transactions (default: 1) .HP +\fB\-walletdir=\fR<dir> +.IP +Specify directory to hold wallets (default: <datadir>/wallets if it +exists, otherwise <datadir>) +.HP \fB\-walletnotify=\fR<cmd> .IP Execute command when a wallet transaction changes (%s in cmd is replaced @@ -521,7 +545,7 @@ non\-verbose mode, non\-segwit(0) or segwit(1) (default: 1) .IP Set the number of threads to service RPC calls (default: 4) .SH COPYRIGHT -Copyright (C) 2009-2017 The Bitcoin Core developers +Copyright (C) 2009-2018 The Bitcoin Core developers Please contribute if you find Bitcoin Core useful. Visit <https://bitcoincore.org> for further information about the software. diff --git a/doc/release-notes.md b/doc/release-notes.md index 29377d4a1d..0292eaa4d2 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -3,7 +3,7 @@ release-notes at release time) Bitcoin Core version *version* is now available from: - <https://bitcoin.org/bin/bitcoin-core-*version*/> + <https://bitcoincore.org/bin/bitcoin-core-*version*/> This is a new major version release, including new features, various bugfixes and performance improvements, as well as updated translations. @@ -56,71 +56,6 @@ frequently tested on them. Notable changes =============== -GCC 4.8.x --------------- -The minimum version of GCC required to compile Bitcoin Core is now 4.8. No effort will be -made to support older versions of GCC. See discussion in issue #11732 for more information. - -HD-wallets by default ---------------------- -Due to a backward-incompatible change in the wallet database, wallets created -with version 0.16.0 will be rejected by previous versions. Also, version 0.16.0 -will only create hierarchical deterministic (HD) wallets. - -Replace-By-Fee by default in GUI --------------------------------- -The send screen now uses BIP-125 RBF by default, regardless of `-walletrbf`. -There is a checkbox to mark the transaction as final. - -The RPC default remains unchanged: to use RBF, launch with `-walletrbf=1` or -use the `replaceable` argument for individual transactions. - -Wallets directory configuration (`-walletdir`) ----------------------------------------------- - -Bitcoin Core now has more flexibility in where the wallets directory can be -located. Previously wallet database files were stored at the top level of the -bitcoin data directory. The behavior is now: - -- For new installations (where the data directory doesn't already exist), - wallets will now be stored in a new `wallets/` subdirectory inside the data - directory by default. -- For existing nodes (where the data directory already exists), wallets will be - stored in the data directory root by default. If a `wallets/` subdirectory - already exists in the data directory root, then wallets will be stored in the - `wallets/` subdirectory by default. -- The location of the wallets directory can be overridden by specifying a - `-walletdir=<path>` option where `<path>` can be an absolute path to a - directory or directory symlink. - -Care should be taken when choosing the wallets directory location, as if it -becomes unavailable during operation, funds may be lost. - -Low-level RPC changes ----------------------- -- The deprecated RPC `getinfo` was removed. It is recommended that the more specific RPCs are used: - * `getblockchaininfo` - * `getnetworkinfo` - * `getwalletinfo` - * `getmininginfo` -- The wallet RPC `getreceivedbyaddress` will return an error if called with an address not in the wallet. -- The wallet RPC `addwitnessaddress` was deprecated and will be removed in version 0.17, - set the `address_type` argument of `getnewaddress`, or option `-addresstype=[bech32|p2sh-segwit]` instead. - -Changed command-line options ------------------------------ -- `-debuglogfile=<file>` can be used to specify an alternative debug logging file. - -Renamed script for creating JSON-RPC credentials ------------------------------ -The `share/rpcuser/rpcuser.py` script was renamed to `share/rpcauth/rpcauth.py`. This script can be -used to create `rpcauth` credentials for a JSON-RPC user. - - -- `dumpwallet` now includes hex-encoded scripts from the wallet in the dumpfile, and - `importwallet` now imports these scripts, but corresponding addresses may not be added - correctly or a manual rescan may be required to find relevant transactions. - Credits ======= diff --git a/doc/release-process.md b/doc/release-process.md index f429b4bbdb..18ff48ea4e 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -13,7 +13,7 @@ Before every minor and major release: * Update version in `configure.ac` (don't forget to set `CLIENT_VERSION_IS_RELEASE` to `true`) * Write release notes (see below) * Update `src/chainparams.cpp` nMinimumChainWork with information from the getblockchaininfo rpc. -* Update `src/chainparams.cpp` defaultAssumeValid with information from the getblockhash rpc. +* Update `src/chainparams.cpp` defaultAssumeValid with information from the getblockhash rpc. - The selected value must not be orphaned so it may be useful to set the value two blocks back from the tip. - Testnet should be set some tens of thousands back from the tip due to reorgs there. - This update should be reviewed with a reindex-chainstate with assumevalid=0 to catch any defect @@ -23,7 +23,8 @@ Before every major release: * Update hardcoded [seeds](/contrib/seeds/README.md), see [this pull request](https://github.com/bitcoin/bitcoin/pull/7415) for an example. * Update [`BLOCK_CHAIN_SIZE`](/src/qt/intro.cpp) to the current size plus some overhead. -* Update `src/chainparams.cpp` chainTxData with statistics about the transaction count and rate. +* Update `src/chainparams.cpp` chainTxData with statistics about the transaction count and rate. Use the output of the RPC `getchaintxstats`, see + [this pull request](https://github.com/bitcoin/bitcoin/pull/12270) for an example. * Update version of `contrib/gitian-descriptors/*.yml`: usually one'd want to do this on master after branching off the release - but be sure to at least do it before a new major release ### First time / New builders diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 96e9b2727b..6eb223171f 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -126,7 +126,7 @@ public: // Note that of those which support the service bits prefix, most only support a subset of // possible options. - // This is fine at runtime as we'll fall back to using them as a oneshot if they dont support the + // This is fine at runtime as we'll fall back to using them as a oneshot if they don't support the // service bits we want, but we should get them updated to support all service bits wanted by any // release ASAP to avoid it where possible. vSeeds.emplace_back("seed.bitcoin.sipa.be"); // Pieter Wuille, only supports x1, x5, x9, and xd diff --git a/src/net.cpp b/src/net.cpp index 8111390749..5f4c0eecab 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -410,7 +410,7 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo // Connect bool connected = false; - SOCKET hSocket; + SOCKET hSocket = INVALID_SOCKET; proxyType proxy; if (addrConnect.IsValid()) { bool proxyConnectionFailed = false; @@ -1682,8 +1682,7 @@ void CConnman::ProcessOneShot() CAddress addr; CSemaphoreGrant grant(*semOutbound, true); if (grant) { - if (!OpenNetworkConnection(addr, false, &grant, strDest.c_str(), true)) - AddOneShot(strDest); + OpenNetworkConnection(addr, false, &grant, strDest.c_str(), true); } } @@ -1953,29 +1952,29 @@ void CConnman::ThreadOpenAddedConnections() } // if successful, this moves the passed grant to the constructed node -bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound, const char *pszDest, bool fOneShot, bool fFeeler, bool manual_connection) +void CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound, const char *pszDest, bool fOneShot, bool fFeeler, bool manual_connection) { // // Initiate outbound network connection // if (interruptNet) { - return false; + return; } if (!fNetworkActive) { - return false; + return; } if (!pszDest) { if (IsLocal(addrConnect) || FindNode((CNetAddr)addrConnect) || IsBanned(addrConnect) || FindNode(addrConnect.ToStringIPPort())) - return false; + return; } else if (FindNode(std::string(pszDest))) - return false; + return; CNode* pnode = ConnectNode(addrConnect, pszDest, fCountFailure); if (!pnode) - return false; + return; if (grantOutbound) grantOutbound->MoveTo(pnode->grantOutbound); if (fOneShot) @@ -1990,8 +1989,6 @@ bool CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFai LOCK(cs_vNodes); vNodes.push_back(pnode); } - - return true; } void CConnman::ThreadMessageHandler() @@ -177,7 +177,7 @@ public: void Interrupt(); bool GetNetworkActive() const { return fNetworkActive; }; void SetNetworkActive(bool active); - bool OpenNetworkConnection(const CAddress& addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound = nullptr, const char *strDest = nullptr, bool fOneShot = false, bool fFeeler = false, bool manual_connection = false); + void OpenNetworkConnection(const CAddress& addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound = nullptr, const char *strDest = nullptr, bool fOneShot = false, bool fFeeler = false, bool manual_connection = false); bool CheckIncomingNonce(uint64_t nonce); bool ForNode(NodeId id, std::function<bool(CNode* pnode)> func); diff --git a/src/netbase.cpp b/src/netbase.cpp index 276b2f4dc2..d51277c495 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -682,6 +682,9 @@ bool CloseSocket(SOCKET& hSocket) #else int ret = close(hSocket); #endif + if (ret) { + LogPrintf("Socket close failed: %d. Error: %s\n", hSocket, NetworkErrorString(WSAGetLastError())); + } hSocket = INVALID_SOCKET; return ret != SOCKET_ERROR; } diff --git a/src/protocol.h b/src/protocol.h index 43d8ac067a..aaeb90eee2 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -294,7 +294,7 @@ enum ServiceFlags : uint64_t { * Thus, generally, avoid calling with peerServices == NODE_NONE, unless * state-specific flags must absolutely be avoided. When called with * peerServices == NODE_NONE, the returned desirable service flags are - * guaranteed to not change dependant on state - ie they are suitable for + * guaranteed to not change dependent on state - ie they are suitable for * use when describing peers which we know to be desirable, but for which * we do not have a confirmed set of service flags. * diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index ea4d6a4816..acb3f2346f 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -31,7 +31,6 @@ #include <QTreeWidget> QList<CAmount> CoinControlDialog::payAmounts; -CCoinControl* CoinControlDialog::coinControl = new CCoinControl(); bool CoinControlDialog::fSubtractFeeFromAmount = false; bool CCoinControlWidgetItem::operator<(const QTreeWidgetItem &other) const { @@ -193,7 +192,7 @@ void CoinControlDialog::buttonSelectAllClicked() ui->treeWidget->topLevelItem(i)->setCheckState(COLUMN_CHECKBOX, state); ui->treeWidget->setEnabled(true); if (state == Qt::Unchecked) - coinControl->UnSelectAll(); // just to be sure + coinControl()->UnSelectAll(); // just to be sure CoinControlDialog::updateLabels(model, this); } @@ -379,11 +378,11 @@ void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column) COutPoint outpt(uint256S(item->text(COLUMN_TXHASH).toStdString()), item->text(COLUMN_VOUT_INDEX).toUInt()); if (item->checkState(COLUMN_CHECKBOX) == Qt::Unchecked) - coinControl->UnSelect(outpt); + coinControl()->UnSelect(outpt); else if (item->isDisabled()) // locked (this happens if "check all" through parent node) item->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked); else - coinControl->Select(outpt); + coinControl()->Select(outpt); // selection changed -> update labels if (ui->treeWidget->isEnabled()) // do not update on every click for (un)select all @@ -446,7 +445,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) std::vector<COutPoint> vCoinControl; std::vector<COutput> vOutputs; - coinControl->ListSelected(vCoinControl); + coinControl()->ListSelected(vCoinControl); model->getOutputs(vCoinControl, vOutputs); for (const COutput& out : vOutputs) { @@ -456,7 +455,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) COutPoint outpt(txhash, out.i); if (model->isSpent(outpt)) { - coinControl->UnSelect(outpt); + coinControl()->UnSelect(outpt); continue; } @@ -509,7 +508,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) nBytes -= 34; // Fee - nPayFee = GetMinimumFee(nBytes, *coinControl, ::mempool, ::feeEstimator, nullptr /* FeeCalculation */); + nPayFee = GetMinimumFee(nBytes, *coinControl(), ::mempool, ::feeEstimator, nullptr /* FeeCalculation */); if (nPayAmount > 0) { @@ -600,6 +599,12 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) label->setVisible(nChange < 0); } +CCoinControl* CoinControlDialog::coinControl() +{ + static CCoinControl coin_control; + return &coin_control; +} + void CoinControlDialog::updateView() { if (!model || !model->getOptionsModel() || !model->getAddressTableModel()) @@ -703,13 +708,13 @@ void CoinControlDialog::updateView() if (model->isLockedCoin(txhash, out.i)) { COutPoint outpt(txhash, out.i); - coinControl->UnSelect(outpt); // just to be sure + coinControl()->UnSelect(outpt); // just to be sure itemOutput->setDisabled(true); itemOutput->setIcon(COLUMN_CHECKBOX, platformStyle->SingleColorIcon(":/icons/lock_closed")); } // set checkbox - if (coinControl->IsSelected(COutPoint(txhash, out.i))) + if (coinControl()->IsSelected(COutPoint(txhash, out.i))) itemOutput->setCheckState(COLUMN_CHECKBOX, Qt::Checked); } diff --git a/src/qt/coincontroldialog.h b/src/qt/coincontroldialog.h index 355ed5f553..a254c55556 100644 --- a/src/qt/coincontroldialog.h +++ b/src/qt/coincontroldialog.h @@ -52,7 +52,7 @@ public: static void updateLabels(WalletModel*, QDialog*); static QList<CAmount> payAmounts; - static CCoinControl *coinControl; + static CCoinControl *coinControl(); static bool fSubtractFeeFromAmount; private: diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 9fd61db70e..1227e340ce 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -256,7 +256,7 @@ void SendCoinsDialog::on_sendButton_clicked() // Always use a CCoinControl instance, use the CoinControlDialog instance if CoinControl has been enabled CCoinControl ctrl; if (model->getOptionsModel()->getCoinControlFeatures()) - ctrl = *CoinControlDialog::coinControl; + ctrl = *CoinControlDialog::coinControl(); updateCoinControlState(ctrl); @@ -367,7 +367,7 @@ void SendCoinsDialog::on_sendButton_clicked() if (sendStatus.status == WalletModel::OK) { accept(); - CoinControlDialog::coinControl->UnSelectAll(); + CoinControlDialog::coinControl()->UnSelectAll(); coinControlUpdateLabels(); } fNewRecipientAllowed = true; @@ -604,7 +604,7 @@ void SendCoinsDialog::useAvailableBalance(SendCoinsEntry* entry) // Get CCoinControl instance if CoinControl is enabled or create a new one. CCoinControl coin_control; if (model->getOptionsModel()->getCoinControlFeatures()) { - coin_control = *CoinControlDialog::coinControl; + coin_control = *CoinControlDialog::coinControl(); } // Calculate available amount to send. @@ -754,7 +754,7 @@ void SendCoinsDialog::coinControlFeatureChanged(bool checked) ui->frameCoinControl->setVisible(checked); if (!checked && model) // coin control features disabled - CoinControlDialog::coinControl->SetNull(); + CoinControlDialog::coinControl()->SetNull(); coinControlUpdateLabels(); } @@ -773,7 +773,7 @@ void SendCoinsDialog::coinControlChangeChecked(int state) { if (state == Qt::Unchecked) { - CoinControlDialog::coinControl->destChange = CNoDestination(); + CoinControlDialog::coinControl()->destChange = CNoDestination(); ui->labelCoinControlChangeLabel->clear(); } else @@ -789,7 +789,7 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text) if (model && model->getAddressTableModel()) { // Default to no change address until verified - CoinControlDialog::coinControl->destChange = CNoDestination(); + CoinControlDialog::coinControl()->destChange = CNoDestination(); ui->labelCoinControlChangeLabel->setStyleSheet("QLabel{color:red;}"); const CTxDestination dest = DecodeDestination(text.toStdString()); @@ -812,7 +812,7 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text) QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); if(btnRetVal == QMessageBox::Yes) - CoinControlDialog::coinControl->destChange = dest; + CoinControlDialog::coinControl()->destChange = dest; else { ui->lineEditCoinControlChange->setText(""); @@ -831,7 +831,7 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text) else ui->labelCoinControlChangeLabel->setText(tr("(no label)")); - CoinControlDialog::coinControl->destChange = dest; + CoinControlDialog::coinControl()->destChange = dest; } } } @@ -843,7 +843,7 @@ void SendCoinsDialog::coinControlUpdateLabels() if (!model || !model->getOptionsModel()) return; - updateCoinControlState(*CoinControlDialog::coinControl); + updateCoinControlState(*CoinControlDialog::coinControl()); // set pay amounts CoinControlDialog::payAmounts.clear(); @@ -861,7 +861,7 @@ void SendCoinsDialog::coinControlUpdateLabels() } } - if (CoinControlDialog::coinControl->HasSelected()) + if (CoinControlDialog::coinControl()->HasSelected()) { // actual coin control calculation CoinControlDialog::updateLabels(model, this); diff --git a/src/streams.h b/src/streams.h index 98e25178e1..9f86c4a163 100644 --- a/src/streams.h +++ b/src/streams.h @@ -82,7 +82,7 @@ class CVectorWriter * @param[in] nVersionIn Serialization Version (including any flags) * @param[in] vchDataIn Referenced byte vector to overwrite/append * @param[in] nPosIn Starting position. Vector index where writes should start. The vector will initially - * grow as necessary to max(nPosIn, vec.size()). So to append, use vec.size(). + * grow as necessary to max(nPosIn, vec.size()). So to append, use vec.size(). */ CVectorWriter(int nTypeIn, int nVersionIn, std::vector<unsigned char>& vchDataIn, size_t nPosIn) : nType(nTypeIn), nVersion(nVersionIn), vchData(vchDataIn), nPos(nPosIn) { diff --git a/src/sync.cpp b/src/sync.cpp index ae6e721466..bf3d131e4e 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -25,8 +25,8 @@ void PrintLockContention(const char* pszName, const char* pszFile, int nLine) // // Early deadlock detection. // Problem being solved: -// Thread 1 locks A, then B, then C -// Thread 2 locks D, then C, then A +// Thread 1 locks A, then B, then C +// Thread 2 locks D, then C, then A // --> may result in deadlock between the two threads, depending on when they run. // Solution implemented here: // Keep track of pairs of locks: (A before B), (A before C), etc. diff --git a/src/validation.cpp b/src/validation.cpp index 8cee0dfac3..698ef9181d 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2577,7 +2577,7 @@ bool CChainState::ActivateBestChain(CValidationState &state, const CChainParams& if (GetMainSignals().CallbacksPending() > 10) { // Block until the validation queue drains. This should largely // never happen in normal operation, however may happen during - // reindex, causing memory blowup if we run too far ahead. + // reindex, causing memory blowup if we run too far ahead. SyncWithValidationInterfaceQueue(); } diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index 7e0881afd7..f39471b871 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -103,7 +103,7 @@ BOOST_AUTO_TEST_CASE(coin_selection_tests) // we can't make 3 cents of mature coins BOOST_CHECK(!testWallet.SelectCoinsMinConf( 3 * CENT, 1, 6, 0, vCoins, setCoinsRet, nValueRet)); - // we can make 3 cents of new coins + // we can make 3 cents of new coins BOOST_CHECK( testWallet.SelectCoinsMinConf( 3 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet)); BOOST_CHECK_EQUAL(nValueRet, 3 * CENT); diff --git a/test/functional/feature_uacomment.py b/test/functional/feature_uacomment.py index 0b2c64ab69..bc3791508a 100755 --- a/test/functional/feature_uacomment.py +++ b/test/functional/feature_uacomment.py @@ -23,7 +23,7 @@ class UacommentTest(BitcoinTestFramework): self.log.info("test -uacomment max length") self.stop_node(0) - expected = "Total length of network version string (286) exceeds maximum length (256). Reduce the number or size of uacomments." + expected = "exceeds maximum length (256). Reduce the number or size of uacomments." self.assert_start_raises_init_error(0, ["-uacomment=" + 'a' * 256], expected) self.log.info("test -uacomment unsafe characters") diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index fe14591139..4d9661de37 100755 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -6,7 +6,7 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Bitcoin P2P network half-a-node. -This python code was modified from ArtForz' public domain half-a-node, as +This python code was modified from ArtForz' public domain half-a-node, as found in the mini-node branch of http://github.com/jgarzik/pynode. P2PConnection: A low-level connection object to a node's P2P interface diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 98944685e1..c670878d68 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -472,21 +472,15 @@ class TestResult(): def check_script_prefixes(): - """Check that at most a handful of the - test scripts don't start with one of the allowed name prefixes.""" - - # LEEWAY is provided as a transition measure, so that pull-requests - # that introduce new tests that don't conform with the naming - # convention don't immediately cause the tests to fail. - LEEWAY = 10 + """Check that test scripts start with one of the allowed name prefixes.""" good_prefixes_re = re.compile("(example|feature|interface|mempool|mining|p2p|rpc|wallet)_") bad_script_names = [script for script in ALL_SCRIPTS if good_prefixes_re.match(script) is None] - if len(bad_script_names) > 0: - print("INFO: %d tests not meeting naming conventions:" % (len(bad_script_names))) + if bad_script_names: + print("%sERROR:%s %d tests not meeting naming conventions:" % (BOLD[1], BOLD[0], len(bad_script_names))) print(" %s" % ("\n ".join(sorted(bad_script_names)))) - assert len(bad_script_names) <= LEEWAY, "Too many tests not following naming convention! (%d found, maximum: %d)" % (len(bad_script_names), LEEWAY) + raise AssertionError("Some tests are not following naming convention!") def check_script_list(src_dir): |