Commit graph

19541 commits

Author SHA1 Message Date
João Barbosa 7cf994d5cf qa: Improve tests of /rest/headers and /rest/block 2019-01-16 14:46:09 +00:00
João Barbosa 0825b86b28 doc: /rest/block responds with 404 if block does not exist 2019-01-16 14:42:22 +00:00
Wladimir J. van der Laan d44b01f028
Merge #14268: Introduce SafeDbt to handle Dbt with free or memory_cleanse raii-style
4a86a0acd9 Make SafeDbt DB_DBT_MALLOC on default initialization (Ben Woosley)
1a9f9f7e5e Introduce SafeDbt to handle DB_DBT_MALLOC raii-style (Ben Woosley)
951a44e9cd Drop unused setRange arg to BerkeleyBatch::ReadAtCursor (Ben Woosley)

Pull request description:

  This provides additional exception-safety and case handling for the proper
  freeing of the associated buffers.

Tree-SHA512: a038d728290cdb3905e7d881608052a6675b6425729ceaf7cfe69a6e91c2ee293cdb01e4b695a20963459ffdd9d4a1f9a08b3c07b1b5ba1aa8590a8149f686db
2019-01-16 14:56:21 +01:00
Wladimir J. van der Laan 19c60ca497
Merge #14151: windows: Fix remaining compiler warnings (MSVC)
b9dafe7d9f Fix remaining compiler warnings (MSVC). Move disabling of specific warnings from /nowarn to project file. (practicalswift)

Pull request description:

  Fix remaining compiler warnings (MSVC).

  Before:

  ```
  $ msbuild /p:TrackFileAccess=false /p:CLToolExe=clcache.exe build_msvc\bitcoin.sln /m /v:q /nowarn:C4244;C4267;C4715 /nologo
  …\script\script.cpp(272): warning C4018: '>': signed/unsigned mismatch
  …\test\allocator_tests.cpp(147): warning C4312: 'reinterpret_cast': conversion from 'int' to 'void *' of greater size
  …\boost\test\tools\old\impl.hpp(107): warning C4805: '==': unsafe mix of type 'const Left' and type 'const Right' in operation
  …\test\crypto_tests.cpp(535): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
  …\test\script_tests.cpp(188): warning C4805: '==': unsafe mix of type 'int' and type 'bool' in operation
  …\test\script_tests.cpp(190): warning C4805: '==': unsafe mix of type 'int' and type 'bool' in operation
  …\test\script_tests.cpp(191): warning C4805: '==': unsafe mix of type 'int' and type 'bool' in operation
  $
  ```

  After:

  ```
  $ msbuild /p:TrackFileAccess=false /p:CLToolExe=clcache.exe build_msvc\bitcoin.sln /m /v:q /nowarn:C4244;C4267;C4715;C4805 /nologo
  $
  ```

Tree-SHA512: 5b30334d3804e869779e77dad75a799e8e5e7eb2e08634cd40035cce140edd623cbb6c8b5806d2158c3df97888d3ea9ff4b8b6a5a83de3fe2cb361e29588c115
2019-01-16 13:50:37 +01:00
Wladimir J. van der Laan 64ee94356f
Merge #14409: utils and libraries: Make 'blocksdir' always net specific
e4a0c3547e Improve blocksdir functional test. (Hennadii Stepanov)
c3f1821ac7 Make blockdir always net specific (Hennadii Stepanov)

Pull request description:

  The blocks directory is net specific by definition.

  Also this prevents the side effect of calling `GetBlocksDir(false)` in the non-mainnet environment.
  Currently a new node creates an unused `blocks\` directory in the root of the data directory when `-testnet` or `-regtest` is specified.

  Refs:
  - #12653
  - https://github.com/bitcoin/bitcoin/pull/12653#discussion_r174784834 by @laanwj
  - https://github.com/bitcoin/bitcoin/issues/14595#issuecomment-436011186

Tree-SHA512: c9957a68a4a200ebd2010823a56db7e61563afedcb7c9828e86b13f3af2990e07854b622c1f3374756f94574acb3ea32de7d2a399eef6c0623f0e11265155627
2019-01-16 13:40:27 +01:00
Wladimir J. van der Laan 3ae3748ce1
Merge #14958: qa: Remove race between connecting and shutdown on separate connections
4412a59bfe qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error https://github.com/bitcoin/bitcoin/pull/14670#issuecomment-447255352 reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also https://github.com/bitcoin/bitcoin/pull/14670#issuecomment-447304513.

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
2019-01-16 13:05:32 +01:00
João Barbosa 4412a59bfe qa: Remove race between connecting and shutdown on separate connections 2019-01-16 12:01:42 +00:00
Hennadii Stepanov 979bc0c206
Improve "help-console" message
Added a note that results can be queried in the parenthesized syntax.
Deprecated boolean `verbose` replaced with numerical `verbosity` in
`getblock` examples.
2019-01-16 13:50:06 +02:00
João Barbosa be625f7c55 doc: Explain empty result of /rest/headers 2019-01-16 11:44:03 +00:00
Wladimir J. van der Laan acec9e45c6
Merge #15136: qt: "Peers" tab overhaul
3537c8345c Do not deselect peer when switching away from tab (Hennadii Stepanov)
b0037c5190 Improve Peers tab layout (Hennadii Stepanov)

Pull request description:

  This is an alternative to #14798.

  The "Peers" tab of the "Debug" window improved to address comments https://github.com/bitcoin/bitcoin/pull/6209#issuecomment-108072605 (by @jonasschnelli) and https://github.com/bitcoin/bitcoin/pull/14798#issuecomment-441618268 (by @promag).

  This allows to keep the peer selection while navigating to other places and effectively reverts e059726811.

  Screenshots with this PR:
  ![screenshot from 2019-01-09 22-01-36](https://user-images.githubusercontent.com/32963518/50927352-2e6fb700-1460-11e9-9173-582348210492.png)
  ![screenshot from 2019-01-09 22-02-11](https://user-images.githubusercontent.com/32963518/50927354-329bd480-1460-11e9-9926-d0eb0f026a35.png)
  ![screenshot from 2019-01-09 22-02-37](https://user-images.githubusercontent.com/32963518/50927358-3596c500-1460-11e9-864d-c8704451f3d9.png)

Tree-SHA512: 3d086007f6d72930bc2fc3c395175adda0f1a7722de3842bc246ee4f3bfc5ebda4b9a626fb68a7ee8663a88d0842deb37c0c460ad84cc58e22f138acf8bc71ea
2019-01-16 12:38:27 +01:00
Wladimir J. van der Laan bcdd31f265
Merge #15165: contrib: Allow use of github API authentication in github-merge
f1bd219a5b contrib: Allow use of github API authentication in github-merge (Wladimir J. van der Laan)
a4c5bbfcd3 contrib: Add support for http[s] URLs in github-merge (Wladimir J. van der Laan)
059a3cffdf contrib: Detailed reporting for http errors in github-merge (Wladimir J. van der Laan)

Pull request description:

  Three commits I had locally for `github-merge.py`:

  -  *Detailed reporting for http errors in github-merge*: Print detailed error, this makes it easier to diagnose github API issues.
  - *Add support for http[s] URLs in github-merge*: Sometimes it can be useful to use github-merge with read-only access (say, for reviewing and testing from untrusted VMs).
  - *Allow use of github API authentication in github-merge*: The API request limit for unauthenticated requests is quite low. I started running into rate limiting errors. The limit for authenticated requests is much higher. This patch adds an optional configuration setting `user.ghtoken` that, when set, is used to authenticate requests to the API.

Tree-SHA512: ca8ae1874a787263e49d915d7cf31c0c0f50aba229c9440265bf1fda69f7e00641d1492512b93d76c17ff1766859283d640d37770acb120898736ad97efbd5c2
2019-01-16 12:12:14 +01:00
Wladimir J. van der Laan 16c4a5373b
Merge #15170: refactor/lint: Add ignored shellcheck suggestions to an array
cbd9091ed5 refactor/lint: Add ignored suggestions to an array (Vidar Holen)

Pull request description:

  By adding excluded shellcheck suggestions to an array, you can avoid the current duplication
  between command and comments. This ensures that they never go out of sync, makes it easier to
  add new ones, and improves the readability of related diffs.

Tree-SHA512: 04afced1d27fda940cc5e61d7f9ed04507c8f7f7dfd0031c09898a599c6de93695923a80cb3d515a0f0bf728847592d8680c15ac2e376b48726c03ca744f13a5
2019-01-16 12:03:34 +01:00
John Newbery b745e149c2 [docs] Expand help text for importmulti changes 2019-01-15 17:24:46 -05:00
MarcoFalke 391a27376b
Merge #15173: [doc] explain what .python-version does
04215eb328 [doc] explain what .python-version does (Sjors Provoost)

Pull request description:

  Documentation followup to https://github.com/bitcoin/bitcoin/pull/14884#discussion_r241444376.

Tree-SHA512: 7b2b2718f998b7257273fab2e4f1d127f7af468cd26b2bf05b3dc7d6367e349e0a9c92e976a2760e83cf56feb68c37c89cb3a8d92e20be900bea3fb7f1f3d47b
2019-01-15 16:05:50 -05:00
practicalswift b9dafe7d9f Fix remaining compiler warnings (MSVC). Move disabling of specific warnings from /nowarn to project file. 2019-01-15 20:15:26 +01:00
Jonas Schnelli c7c84209bb
Merge #15149: gui: Show current wallet name in window title
fe7048b39 gui: Show current wallet name in window title (João Barbosa)
8a7926112 gui: Keep network style in BitcoinGUI (João Barbosa)
f411c8b35 gui: Remove unused return type in some BitcoinGUI methods (João Barbosa)

Pull request description:

  <img width="876" alt="screenshot 2019-01-11 at 23 58 26" src="https://user-images.githubusercontent.com/3534524/51065458-d7ebaf80-15fc-11e9-9162-e37e9a10d448.png">

Tree-SHA512: 5c43f615834983bc1c5045e07c6e119044dd78ca947fd2679d302b519d5ce1d08d29ca00b1c11e88c4bbc4d56f2e6f4a8adc42084f3503e751e642e8a13112dc
2019-01-15 09:01:53 -10:00
Sjors Provoost 04215eb328
[doc] explain what .python-version does 2019-01-15 19:58:11 +01:00
MarcoFalke 82ffd4d918
Merge #14963: mempool, validation: Explain cs_main locking semantics
fa5e373365 validation: Add cs_main locking annotations (MarcoFalke)
fa5c346c5a doc: Add comment to cs_main and mempool::cs (MarcoFalke)
fafe941bdd test: Add missing validation locks (MarcoFalke)
fac4558462 sync: Add RecursiveMutex type alias (MarcoFalke)

Pull request description:

  Both the chain state and the transaction pool are validation specific, but access to them is protected by two locks. The two locks have the following semantics:

  * Writing to the chain state or adding transactions to the transaction pool -> Take both `cs_main` and `mempool::cs`
  * Reading either or removing transactions from the the transaction pool -> Take only the appropriate lock

Tree-SHA512: 6f6e612ffc391904c6434a79a4f3f8de1b928bf0a3e3434b73561037b395e2b40a70a5a4bd8472dd230e9eacc8e5d5374c904a3c509910cf3971dd7ff59a626c
2019-01-15 13:42:05 -05:00
Russell Yanofsky 44de1561aa Remove remaining chainActive references from CWallet
This commit does not change behavior.

Co-authored-by: Ben Woosley <ben.woosley@gmail.com>
2019-01-15 08:42:00 -08:00
Wladimir J. van der Laan eb2aecfb80
Merge #14433: Add checksum in gitian build scripts for ossl
03b8596dd6 Add checksum in gitian build scripts for ossl (TheCharlatan)

Pull request description:

  This adds a checksum in the gitian build script to make sure that ossl tool and theuni's patch matches what is expected. Also changes the url to use https.

Tree-SHA512: bd25acda1c7d9ca94e710bdfa915d20810101e10b0c68913a00fcb0eada25cdc2d59f7efebc822e07dea7eaab058024e6c53031883ded0ecf9f08212e50a25b3
2019-01-15 17:42:00 +01:00
Russell Yanofsky db21f02648 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis
Only change in behavior is "Rescan started from block <height>" message
replaced by "Rescan started from block <hash>" message in
ScanForWalletTransactions.

Co-authored-by: Ben Woosley <ben.woosley@gmail.com>
2019-01-15 08:42:00 -08:00
Russell Yanofsky 2ffb07929e Add findFork and findBlock to the Chain interface
And use them to remove uses of chainActive and mapBlockIndex in wallet code

This commit does not change behavior.

Co-authored-by: Ben Woosley <ben.woosley@gmail.com>
2019-01-15 08:42:00 -08:00
Russell Yanofsky d93c4c1d6e Add time methods to the Chain interface
And use them to remove uses of chainActive and mapBlockIndex in wallet code

This commit does not change behavior.

Co-authored-by: Ben Woosley <ben.woosley@gmail.com>
2019-01-15 08:42:00 -08:00
Russell Yanofsky 700c42b85d Add height, depth, and hash methods to the Chain interface
And use them to remove uses of chainActive and mapBlockIndex in wallet code

This commit does not change behavior.

Co-authored-by: Ben Woosley <ben.woosley@gmail.com>
2019-01-15 12:42:00 -04:00
Wladimir J. van der Laan e8ad580f51
Merge #14556: qt: fix confirmed transaction labeled "open" (#13299)
fb3ce75807 Don't label transactions "Open" while catching up (Hennadii Stepanov)

Pull request description:

  Fix #13299.

  Since the default `nSequence` is `0xFFFFFFFE` and locktime is enabled, the checking `wtx.is_final` is meaningless until the syncing has completed (ref: #1026).

  This PR makes the wallet mark a transaction "Unconfirmed" instead of misleading "Open for NNN more blocks" when syncing after a period of being offline.

  Before this PR (with the issue):
  ![screenshot from 2018-12-12 15-56-23](https://user-images.githubusercontent.com/32963518/49874288-cdd06880-fe26-11e8-8441-f3ceb479611b.png)

  With this PR (the issue has been resolved):
  ![screenshot from 2018-12-12 15-54-41](https://user-images.githubusercontent.com/32963518/49874336-e9d40a00-fe26-11e8-8c05-9aeee2eb1bba.png)

Tree-SHA512: 358ec83b43c266a4d32a37a79dda80e80d40a2b77ad38261c84a095e613399f674aa7184805b3f6310e51ddb83ae2636b8849fcc7c4333e1b3ecbb0f70ad86d3
2019-01-15 17:39:19 +01:00
João Barbosa fe7048b39b gui: Show current wallet name in window title 2019-01-15 16:23:55 +00:00
João Barbosa 8a79261124 gui: Keep network style in BitcoinGUI 2019-01-15 16:23:55 +00:00
João Barbosa f411c8b35b gui: Remove unused return type in some BitcoinGUI methods 2019-01-15 14:31:22 +00:00
Wladimir J. van der Laan a5daf70ffb
Merge #14594: qt: Fix minimized window bug on Linux
a88640e123 Fix minimized window bug on Linux (Hennadii Stepanov)

Pull request description:

  Fix #14591

  On some Linux systems the minimized to the taskbar (iconified) main window cannot be restored properly using actions from the systray icon menu when `QSystemTrayIcon::contextMenu()` is a child of the main window.

Tree-SHA512: 05c9f724fc2278d45dac6fe72b09859f12b5d71f54659bb779403c8cd81b55e610fb7b5aa912ac273d3cd19bf953b0405bbc6451feb00d1827c95dd9f0876aa4
2019-01-15 15:27:10 +01:00
Wladimir J. van der Laan 1b6fc30530
Merge #14941: rpc: Make unloadwallet wait for complete wallet unload
645e905c32 doc: Add release notes for unloadwallet change to synchronous call (João Barbosa)
c37851de57 rpc: Make unloadwallet wait for complete wallet unload (João Barbosa)

Pull request description:

  Currently the `unloadwallet` RPC is asynchronous, it only signals the intent to unload the wallet and then returns the response to the client. The actual unload can happen later and the client has no way to be notified of that.

  This PR makes the `unloadwallet` RPC synchronous, meaning that it blocks until the wallet is fully unloaded.

  Replaces #14919, fixes #14917.

Tree-SHA512: ad88b980e2f3652809a58f904afbfe020299f3aa6a517f495ba943b8d54d4520f6e70074d6749be8f5967065c0f476e0faedcde64c8b4899e5f99c70f0fd6534
2019-01-15 14:38:23 +01:00
Vidar Holen cbd9091ed5 refactor/lint: Add ignored suggestions to an array
This avoids duplicating the codes between command and comments.
2019-01-14 18:58:57 -08:00
João Barbosa 645e905c32 doc: Add release notes for unloadwallet change to synchronous call 2019-01-15 00:01:00 +00:00
João Barbosa c37851de57 rpc: Make unloadwallet wait for complete wallet unload 2019-01-15 00:01:00 +00:00
Hennadii Stepanov 7c572c488d
Add workaround for QProgressDialog bug on macOS
See: QTBUG-65750, QTBUG-70357.
2019-01-15 01:28:00 +02:00
Hennadii Stepanov ca91661adf
Fix wallet selector size adjustment 2019-01-14 20:49:19 +02:00
Wladimir J. van der Laan cf0c67b62c
Merge #14982: rpc: Add getrpcinfo command
a0ac15459a doc: Add getrpcinfo release notes (João Barbosa)
251a91c1bf qa: Add tests for getrpcinfo (João Barbosa)
d0730f5ce4 rpc: Add getrpcinfo command (João Barbosa)
068a8fc05f rpc: Track active commands (João Barbosa)
bf4383277d rpc: Remove unused PreCommand signal (João Barbosa)

Pull request description:

  The new `getrpcinfo` command exposes details of the RPC interface. The details can be configuration properties or runtime values/stats.

  This can be particular useful to coordinate concurrent functional tests (see #14958 from where this was extracted).

Tree-SHA512: 7292cb6087f4c429973d991aa2b53ffa1327d5a213df7d6ba5fc69b01b2e1a411f6d1609fed9234896293317dab05f65064da48b8f2b4a998eba532591d31882
2019-01-14 18:07:15 +01:00
Wladimir J. van der Laan f1bd219a5b contrib: Allow use of github API authentication in github-merge
The API request limit for unauthenticated requests is quite low.
I started running into rate limiting errors. The limit
for authenticated requests is much higher.

This patch adds an optional configuration setting `user.ghtoken`
that, when set, is used to authenticate requests to the API.
2019-01-14 16:48:23 +01:00
Wladimir J. van der Laan a4c5bbfcd3 contrib: Add support for http[s] URLs in github-merge
Sometimes it can be useful to use github-merge with read-only access
(say, for reviewing and testing).
2019-01-14 16:33:13 +01:00
Wladimir J. van der Laan 059a3cffdf contrib: Detailed reporting for http errors in github-merge
Print detailed error, this makes it easier to diagnose github API issues.
2019-01-14 16:32:05 +01:00
Wladimir J. van der Laan 035f349371
Merge #15164: qa: Ignore shellcheck warning SC2236
f652f85d0c qa: Ignore shellcheck warning SC2236 (João Barbosa)

Pull request description:

  With shellcheck 0.6.0 the warning `SC2236 -  Use -n instead of ! -z` is raised. This change adds that warning to the ignored list.

Tree-SHA512: 7b0dfbce55e5da4efb927e251257993cdf67cd1c90f8490d99fa75bf6e233bbee79ea1c59d28774994c59862c5eac061313aa154833284950fc844bda60a54e9
2019-01-14 16:24:37 +01:00
João Barbosa f652f85d0c qa: Ignore shellcheck warning SC2236
With shellcheck 0.6.0 the warning `SC2236 -  Use -n instead of ! -z` is raised.
This change adds that warning to the ignored list.
2019-01-14 15:21:47 +00:00
Wladimir J. van der Laan 76335298f4
Merge #15114: Qt: Replace remaining 0 with nullptr
3a0e76fc12 Replace remaining 0 with nullptr in Qt code (Ben Woosley)
9096276e0b Don't use zero as null pointer constant (-Wzero-as-null-pointer-constant) (practicalswift)

Pull request description:

  This corrects all violations of `-Wzero-as-null-pointer-constant` identified in the Qt codebase.

  These changes are extracted from #15112 as suggested by @MarcoFalke to ease review. This is in service of enabling `-Wzero-as-null-pointer-constant`, which should eliminate this as a concern going forward.

  Note there are 2 non-Qt changes: `src/test/allocator_tests.cpp` and `src/wallet/db.cpp`.

Tree-SHA512: 206bd668802147ba42bc413c2d7d259cb59aca9ec1da74a6bf2ca3932e60ae492faacbc61bcee0fd6b4b49a4d59d075b7e5404f0526b36c47718f9b0587e7768
2019-01-14 15:21:32 +01:00
Wladimir J. van der Laan 070eaf7fe5
Merge #15144: [refactor] CNode: Use C++11 default member initializers
fac2f5ecae Use C++11 default member initializers (MarcoFalke)

Pull request description:

  The second and last change on this topic (c.f. #15109). Split up because the diff would otherwise interleave, making review harder than necessary.

  This is not a stylistic change, but a change that avoids bugs such as:

  *  fix uninitialized read when stringifying an addrLocal #14728
  *  qt: Initialize members in WalletModel #12426
  *  net: correctly initialize nMinPingUsecTime #6636
  * ...

Tree-SHA512: 547ae72b87aeaed5890eb5fdcff612bfc93354632b238d89e1e1c0487187f39609bcdc537ef21345e0aea8cfcf1ea48da432d672c5386dd87cf58742446a86b1
2019-01-14 14:48:51 +01:00
Wladimir J. van der Laan 43a79d22c1
Merge #15138: Drop IsLimited in favor of IsReachable
d6b076c17b Drop IsLimited in favor of IsReachable (Ben Woosley)

Pull request description:

  These two methods have had the same meaning, but inverted, since
  110b62f069. Having one name for a single
  concept simplifies the code.

  This is a follow-up to #15051.
  /cc #7553

Tree-SHA512: 347ceb9e2a55ea06f4c01226411c7bbcade09dd82130e4c59d0824ecefd960875938022edbe5d4bfdf12b0552c9b4cb78b09a688284d707119571daf4eb371b4
2019-01-14 14:30:51 +01:00
Ben Woosley d6b076c17b
Drop IsLimited in favor of IsReachable
These two methods have had the same meaning, but inverted, since
110b62f069. Having one name for a single
concept simplifies the code.
2019-01-13 22:50:36 -08:00
MarcoFalke a9b71a09a0
Merge #15154: configure: bitcoin-tx doesn't need libevent, so don't pull it in
8ac34140d5 configure: bitcoin-tx doesn't need libevent, so don't pull it in (Luke Dashjr)

Pull request description:

Tree-SHA512: e62f6c8d443923ec91cd15e11aeb5a6faeeade6824995fc01a87aaa47390c8bfded5ae573ce78e6b39f67179ab1851fb42270df739a07a19869b49bc2f747d04
2019-01-13 14:18:30 -05:00
Pieter Wuille 6a57ca91da Use FRC::randbytes instead of reading >32 bytes from RNG
There was only one place in the codebase where we're directly reading >32 bytes from
the RNG. One possibility would be to make the built-in RNG support large reads, but
using FastRandomContext lets us reuse code better.

There is no change in behavior here, because the FastRandomContext constructor
uses GetRandBytes internally.
2019-01-13 09:53:47 -08:00
Ben Woosley 3a0e76fc12
Replace remaining 0 with nullptr in Qt code
Also used type-appropriate enum values such as Qt::NoItemFlags in
some cases.

All cases identified via -Wzero-as-null-pointer-constant
2019-01-13 03:25:14 -08:00
practicalswift 9096276e0b
Don't use zero as null pointer constant (-Wzero-as-null-pointer-constant)
Qt-only changes.
2019-01-13 03:25:14 -08:00
Luke Dashjr 8ac34140d5 configure: bitcoin-tx doesn't need libevent, so don't pull it in 2019-01-12 13:10:22 +00:00