Commit graph

16178 commits

Author SHA1 Message Date
Wladimir J. van der Laan
2dbc4a4740
Merge #11771: [tests] Change invalidtxrequest to use BitcoinTestFramework
95e2e9a [tests] Change invalidtxrequest to use BitcoinTestFramework (John Newbery)
359d067 [tests] Fix flake8 warnings in invalidtxrequest (John Newbery)
c32cf9f [tests] Add P2PDataStore class (John Newbery)
cc046f6 [tests] Reduce NodeConn connection logging from info to debug (John Newbery)

Pull request description:

  Next step in #10603

  - first commit changes log level for an internal log from INFO to DEBUG. (Not really related, but I started finding the INFO level logging annoying when debuging test failures)
  - second commit introduces a `P2PStub` class - a subclass of `NodeConnCB` which has its own block and tx store and responds appropriately to getdata requests. Not all the functionality is used in `invalidtxrequest.py`, but will be used in `invalidblockrequest.py` and `p2p-fullblocktest` when those are changed to use `BitcoinTestFramework`
  - third commit tidies up `invalidtxrequest.py`
  - fourth commit removes usage of `ComparisonTestFramework`

Tree-SHA512: f3085c73c15d6ce894e401490bce8a7fa7cf52b0c9d135ff7e351f1f6f517c99accab8588fcdc443f39ea8315329aaabd66b2baa32499df5a774737882030373
2018-02-13 10:31:06 +01:00
Cory Fields
ceaefdd5f3 fix possible shutdown assertion with -reindex-shutdown
Credit @eklitzke for reproducing.
2018-02-13 00:38:25 -05:00
MarcoFalke
c997f88082
Merge #12416: Fix Windows build errors introduced in #10498
f40df29d96 Fix Windows build errors introduced in #10498 (practicalswift)

Pull request description:

  Fix Windows build errors introduced in #10498

  Fixes #12386

  cc @ken2812221, @Sjors, @MarcoFalke and @floreslorca

Tree-SHA512: a807521fbd4015971e646fa4bab5495a3aaa97337e7b7d80b9161f33778e84ad6725cf4fbd5a35b50bf3a2bd97747cd7a630b51493ff516c2e1ad74acce148be
2018-02-12 17:20:18 -05:00
practicalswift
f40df29d96 Fix Windows build errors introduced in #10498
Fixes #12386
2018-02-12 15:48:37 +01:00
MarcoFalke
5dc00f68c4
Merge #12193: RPC: Consistently use UniValue.pushKV instead of push_back(Pair()) (karel-3d)
91986ed206 scripted-diff: Use UniValue.pushKV instead of push_back(Pair()) (Karel Bilek)
a570098021 Squashed 'src/univalue/' changes from 07947ff2da..51d3ab34ba (MarcoFalke)

Pull request description:

  Rebased version of  #11386 by karel-3d.

  Closes:  #11386

Tree-SHA512: f3a81447e573c17e75813f4d41ceb34b9980eac81efdd98ddb149d7c51f792be7e2b32239b6ea7e6da68af23897afa6b4ce3f4e8070f9c4adf5105bf6075f2a0
2018-02-12 09:13:38 -05:00
João Barbosa
2e9406c0c5 Interrupt loading thread after shutdown request 2018-02-12 11:18:22 +00:00
Jonas Schnelli
8e6f9f4ebc
Merge #12296: wallet: Only fee-bump non-conflicted/non-confirmed txes
faca18dcf feebumper: Use PreconditionChecks to determine bump eligibility (MarcoFalke)
718f05cab move more bumpfee prechecks to feebumper::PreconditionChecks (Gregory Sanders)

Pull request description:

  This only affects the gui.

  Fee-bumping of transactions that are already confirmed or are already conflicted by other transactions should not be offered by the gui.

Tree-SHA512: 4acf8087c69fbe5bd67be0485cdb4055e985bbf84acc420aa786ad31e2dc6c2572baaac1d359af10a6907790f626edca690285d9a46ae5440900ea12624c634f
2018-02-12 21:14:10 +10:30
Wladimir J. van der Laan
c8b54b2044
Merge #12351: Libraries: Use correct type ; avoid compiler warnings.
a25cb0f Use ptrdiff_t type to more precisely indicate usage and avoid compiler warnings. (murrayn)

Pull request description:

  ptrdiff_t is a more strictly correct type, and gets rid of compiler warnings.

Tree-SHA512: 39718a5cdc10e698f14185f4622a9b439728bce619bd8b3a86f2b99ed5b056cf5a8545a3e5c4bc8a6a01b845fb73510036cee5e6d2629c58df26be692a957fba
2018-02-12 11:41:12 +01:00
Wladimir J. van der Laan
b4d85490f0
Merge #11858: qa: Prepare tests for Windows
faefd29 qa: Prepare functional tests for Windows (MarcoFalke)

Pull request description:

  * Pass `sys.executable` when calling a python script via the subprocess
    module
  * Don't remove the log file while it is still open and written to
  * Properly use os.pathsep and os.path.sep when modifying the PATH
    environment variable
  * util-tests: Use os.path.join for Windows compatibility

  Ref:  #8227

Tree-SHA512: c507a536af104b3bde4366b6634099db826532bd3e7c35d694b5883c550920643b3eab79c76703ca67e1044ed09979e855088f7324321c8d52112514e334d614
2018-02-12 11:31:18 +01:00
Wladimir J. van der Laan
108af52ef7
Merge #12393: Fix a-vs-an typos
11376b5 Fix a-vs-an typos (practicalswift)

Pull request description:

  Fix a-vs-an typos.

Tree-SHA512: 2cf74c15656a20ec13d2da7d86a39d14e634db368833d92da06a78d1266950accfc4fcc89cfecdaadd46e6b48b17e6fad29080428e564871e78482c53f3e855c
2018-02-12 10:50:03 +01:00
Wladimir J. van der Laan
0dfc25f82a
Merge #12381: Remove more boost threads
004f999 boost: drop boost threads for [alert|block|wallet]notify (Cory Fields)
0827267 boost: drop boost threads from torcontrol (Cory Fields)
ba91724 boost: remove useless threadGroup parameter from Discover (Cory Fields)
f26866b boost: drop boost threads for upnp (Cory Fields)

Pull request description:

  This doesn't completely get rid of boost::thread, but this batch should be easy to review, and leaves us with only threadGroup (scheduler + scriptcheck) remaining.

  Note to reviewers: The upnp diff changes a bunch of whitespace, it's much more clear with 'git diff -w'

Tree-SHA512: 5a356798d0785f93ed143d1f0afafe890bc82f0d470bc969473da2d2aa78bcb9b096f7ba11b92564d546fb447d4bd0d347e7842994ea0170aafd53fda7e0a66e
2018-02-12 10:34:49 +01:00
Wladimir J. van der Laan
a8cbbdb07a
Merge #12392: Fix ignoring tx data requests when fPauseSend is set on a peer
c4af738 Fix ignoring tx data requests when fPauseSend is set on a peer (Matt Corallo)

Pull request description:

  This resolves a bug introduced in
  66aa1d58a1 where, if when responding
  to a series of transaction requests in a getdata we hit the send
  buffer limit and set fPauseSend, we will skip one transaction per
  call to ProcessGetData.

  Bug found by Cory Fields (@theuni).

  Probably worth slipping into 0.16 :/.

Tree-SHA512: a9313cef8ac6da31eb099c9925c8401a638220cf7bc9b7b7b83151ecae4b02630f2db45ef6668302b9bb0f38571afbd764993427f1ec9e4d74d9a3be6647d299
2018-02-12 10:14:05 +01:00
Wladimir J. van der Laan
79313d2e20
Merge #12401: Reset pblocktree before deleting LevelDB file
a8b5d20 Reset pblocktree before deleting LevelDB file (Sjors Provoost)

Pull request description:

  #11043 repaced:

  ```
  delete pblocktree;
  pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReset);
  ```

  With:

  ```
  pblocktree.reset(new CBlockTreeDB(nBlockTreeDBCache, false, fReset));
  ```

  This is problematic because `new CBlockTreeDB` tries to delete the existing file, which will fail with `LOCK: already held by process` if it's still open. That's the case for QT.

  When QT finds a problem with the index it will ask the user if they want to reindex. At that point it has already opened `blocks/index`.  It then runs this [while loop](https://github.com/bitcoin/bitcoin/blob/v0.16.0rc3/src/init.cpp#L1415) again with `fReset = 1`, resulting in the above error.

  This change makes that error go away, presumably because `reset()` without an argument closes the file.

Tree-SHA512: fde8b546912f6773ac64da8476673cc270b125aa2d909212391d1a2001b35c8260a8772126b99dfd76b39faaa286feb7c43239185fe584bd4dc2bc04a64044ce
2018-02-12 10:11:37 +01:00
Sjors Provoost
a8b5d20f4f
Reset pblocktree before deleting LevelDB file 2018-02-11 12:14:08 +01:00
practicalswift
11376b5583 Fix a-vs-an typos 2018-02-11 10:48:15 +01:00
MarcoFalke
fa5f51830d
rpc: Reject deprecated reserveChangeKey in fundrawtransaction 2018-02-10 22:11:31 -05:00
Ernest Hemingway
9b6454c52a
Improve "Turn Windows Features On or Off" step 2018-02-10 14:17:05 -05:00
Karel Bilek
91986ed206 scripted-diff: Use UniValue.pushKV instead of push_back(Pair())
-BEGIN VERIFY SCRIPT-
git grep -l "push_back(Pair" | xargs sed -i "s/push_back(Pair(\(.*\)));/pushKV(\1);/g"
-END VERIFY SCRIPT-
2018-02-10 10:05:07 -05:00
MarcoFalke
fa1388edb1
univalue: Bump subtree 2018-02-10 09:55:54 -05:00
MarcoFalke
a570098021 Squashed 'src/univalue/' changes from 07947ff2da..51d3ab34ba
51d3ab34ba Merge #10: Add pushKV(key, boolean) function (replaces #5)
129bad96d5 [tests] test pushKV for boolean values
b3c44c947f Pushing boolean value to univalue correctly

git-subtree-dir: src/univalue
git-subtree-split: 51d3ab34ba2857f0d03dc07250cb4a2b5e712e67
2018-02-10 09:55:26 -05:00
MarcoFalke
fe53d5f363
Merge #12394: gitian-builder.sh: fix --setup doc, since lxc is default
464015f6f1 [scripts] gitian-builder.sh: fix --setup doc, LXC is default (Sjors Provoost)

Pull request description:

Tree-SHA512: 9e4c029bc0179265b20a6cecf13619f0e9d932b6911832d1aa6fc488c62c6e60bc5a10eb6eff4c668ef9cbc66942ca5c13177d0bc3b9259398780ce12a53a645
2018-02-10 09:47:23 -05:00
Wladimir J. van der Laan
948c29cc0d
Merge #12128: Refactor: One CBaseChainParams should be enough
1687cb4 Refactor: One CBaseChainParams should be enough (Jorge Timón)

Pull request description:

  There's no need for class hierarchy with CBaseChainParams, it is just a struct with 2 fields.
  This starts as a +10-43 diff

Tree-SHA512: 0a7dd64ab785416550b541787c6083540e4962d76b6cffa806bb3593aec2daf1752dfe65ac5cd51b34ad5c31dd8292c422b483fdd2d37d0b7e68725498ed4c2d
2018-02-10 12:37:20 +01:00
Sjors Provoost
464015f6f1
[scripts] gitian-builder.sh: fix --setup doc, LXC is default 2018-02-09 10:57:10 +01:00
Wladimir J. van der Laan
89005ddad1
Merge #11761: [docs] initial QT documentation
c8edc2c [docs] initial QT documentation, move Qt Creator instructions (Sjors Provoost)

Pull request description:

  I'll update this as I figure out how everything is tied together, but I think it's a useful enough start.

Tree-SHA512: d96e5c9ba8ccc3a1b92a0894a8a8449317100eebb14e5d390b51793534458f50eac296cf2945fccf81b85aff23fa32d91d6015a0a76ada4f7091a400d7508ae5
2018-02-09 10:54:01 +01:00
Matt Corallo
c4af738763 Fix ignoring tx data requests when fPauseSend is set on a peer
This resolves a bug introduced in
66aa1d58a1 where, if when responding
to a series of transaction requests in a getdata we hit the send
buffer limit and set fPauseSend, we will skip one transaction per
call to ProcessGetData.

Bug found by Cory Fields (@theuni).
2018-02-08 18:06:21 -05:00
Wladimir J. van der Laan
67447ba060
Merge #12225: Mempool cleanups
669c943 Avoid leaking prioritization information when relaying transactions (Suhas Daftuar)
e868b22 fee estimator: avoid sorting mempool on shutdown (Suhas Daftuar)
0975406 Correct mempool mapTx comment (Suhas Daftuar)

Pull request description:

  Following up on #12127 and #12118, this cleans up a comment that was left incorrect in txmempool.h, and addresses a couple of the observations @TheBlueMatt made about an unnecessary use of `queryHashes()` and a small information leak when prioritizing transactions.

  Left undone is nuking queryHashes altogether; that would require changing the behavior of the `getrawmempool` rpc call, which I think I might be in favor of doing, but wanted to save for its own PR.

Tree-SHA512: c97d10b96dcd6520459287a4a2eda92774173757695100fcfe61e526aef86f394507c331d17f9e0c14b496c33ec46198a0f165a847762ca50f7c6780b993f162
2018-02-08 22:19:53 +01:00
Jorge Timón
1687cb4a87
Refactor: One CBaseChainParams should be enough 2018-02-08 22:06:43 +01:00
Cory Fields
004f999946 boost: drop boost threads for [alert|block|wallet]notify 2018-02-08 14:35:29 -05:00
Cory Fields
08272671d2 boost: drop boost threads from torcontrol 2018-02-08 14:35:29 -05:00
Cory Fields
ba91724948 boost: remove useless threadGroup parameter from Discover 2018-02-08 14:35:28 -05:00
Cory Fields
f26866b9ca boost: drop boost threads for upnp 2018-02-08 14:35:28 -05:00
Wladimir J. van der Laan
d405beea26
Merge #12333: Make CWallet::ListCoins atomic
2f960b5 [wallet] Indent only change of CWallet::AvailableCoins (João Barbosa)
1beea7a [wallet] Make CWallet::ListCoins atomic (João Barbosa)

Pull request description:

  Fix a potencial race in `CWallet::ListCoins`.

  Replaces `cs_main` and `cs_wallet` locks by assertions in `CWallet::AvailableCoins`.

Tree-SHA512: 09109f44a08b4b53f7605d950ab506d3f748490ab9aed474aa200e93f7b0b9f96f9bf60abe1c5f658240fd13d9e3267c0dd43fd3c1695d82384198ce1da8109f
2018-02-08 19:48:21 +01:00
João Barbosa
2f960b5070 [wallet] Indent only change of CWallet::AvailableCoins 2018-02-08 18:18:51 +00:00
João Barbosa
1beea7af92 [wallet] Make CWallet::ListCoins atomic 2018-02-08 18:18:28 +00:00
Ben Woosley
bb00c95c16
Consistently use FormatStateMessage in RPC error output
This will include the error code and debug output as well as the reason string.

See #11955 for the motivation.
2018-02-08 11:02:41 -05:00
Ben Woosley
8b8a1c4f8b
Add test for 'mempool min fee not met' rpc error 2018-02-08 11:01:53 -05:00
Ben Woosley
c04e0f607a
Fix 'mempool min fee not met' debug output
Output the value that is tested, rather than the unmodified fee value.
2018-02-08 10:50:13 -05:00
Wladimir J. van der Laan
663911ed58
Merge #12282: wallet: Disallow abandon of conflicted txes
fa795cf wallet: Disallow abandon of conflicted txes (MarcoFalke)

Pull request description:

  Abandon transactions that are already conflicted is a noop, so don't try and return false/throw instead.

Tree-SHA512: fd2af4149bd2323f7f31fe18685c763790b8589319b4e467b464ab456d5e8971501ab16d124e57a22693666b06ae433ac3e59f0fd6dfbd2be2c6cae8be5bcbd8
2018-02-08 16:32:15 +01:00
MarcoFalke
935eb8de03
Merge #12295: Enable flake8 warnings for all currently non-violated rules
a9d0ebc262 Enable flake8 warnings for all currently non-violated rules (practicalswift)
4cbab15e75 tests: Fix accidental redefinition of previously defined variable via list comprehension (practicalswift)
0b9207efbe Enable flake8 warning for "list comprehension redefines 'foo' from line N" (F812) (practicalswift)

Pull request description:

  * Enable `flake8` warnings for all currently non-violated rules
  * Fix accidental redefinition via list comprehension

Tree-SHA512: 738b87789e99d02abb2c6b8ff58f65c0cbfeb93e3bf320763e033e510ebd0a4f72861bc8faaf42c14a056a5d4659c33dc70a63730a32cc15159559427bf21193
2018-02-08 09:52:07 -05:00
Wladimir J. van der Laan
3843780fd8
Merge #12336: Remove deprecated rpc options
db1cbcc [RPC] Remove deprecated addmultisigaddress return format (John Newbery)
cb28a0b [RPC] Remove deprecated createmultisig object (John Newbery)
ed45c82 [tests] Remove test for deprecated createmultsig option (John Newbery)
d066a1c [rpc] Remove deprecated getmininginfo RPC option (John Newbery)
c6f09c2 [rpc] remove deprecated estimatefee RPC (John Newbery)
a8e437a [tests] Remove estimatefee from rpc_deprecated.py test (John Newbery)
a5623b1 [tests] Remove tests for deprecated estimatefee RPC (John Newbery)
d119f2e [tests] Fix style warnings in feature_fee_estimation.py (John Newbery)

Pull request description:

  There were some RPC/RPC options deprecated in v0.16. Those can now be removed from master since v0.16 has been branched.

  - `estimatefee` RPC has been removed. The `feature_fee_estimation.py` test has been updated to remove the RPC, but doesn't yet have good coverage of the replacement RPC `estimatesmartfee`. Improving the test coverage should be done in a new PR. (#11031)
  - the `errors` field returned by `getmininginfo` has been deprecated and replaced by a `warning` field. (#10858)
  - providing addresses as inputs to `createmultisig` has been deprecated. Users should use `addmultisigaddress` instead (#11415)
  - The return format from `addmultisigaddress` has changed (#11415)

  `getwitnessaddress` was also deprecated in v0.16 and can be removed, but many tests are using that RPC, so it's a larger job to remove. It should be removed in a separate PR (possibly after #11739 and #11398 have been merged and the segwit test code tidied up)

Tree-SHA512: 8ffaa5f6094131339b9e9e468e8b141de4b144697d2271efa2992b80b12eb97849ade3da8df5c1c9400ed4c04e6a029926550a3e5846d2029b644f9e84ac7124
2018-02-08 15:38:21 +01:00
John Newbery
db1cbcc856 [RPC] Remove deprecated addmultisigaddress return format 2018-02-08 08:59:28 -05:00
John Newbery
cb28a0b07f [RPC] Remove deprecated createmultisig object 2018-02-08 08:59:28 -05:00
John Newbery
ed45c82019 [tests] Remove test for deprecated createmultsig option 2018-02-08 08:59:09 -05:00
Wladimir J. van der Laan
b264528674
Merge #12354: add gpg key for fivepiece
27736f2 add fivepiece key fingerprint (fivepiece)

Pull request description:

Tree-SHA512: 6b2b7ca22eb02338ac2e41e8ac577bd9401f771571531d3d4c473aacc544bd4304318e311cc50b7e84236bebd7a2fda9d4c16232fefe0de4291bbbc6959b4f4b
2018-02-08 13:51:13 +01:00
Wladimir J. van der Laan
a1ffddb90d
Merge #12298: Refactor HaveKeys to early return on false result
5bdbbdc Refactor HaveKeys to early return on false result (João Barbosa)

Pull request description:

  This consists in a trivial change where the return type of `HaveKeys()` is now `bool` meaning that it returns whether all keys are in the keystore, and early returns when one isn't.

Tree-SHA512: 03e35ea8486404b84884b49f6905c9f4fc161a3eeef080b06482d77985d5242a2bdd57a34b8d16abe19ee8c6cfa3e6fbcb935c73197d53f4cd468a2c7c0b889b
2018-02-08 13:31:22 +01:00
Wladimir J. van der Laan
c9ca4f6024
Merge #12371: Add gitian PGP key: akx20000
b947d38 Add gitian PGP key: akx20000 (Akira Takizawa)

Pull request description:

Tree-SHA512: 14f8baf23120fece260ea2929c431f398a5715ef047bef9d3f6811abddf0d223defdbc30bc0be95f30550ed0cb8a81bab8ecbd21464a39b1860a60f593388250
2018-02-08 11:11:34 +01:00
Wladimir J. van der Laan
ab4ee6e692
Merge #12315: Bech32 addresses in dumpwallet
45eea40 Bech32 addresses in dumpwallet (fivepiece)

Pull request description:

  Output bech32 addresses in dumpwallet if address type is not as legacy

Tree-SHA512: f6b6f788293779fe6339b94d9b792180e1d1dcb9c8e826caef8693557e1710213ba57891981c17505ace8d67b407eeca6fd9a8825757dd292cca2aa12575d15c
2018-02-08 09:55:54 +01:00
Wladimir J. van der Laan
d57d10ee96
Merge #12368: Hold mempool.cs for the duration of ATMP.
02fc886 Add braces to meet code style on line-after-the-one-changed. (Matt Corallo)
85aa839 Hold mempool.cs for the duration of ATMP. (Matt Corallo)

Pull request description:

  This resolves an issue where getrawmempool() can race mempool
  notification signals. Intuitively we use mempool.cs as a "read
  lock" on the mempool with cs_main being the write lock, so holding
  the read lock intermittently while doing write operations is
  somewhat strange.

  This also avoids the introduction of cs_main in getrawmempool()
  which reviewers objected to in the previous fix in #12273

Tree-SHA512: 29464b9ca3890010ae13b7dc1c53487cc2bc9c3cf3d32a14cb09c8aa33848f57959d8991ea096beebcfb72f062e4e1962f104aefe4252c7db87633bbfe4ab317
2018-02-08 09:39:38 +01:00
Wladimir J. van der Laan
6db4fa7ad3
Merge #12366: http: Join worker threads before deleting work queue
11e0151 http: Remove numThreads and ThreadCounter (Wladimir J. van der Laan)
f946654 http: Remove WaitExit from WorkQueue (Wladimir J. van der Laan)
b1c2370 http: Join worker threads before deleting work queue (Wladimir J. van der Laan)

Pull request description:

  This prevents a potential race condition if control flow ends up in
  `ShutdownHTTPServer` before the thread gets to `queue->Run()`,
  deleting the work queue while workers are still going to use it.

  Meant to fix #12362.

Tree-SHA512: 8108514aeee5b2067a3736ed028014b580d1cbf8530ac7682b8a23070133dfa1ca21db4358c9158ea57e8811e0551395b6cb769887876b9cfce067ee968d0642
2018-02-08 09:21:49 +01:00
Wladimir J. van der Laan
11f3eac793
Merge #12374: qt: Make sure splash screen is freed on AppInitMain fail
1e5d14b qt: Clarify some comments (Wladimir J. van der Laan)
f5a4c3d qt: Make sure splash screen is freed on AppInitMain fail (Wladimir J. van der Laan)

Pull request description:

  The `splashFinished` event was never sent if AppInitMain fails, causing the splash screen to stick around, causing problems later.

  This bug has existed for a while but is now trigging potential crashed because the splash screen subscribes to wallet events.

  Meant to fix #12372.

Tree-SHA512: 192a7e3a528015e771d7860dd95fd7b772292fd8064abf2a3cf3a8ea0d375cd43a6e8ed37ca1a38962fe1410c934599e557adf6a8ef9d87ec7f61b6e5fd8db7e
2018-02-08 08:53:06 +01:00