Commit Graph

10935 Commits

Author SHA1 Message Date
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 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
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
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 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
Wladimir J. van der Laan 36a927c525
Merge #12377: qt: Poll ShutdownTimer after init is done
2222bf0 qt: Poll ShutdownTimer after init is done (MarcoFalke)

Pull request description:

  The shutdown process has started in `requestShutdown`, but initialize will happily continue with `initializeResult` and start threads late in the shutdown progess. Deleting this running thread will crash the application according to the qt docs:
  e5033a5c9b/src/corelib/thread/qthread.cpp (L412-L415)

  Potential fix for https://github.com/bitcoin/bitcoin/issues/12372#issuecomment-363642332

  This reverts #11831 for now and hopefully restores the previous behaviour.

Tree-SHA512: 8e1706afe90ddf2d972aca12c12d4cb2a9a4f38646c59c5466fe5a1a67361896b93c43917d5ac283841ee2bcc62e6bb8dc2bc81dea9129c899b354e9a4ef241b
2018-02-08 08:51:19 +01:00
Wladimir J. van der Laan 7217ea2cc8
Merge #12367: Fix two fast-shutdown bugs
dd2de47 Fix fast-shutdown crash if genesis block was not loaded (Matt Corallo)
1c9394a Fix fast-shutdown hang on ThreadImport+GenesisWait (Matt Corallo)

Pull request description:

  The second commit is a much simpler alternative fix for the issue fixed in #12349. To test I made ShutdownRequested() always StartShutdown() after a certain number of calls, which turned up one other hang, fixed in the first commit.

Tree-SHA512: 86bde6ac4b8b4e2cb99fff87dafeed02c0d9514acee6d94455637fb2da9ffc274b5ad31b0a6b9f5bd7b700ae35395f28ddb14ffc65ddda3619aa28df28a5607d
2018-02-08 08:41:18 +01:00
MarcoFalke 0277173b1d
Merge #10498: Use static_cast instead of C-style casts for non-fundamental types
9ad6746ccd Use static_cast instead of C-style casts for non-fundamental types (practicalswift)

Pull request description:

  A C-style cast is equivalent to try casting in the following order:

  1. `const_cast(...)`
  2. `static_cast(...)`
  3. `const_cast(static_cast(...))`
  4. `reinterpret_cast(...)`
  5. `const_cast(reinterpret_cast(...))`

  By using `static_cast<T>(...)` explicitly we avoid the possibility of an unintentional and dangerous `reinterpret_cast`. Furthermore `static_cast<T>(...)` allows for easier grepping of casts.

  For a more thorough discussion, see ["ES.49: If you must use a cast, use a named cast"](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es49-if-you-must-use-a-cast-use-a-named-cast) in the C++ Core Guidelines (Stroustrup & Sutter).

Tree-SHA512: bd6349b7ea157da93a47b8cf238932af5dff84731374ccfd69b9f732fabdad1f9b1cdfca67497040f14eaa85346391404f4c0495e22c467f26ca883cd2de4d3c
2018-02-07 16:15:28 -05:00
MarcoFalke 2222bf02c9
qt: Poll ShutdownTimer after init is done 2018-02-07 15:15:10 -05:00
Wladimir J. van der Laan 1e5d14b3f7 qt: Clarify some comments
Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
2018-02-07 10:37:45 +01:00
Wladimir J. van der Laan f5a4c3ddf4 qt: Make sure splash screen is freed on AppInitMain fail
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.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
2018-02-07 10:37:40 +01:00
Wladimir J. van der Laan 11e01515fe http: Remove numThreads and ThreadCounter
The HTTP worker thread counter, as well as the RAII object that was used
to maintain it, is unused now, so can be removed.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
2018-02-07 09:53:46 +01:00
fivepiece 45eea40aa8 Bech32 addresses in dumpwallet
Output bech32 addresses in dumpwallet if address type is not as legacy
2018-02-07 01:02:20 +02:00
Matt Corallo dd2de47c62 Fix fast-shutdown crash if genesis block was not loaded
If the ShutdownRequested() check at the top of ActivateBestChain()
returns false during initial genesis block load we will fail an
assertion in UTXO DB flush as the best block hash IsNull(). To work
around this, we move the check until after one round of
ActivateBestChainStep(), ensuring the genesis block gets connected.
2018-02-06 15:14:02 -05:00
Matt Corallo 1c9394ad47 Fix fast-shutdown hang on ThreadImport+GenesisWait
If the user somehow manages to get into ShutdownRequested before
ThreadImport gets to ActivateBestChain() we may hang waiting on
condvar_GenesisWait forever. A simple wait_for and
ShutdownRequested resolves this case.
2018-02-06 15:13:59 -05:00
Matt Corallo 02fc886363 Add braces to meet code style on line-after-the-one-changed. 2018-02-06 14:55:36 -05:00
Wladimir J. van der Laan f94665466e http: Remove WaitExit from WorkQueue
This function, which waits for all threads to exit, is no longer needed
now that threads are joined instead.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
2018-02-06 20:32:51 +01:00
Wladimir J. van der Laan b1c2370dde http: Join worker threads before deleting work queue
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.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
2018-02-06 20:10:09 +01:00
Matt Corallo 85aa8398f5 Hold mempool.cs for the duration of ATMP.
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
2018-02-06 13:51:44 -05:00
Wladimir J. van der Laan 1462bde767
Merge #12050: [trivial] Implements a virtual destructor on the BaseRequestHandler class.
bdb3231 Implements a virtual destructor on the BaseRequestHandler class. (251)

Pull request description:

  Granted that there is no undefined behavior in the current implementation, this PR implements a virtual destructor on the BaseRequestHandler class to protect against undefined behavior in the event that an object of a potential future derived BaseRequestHandler class with a destructor is destroyed through a pointer to this base class.

  This PR also fixes "_warning: delete called on 'BaseRequestHandler' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]_" warnings in environments where the project is built with the `-Wsystem-headers` flag; or environments where the `-Wdelete-non-virtual-dtor` diagnostics flag fires from system headers.

Tree-SHA512: 3c3b0797a8dbce8d8c5b244709e8bca41c4e28d5ba554a974bf7fc9128413e1098c457a00e51b21154ce6c11ce5da3071626e71d593b2550d0020bc589406eed
2018-02-06 18:05:34 +01:00
Wladimir J. van der Laan f6cd41d93e
Merge #12305: [docs] [refactor] Add help messages for datadir path mangling
5460460 Add AbsPathForConfigVal to consolidate datadir prefixing for path args (James O'Beirne)
a1e1305 Clarify help messages for path args to mention datadir prefix (James O'Beirne)

Pull request description:

  Change `-conf`'s help message to indicate that relative path values will be prefixed by the datadir path. This behavior probably merits clarification; it's kind of confusing when attempting to specify a configuration file in the current directory with `-conf=bitcoin.conf`, but instead loading the `bitcoin.conf` file in ~/.bitcoin datadir.

  ### Edit

  This PR has been modified to document all cases where relative path configurations are modified to be under datadir. A small refactoring has also been added which consolidates this normalization.

Tree-SHA512: be4fc0595fbeba33d17af08f59898af45e76a44f00719ea0282403b155ac6755584604fab765250a3aa14ed6991882c4d1ccbe601184362c5ba97c886bdda344
2018-02-06 16:14:12 +01:00
MarcoFalke fa795cf9c5
wallet: Disallow abandon of conflicted txes 2018-02-06 09:54:31 -05:00
Wladimir J. van der Laan 9a32114626
Merge #12218: net: Move misbehaving logging to net logging category
d3a185a net: Move misbehaving logging to net logging category (Wladimir J. van der Laan)

Pull request description:

  This moves the error messages for misbehavior (when available) into the line that reports the misbehavior, as well as moves the logging to the `net` category.

  This is a continuation of #11583 and avoids serious-looking errors due to misbehaving peers. As it is impossible to correlate the `peer=X` numbers to specific incoming connections now without enabling the `net` category, it doesn't really help to see these messages by default.

  To do this, Misbehaving() gains an optional `message` argument.

  E.g. change:

      2018-01-18 16:02:27 Misbehaving: x.x.x.x:62174 peer=164603 (80 -> 100) BAN THRESHOLD EXCEEDED
      2018-01-18 16:02:27 ERROR: non-continuous headers sequence

  to

      2018-01-18 16:02:27 Misbehaving: x.x.x.x:62174 peer=164603 (80 -> 100) BAN THRESHOLD EXCEEDED: non-continuous headers sequence

  When there is a category for "important" net messages (see #12219 ), we should move it there.

Tree-SHA512: 51c97e9a649bf5409f2fd4625fa1243a036e9c9de6037bb064244207408c2e0eb025e3af80866df673cdc006b8f35dc4078d074033f0d4c6a73bbb03949a269f
2018-02-06 12:48:59 +01:00
Wladimir J. van der Laan eaeaa2d0b4
Merge #12342: Extend #11583 to include "version handshake timeout" message
c887f87 Extend #11583 to include the most common message generated by non-contributing peers (port scanners?) 37% of the log default log entries for a node that has been up for ~24hrs was "version handshake timeout..." (Clem Taylor)

Pull request description:

  37% of the default log entries for a node that has been up for ~24hrs was "version handshake timeout..."

Tree-SHA512: dceeee5d55a9ff7570174aeb63faac9beda239087220522adefef7ed11e0eeffa008ca28726011247c8834c1a222d37817baf895635ab874a95ebc435959070e
2018-02-06 12:20:38 +01:00
James O'Beirne 54604600c3 Add AbsPathForConfigVal to consolidate datadir prefixing for path args
Most commandline/config args are interpreted as relative to datadir if
not passed absolute. Consolidate the logic for this normalization.
2018-02-05 17:48:59 -05:00
James O'Beirne a1e13055c2 Clarify help messages for path args to mention datadir prefix
Change `-conf`'s and others' help messages to indicate that relative path
values will be prefixed by the datadir path. This behavior is confusing when
attempting to specify a configuration file in the current directory with
`-conf=bitcoin.conf`, but loading the `bitcoin.conf` file in ~/.bitcoin
datadir.
2018-02-05 17:48:47 -05:00
MarcoFalke 2a30e67d20
Merge #12330: Reduce scope of cs_main and cs_wallet locks in listtransactions
c409b1adac [rpc] Reduce scope of cs_main and cs_wallet locks in listtransactions (João Barbosa)

Pull request description:

  Trivial change, no behaviour change.

  Benchmark done as follow:
   - run with `-regtest`
   - wallet with 5000 transactions
   - measured the time spent with the lock and the total time
   - times are an average of 100 `listtransactions --count=...` calls

  | `--count` | lock (ms) | total (ms) | saving |
  |--:|--:|--:|--:|
  | 10 | 0.2230 | 0.2510 | 11% |
  | 100 | 2.5150 | 2.8690 | 12% |
  | 1000 | 20.0320 | 23.3490 | 14% |
  | 10000 | 105.2070 | 125.5310 | 16% |

Tree-SHA512: ebedfeeb4c8ad75c89128e53cae976a82967dbb5ffd129da0f7204ccf9c3c15070b3d509f3767bebd745512e410200cc546147c836e82409f95fc9b8d14fc3ed
2018-02-05 16:17:00 -05:00
John Newbery d066a1c069 [rpc] Remove deprecated getmininginfo RPC option 2018-02-05 15:17:35 -05:00
John Newbery c6f09c2713 [rpc] remove deprecated estimatefee RPC 2018-02-05 15:17:31 -05:00
murrayn a25cb0f313 Use ptrdiff_t type to more precisely indicate usage and avoid compiler warnings. 2018-02-05 02:25:28 -08:00
MarcoFalke d32528e733
Merge #12331: Docs: Properly alphabetize output of CLI --help option.
d3e467520f Properly alphabetize output of CLI --help option. (murrayn)

Pull request description:

  The --help output of bitcoind, bitcoin-cli, bitcoin-tx, qt/bitcoin-qt, et al. is only about 90% alphabetized by option, which is kind of sloppy and occasionally misleading. This change (mostly) organizes the output alphabetically.

Tree-SHA512: 3029900dbe99f03397c1cbdb5e4ac09a13bc99bafe73c6855097206e4cdd9ad70d0b5cedb5e1e520005c3e9ef1c4cd32bb9d8c98ce6918d8434fec8bf06e56c8
2018-02-04 14:26:27 -05:00
Clem Taylor c887f87d59 Extend #11583 to include the most common message generated by non-contributing peers (port scanners?)
37% of the log default log entries for a node that has been up for ~24hrs was "version handshake timeout..."
2018-02-03 04:08:04 -05:00
Wladimir J. van der Laan 85123be78d
Merge #12317: Document method for reviewers to verify chainTxData
7444149 Document method for reviewers to verify chainTxData (John Newbery)

Pull request description:

  This commit adds the final block hash of the window to getchaintxstats
  and documents how reviewers can verify changes to chainTxData.

Tree-SHA512: d16abb5f47d058e52660f4d495f1e453205b1b83716d7c810ff62a70338db721386c1808ec1fc8468f514e4d80cc58e3c96eeb3184cbbcb1d07830fa5e53f342
2018-02-02 18:25:33 +01:00
John Newbery 7444149de3 Document method for reviewers to verify chainTxData
This commit adds the final block hash of the window to getchaintxstats
and documents how reviewers can verify changes to chainTxData.
2018-02-02 09:29:33 -05:00
MarcoFalke 1b06ed136f
Merge #12283: Fix typos
1340eda3b7 Fix typos (practicalswift)

Pull request description:

  Fix typos.

Tree-SHA512: 533a136831387ef26e9a74ba078437496bee38cc026da73fa9e6f6e7f4d5665eccac24cf3ef05e6d3af1329a1214f5ce71b039ddb8378b074e6d4408b8701f95
2018-02-02 05:35:51 -05:00
Wladimir J. van der Laan aa360e76a7
Merge #12329: net: don't retry failed oneshot connections forever
660f5f1 net: don't retry failed oneshot connections forever (Cory Fields)

Pull request description:

  As introduced by (my suggestion, sorry, in) #11512, failed dns resolves end up as oneshots. But failed oneshots are re-added as oneshots, so we need to make sure that we're not queuing these up forever after failed resolves.

  Rather than trying to differentiate, I think we should just not re-add failed oneshots and be done with it.

  Maybe @sipa can shed a light on what the original intention was.

Tree-SHA512: 2dfe35dabfb6354c315cf6f8ae42971765d36575e685662caae7ed8f9dea9472c6fb1fd5e62ec35301550b74b6613a54265e90fca2a6618544f78dacaac4d4fd
2018-02-02 09:50:38 +01:00
murrayn d3e467520f Properly alphabetize output of CLI --help option. 2018-02-01 23:19:41 -08:00
João Barbosa c409b1adac [rpc] Reduce scope of cs_main and cs_wallet locks in listtransactions 2018-02-02 01:58:24 +00:00
Jonas Schnelli 41363fe11d
Merge #12327: [gui] Defer coin control instancing
6558f8acc [gui] Defer coin control instancing (João Barbosa)

Pull request description:

  Defer the GUI coin control instancing so that argument processing
  is taken into account for the default coin control values.

  Fixes #12312

Tree-SHA512: ecda28b94f4709319e9484b01afe763c7c3569097d2afb89db79da8a195c46d20ea77166df7edce0c8ab77627b295def01c072148714503436d27675d5e75d99
2018-02-01 09:53:38 -10:00
João Barbosa 6558f8acc3 [gui] Defer coin control instancing
Defer the GUI coin control instancing so that argument processing
is taken into account for the default coin control values.
2018-02-01 19:40:20 +00:00
Cory Fields 660f5f19ae net: don't retry failed oneshot connections forever 2018-02-01 14:04:49 -05:00
Cory Fields 96dbd381cf net: initialize socket to avoid closing random fd's 2018-02-01 11:31:27 -05:00
Wladimir J. van der Laan 10847fe2d8
qt: Periodic translations update
Pull 0.16 translations before forking, to avoid having to do it twice.

Tree-SHA512: 9c093885f03783e0f64718985c5f9d385d2a8592e2acc87d922ca973d07c756a6b7fff585388094f0e1b673c41e792ce918c1f594b45e82a262acd93e1b91a8e
2018-01-30 13:43:26 +01:00
Wladimir J. van der Laan 3448907a68
Merge #12266: Move scheduler/threadGroup into common-init instead of per-app
082a61c Move scheduler/threadGroup into common-init instead of per-app (Matt Corallo)

Pull request description:

  This resolves #12229 which pointed out a shutdown deadlock due to
  scheduler/checkqueue having been shut down while network message
  processing is still running.

Tree-SHA512: 0c0a76113996b164b0610d3b8c40b396f3e384d165bf098768e31fe3701b00763d0d810ef24702387e2e936fefb9fb900a6225f7417bb0175b585f365d542660
2018-01-30 13:04:30 +01:00
Wladimir J. van der Laan 7936446268
Merge #12276: Remove duplicate mapWallet lookups
039425c [wallet] Remove duplicate mapWallet lookups (João Barbosa)

Pull request description:

Tree-SHA512: 8075925d2adb64737c691e988d74a37bc326711aaee2c37327361679c051f219fa500e14cbcdb6a169352bcdbab160e11df4276b2657e19e12908ee2d4444d30
2018-01-30 10:16:31 +01:00
Wladimir J. van der Laan 288deacdbe
Merge #12278: Add special error for genesis coinbase to getrawtransaction
ee11121 Add special error for genesis coinbase to gettransaction (MeshCollider)

Pull request description:

  Suggested by sipa here: https://botbot.me/freenode/bitcoin-core-dev/2018-01-23/?msg=96069825&page=2

  Just adds a special error message for the genesis block coinbase transaction when using `getrawtransaction`

Tree-SHA512: cd102c7983ec5457b299bff4b6db747d339fda157933a3ac54aec26b1e48b115aa68c1c9e6cb7a916f15c7786273ab558b2b20ab9768544d211e0ae9d1480e34
2018-01-30 09:59:28 +01:00
João Barbosa 5bdbbdc096 Refactor HaveKeys to early return on false result 2018-01-29 23:45:25 +00:00
MarcoFalke faca18dcf4
feebumper: Use PreconditionChecks to determine bump eligibility 2018-01-29 18:31:33 -05:00
MeshCollider ee11121229 Add special error for genesis coinbase to gettransaction 2018-01-30 11:36:25 +13:00
MarcoFalke 9d9c4185fa
Merge #12293: [rpc] Mention that HD is enabled if hdmasterkeyid is present
c6b6385651 [rpc] Mention that HD is enabled if hdmasterkeyid is present (fanquake)

Pull request description:

  Also adds optional flag.

  Replaces #12042

Tree-SHA512: 6aded2cf36799f697eacbe4f51dff7c8110281092ca3c4fd73e26f57d788ec95a4fcbaf6976ef144e64f2e52759dbe241ac218a95e5ca2233cae1b98bfa5872e
2018-01-29 15:27:56 -05:00
Wladimir J. van der Laan c0ae864ef5
Merge #11577: Fix warnings (-Wsign-compare) when building with DEBUG_ADDRMAN
6eddd43 Fix warnings when building with DEBUG_ADDRMAN (practicalswift)

Pull request description:

  Fix warnings when building with `DEBUG_ADDRMAN`.

  Warnings prior to this commit:

  ```
  addrman.cpp:390:24: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
      if (vRandom.size() != nTried + nNew)
          ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~
  addrman.cpp:411:52: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
          if (info.nRandomPos < 0 || info.nRandomPos >= vRandom.size() || vRandom[info.nRandomPos] != n)
                                     ~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
  addrman.cpp:419:25: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
      if (setTried.size() != nTried)
          ~~~~~~~~~~~~~~~ ^  ~~~~~~
  addrman.cpp:421:23: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
      if (mapNew.size() != nNew)
          ~~~~~~~~~~~~~ ^  ~~~~
  4 warnings generated.
  ```

Tree-SHA512: 0316faecfe95066d2c9a0b6b3960086e43824f21a67086a895ea45fbce1327f8d6df5945fe923c2dbe4efce430bc1384d515d317c3930d97d24965e507cf734d
2018-01-29 14:26:26 +01:00
Wladimir J. van der Laan f3c7062b7b
Merge #12159: Use the character based overload for std::string::find.
a73aab7 Use the character based overload for std::string::find. (Alin Rus)

Pull request description:

  std::string::find has a character based overload as can be seen here
  (4th oveload): http://www.cplusplus.com/reference/string/string/find/

  Use that instead of constantly allocating temporary strings.

Tree-SHA512: dc7684b1551e6d779eb989e9a74363f9b978059a7c0f3db09d01744c7e6452961f9e671173265e71efff27afbcb80c0fe2c11b6dff2290e54a49193fa25a5679
2018-01-29 14:08:09 +01:00
fanquake c6b6385651
[rpc] Mention that HD is enabled if hdmasterkeyid is present 2018-01-29 21:00:27 +08:00
Wladimir J. van der Laan 9220426280
Merge #12108: [Refactor] Remove unused fQuit var from checkqueue.h
30ded3e [Refactor] Remove unused fQuit var from checkqueue.h (donaloconnor)

Pull request description:

  As per PR title, this var is no longer required

  Tested by doing a successful compile.

Tree-SHA512: 845e5e0a250cb99e353e8584e9af2df44d97683174e8caa1069bd192b72ab622063765f29676272aecaef87596d72c63ae628404e2f42555136ec2c26d419f2d
2018-01-29 13:21:50 +01:00
Wladimir J. van der Laan 000ac4fd01
Merge #12197: Log debug build status and warn when running benchmarks
34328b4 Use PACKAGE_NAME instead of hardcoding application name in log message (Wladimir J. van der Laan)
0c74e2e Log debug build status and warn when running benchmarks (Wladimir J. van der Laan)

Pull request description:

  Log whether the starting instance of bitcoin core is a debug or release build (--enable-debug).

  Also warn when running the benchmarks with a debug build, to prevent mistakes comparing debug to non-debug results.

Tree-SHA512: f612dcb7d0a8435016cff0df8aef4942144dfb88be8a00df45cc8830d2aba4b167f6d397b83f8f57d57685888babd04ba88d4dac5a202d3dbd91bcbea3708ef0
2018-01-29 11:12:16 +01:00
João Barbosa 039425cf4f [wallet] Remove duplicate mapWallet lookups 2018-01-28 17:25:16 +00:00
practicalswift 1340eda3b7 Fix typos 2018-01-28 13:21:25 +01:00
Suhas Daftuar 669c9433cf Avoid leaking prioritization information when relaying transactions 2018-01-25 18:02:24 -05:00
Suhas Daftuar e868b22917 fee estimator: avoid sorting mempool on shutdown 2018-01-25 18:02:24 -05:00
Wladimir J. van der Laan a8c344b913 Update chainTxData for 0.16
Another part of the release process.
2018-01-25 19:17:53 +01:00
Wladimir J. van der Laan 2ae7cf8ef5
Merge #12269: Update defaultAssumeValid to block 506067
bde8bcd Update defaultAssumeValid according to release-process.md. (Gregory Maxwell)

Pull request description:

  Update defaultAssumeValid according to release-process.md.
  Updated for block 506067 (0000000000000000005214481d2d96f898e3d5416e43359c145944a909d242e0).

Tree-SHA512: 38e6440a11609e56df816e295ceff697d29830a1d85009f920250320c474f8b04a182635b2f1ab44f54d0cdb8b4e4378336a788400e513d7482514434e53b3ff
2018-01-25 19:05:53 +01:00
Wladimir J. van der Laan 16bac24f60
Merge #12262: net: Hardcoded seed update
1e90544 net: Update hardcoded seeds (Wladimir J. van der Laan)
55f52bd contrib: Update ATTERN_AGENT to include 0.15.x (Wladimir J. van der Laan)

Pull request description:

  Update the hardcoded node addresses, after changing the pattern to include 0.15.x.

Tree-SHA512: 58b997393d77dcee3dcaffba0c6f185ca46c24d766b33d3a8c9d9efe5dd2e01f086b894a23e185120eee5054697e409b64736e53ca8e42b2315f82355c5f5d5c
2018-01-25 19:05:23 +01:00
Matt Corallo 082a61c69d Move scheduler/threadGroup into common-init instead of per-app
This resolves #12229 which pointed out a shutdown deadlock due to
scheduler/checkqueue having been shut down while network message
processing is still running.
2018-01-25 11:35:34 -05:00
Gregory Maxwell bde8bcd8ad Update defaultAssumeValid according to release-process.md.
Updated for block 506067 (0000000000000000005214481d2d96f898e3d5416e43359c145944a909d242e0).
2018-01-25 15:35:30 +00:00
MarcoFalke f359afcc41
Merge #12261: qt: Bump BLOCK_CHAIN_SIZE to 200GB
ba490d2460 qt: Bump BLOCK_CHAIN_SIZE to 200GB (Wladimir J. van der Laan)

Pull request description:

  Part of the release process for 0.16.

  Value is open for discussion, my blocks/ directory is 163GB but this leaves some slack.

Tree-SHA512: 4dff81740992bf9de90427934afeb223ea5216f5682c9f07cb5c47aea33980a4c682fe3fd43c3dfa2c4d66ad0e7434dbce6cb252e56d63b36df605e12af9b10a
2018-01-24 14:40:37 -05:00
Jonas Schnelli 7abb0f0929
Merge #12194: Add change type option to fundrawtransaction
16f6f59dc [qa] Test fundrawtransaction with change_type option (João Barbosa)
536ddeb17 [rpc] Add change_type option to fundrawtransaction (João Barbosa)
31dbd5af4 [wallet] Add change type to CCoinControl (João Barbosa)

Pull request description:

  Adds a new option `change_type` to `fundrawtransaction` RPC. This is useful to override the node `-changetype` argument.

  The new option is exclusive to `changeAddress` option, setting both raises a RPC error.

  See also #11403, #12119.

Tree-SHA512: 654686444f6125e37015a62f167064d54ec335701534988447be4687fa5ef9c7980a8a07cc0a03fff6ea6c4c1abf0f77a8843d535c4f3fe0bf93f968a4e676e6
2018-01-24 09:09:30 -10:00
Jonas Schnelli eadb2dacc3
Merge #12213: Add address type option to addmultisigaddress
f523c6bec [qa] Use address type in addmultisigaddress to avoid addwitnessaddress (João Barbosa)
886a92f25 [rpc] Add address type option to addmultisigaddress (João Barbosa)

Pull request description:

  Adds the option `address_type` to `addmultisigaddress` and `createmultisg` RPC. This also allows to avoid `addwitnessaddress` to obtain an `p2sh-segwit` or `bech32` multsig address.

  Related to #12210 as this reduces `addwitnessaddress` usage.

Tree-SHA512: 8f8f85dfcff66bb6c7e1e9865e37c285dead1d6dadb9672a89b92fa209d03cc35817ca1d656588c6c2146b728daaf7540b851929b640294653c62836cbefe7ee
2018-01-24 09:00:51 -10:00
Wladimir J. van der Laan 1e90544153 net: Update hardcoded seeds
Update the hardcoded node addresses, after bumping the pattern in last
commit.
2018-01-24 17:35:43 +01:00
MarcoFalke fa7ecbf9f8
initwallet: Do not translate highly technical addresstype help 2018-01-24 11:30:44 -05:00
Wladimir J. van der Laan ba490d2460 qt: Bump BLOCK_CHAIN_SIZE to 200GB
Part of the release process for 0.16.

Value is open for discussion, my blocks/ directory is 163GB but this
leaves some slack.
2018-01-24 17:17:55 +01:00
João Barbosa 536ddeb173 [rpc] Add change_type option to fundrawtransaction 2018-01-24 16:00:50 +00:00
João Barbosa 31dbd5af48 [wallet] Add change type to CCoinControl 2018-01-24 15:52:05 +00:00
Wladimir J. van der Laan 6e3fe93609
qt: Update translation source file
Tree-SHA512: d16e6fd179c74203c9ce2dae717fe1d71b501ee6e397f10c6d0ec6fad9bdad256d9f383781d1f375c82d309d76547edf5ec10bdecabc21db4339b68c326e208e
2018-01-24 16:38:11 +01:00
Wladimir J. van der Laan e37ca2be91
Merge #12250: Make CKey::Load references const
04ededf Make CKey::Load references const (Russell Yanofsky)

Pull request description:

  No change in behavior, this just prevents CKey::Load arguments from looking
  like outputs.

Tree-SHA512: 6d93bce109318e88ddd5c21ad626571344707ae0e6d46e898c76fd95a7afd1c32202a6b3dfab47d6a787c84dfcbb35343cdec898bcf8f668574aa224f2eed977
2018-01-24 16:33:33 +01:00
João Barbosa 886a92f25f [rpc] Add address type option to addmultisigaddress 2018-01-24 14:45:07 +00:00
Wladimir J. van der Laan 95941396ff
Merge #12119: [wallet] use P2WPKH change output if any destination is P2WPKH or P2WSH
596c446 [wallet] use P2WPKH change output if any destination is P2WPKH or P2WSH (Sjors Provoost)

Pull request description:

  If `-changetype` is not explicitly set, then regardless of `-addresstype`, the wallet will use a ~`bech32` change address~ `P2WPKH` change output if any destination is `P2WPKH` or `P2WSH`.

  This seems more intuitive to me and more in line with the spirit of [BIP-69](https://github.com/bitcoin/bips/blob/master/bip-0069.mediawiki).

  When combined with #11991 a QT user could opt to use `bech32` exclusively without having to figure out how to launch with `-changetype=bech32`, although so would #11937.

Tree-SHA512: 9238d3ccd1f3be8dfdd43444ccf45d6bdc6584ced3172a3045f3ecfec4a7cc8999db0cdb76ae49236492a84e6dbf3a1fdf18544d3eaf6d518e1f8bd241db33e7
2018-01-24 15:22:42 +01:00
Wladimir J. van der Laan 69ec021969
Merge #11415: [RPC] Disallow using addresses in createmultisig
1df206f Disallow using addresses in createmultisig (Andrew Chow)

Pull request description:

  This PR should be the last part of #7965.

  This PR makes createmultisig only accept public keys and marks the old functionality of accepting addresses as deprecated.

  It also splits `_createmultisig_redeemscript` into two functions, `_createmultisig_getpubkeys` and `_createmultisig_getaddr_pubkeys`. `_createmultisig_getpubkeys` retrieves public keys from the RPC parameters and `_createmultisig_getaddr_pubkeys` retrieves addresses' public keys from the wallet. `_createmultisig_getaddr_pubkeys` requires the wallet and is only used by `addwitnessaddress` (except when `createmultisig` is used in deprecated mode).

  `addwitnessaddress`'s API is also changed. Instead of returning just an address, it now returns the same thing as `createmultisig`: a JSON object with two fields, address and redeemscript.

Tree-SHA512: a5796e41935ad5e47d8165ff996a8b20d5112b5fc1a06a6d3c7f5513c13e7628a4fd37ec30fde05d8b15abfed51bc250710140f6834b13f64d0a0e47a3817969
2018-01-24 14:03:40 +01:00
Wladimir J. van der Laan 6e89de5ba7
Merge #11512: Use GetDesireableServiceFlags in seeds, dnsseeds, fixing static seed adding
2b839ab Update chainparams comment for more info on service bits per dnsseed (Matt Corallo)
62e7642 Fall back to oneshot for DNS Seeds which don't support filtering. (Matt Corallo)
51ae766 Use GetDesireableServiceFlags in static seeds, document this. (Matt Corallo)
fb6f6b1 bluematt's testnet-seed now supports x9 (and is just a static list) (Matt Corallo)

Pull request description:

  4440710 broke inserting entries into addrman from dnsseeds which
  did not support service bits, as well as static seeds. Static seeds
  were already being filtered by UA for 0.13.1+ (ie NODE_WITNESS), so
  simply changing the default service bits to include NODE_WITNESS
  (and updating docs appropriately) is sufficient. For DNS Seeds, not
  supporting NODE_WITNESS is no longer useful, so instead use
  non-filtering seeds as oneshot hosts irrespective of named proxy.

  I've set my testnet-seed to also support x9, though because it is simply a static host, it may be useful to leave the support off so that it is used as a oneshot to get addresses from a live node instead. I'm fine with either.

Tree-SHA512: 3f17d4d2b0b84d876981c962d2b44cb0c8f95f52c56a48c6b35fd882f6d7a40805f320ec452985a1c0b34aebddb1922709156c3ceccd1b9f8363fd7cb537d21d
2018-01-24 13:07:05 +01:00
Wladimir J. van der Laan 8470e64724
Merge #11281: Avoid permanent cs_main/cs_wallet lock during RescanFromTime
7f81250 Mention that other RPC calls report keys as "imported" while txns are still missing (Jonas Schnelli)
ccd8ef6 Reduce cs_main lock in ReadBlockFromDisk, only read GetBlockPos under the lock (Jonas Schnelli)
bc356b4 Make sure WalletRescanReserver has successfully reserved the rescan (Jonas Schnelli)
dbf8556 Add RAII wallet rescan reserver (Jonas Schnelli)
8d0b610 Avoid pemanent cs_main/cs_wallet lock during wallet rescans (Jonas Schnelli)

Pull request description:

  Right now, we are holding `cs_main`/`cs_wallet` during the whole rescan process (which can take a couple of hours).
  This was probably only done because of laziness and it is an important show-stopper for #11200 (GUI rescan abort).

Tree-SHA512: 0fc3f82d0ee9b2f013e6bacba8d59f7334306660cd676cd64c47bb305c4cb7c7a36219d6a6f76023b74e5fe87f3ab9fc7fd2439e939f71aef653fddb0a1e23b1
2018-01-24 12:56:23 +01:00
Wladimir J. van der Laan d3a185a33b net: Move misbehaving logging to net logging category
This moves the error messages for misbehavior (when available) into the
line that reports the misbehavior, as well as moves the logging to the
`net` category.

This is a continuation of #11583 and avoids serious-looking errors due
to misbehaving peers.

To do this, Misbehaving() gains an optional `message` argument.

E.g. change:

    2018-01-18 16:02:27 Misbehaving: x.x.x.x:62174 peer=164603 (80 -> 100) BAN THRESHOLD EXCEEDED
    2018-01-18 16:02:27 ERROR: non-continuous headers sequence

to

    2018-01-18 16:02:27 Misbehaving: x.x.x.x:62174 peer=164603 (80 -> 100) BAN THRESHOLD EXCEEDED: non-continuous headers sequence
2018-01-24 12:18:29 +01:00
Jonas Schnelli 7f812502b7
Mention that other RPC calls report keys as "imported" while txns are still missing 2018-01-23 20:24:53 -10:00
Jonas Schnelli ccd8ef65f9
Reduce cs_main lock in ReadBlockFromDisk, only read GetBlockPos under the lock 2018-01-23 20:24:53 -10:00
Jonas Schnelli bc356b4268
Make sure WalletRescanReserver has successfully reserved the rescan 2018-01-23 20:24:18 -10:00
Jonas Schnelli dbf8556b4d
Add RAII wallet rescan reserver 2018-01-23 20:23:57 -10:00
Jonas Schnelli 8d0b610fe8
Avoid pemanent cs_main/cs_wallet lock during wallet rescans 2018-01-23 20:22:33 -10:00
Gregory Sanders 718f05cab5 move more bumpfee prechecks to feebumper::PreconditionChecks 2018-01-23 14:50:37 -05:00
Russell Yanofsky 04ededf001 Make CKey::Load references const
No change in behavior, this just prevents CKey::Load arguments from looking
like outputs.
2018-01-23 13:16:56 -05:00
Sjors Provoost 596c44633f
[wallet] use P2WPKH change output if any destination is P2WPKH or P2WSH
Only if -changetype is not set and -addresstype is not "legacy".
2018-01-23 17:56:15 +01:00
Matt Corallo 2b839abd3e Update chainparams comment for more info on service bits per dnsseed 2018-01-19 12:41:28 -10:00
Matt Corallo 62e764219b Fall back to oneshot for DNS Seeds which don't support filtering.
This allows us to not have to update the chainparams whenever a
DNS Seed changes its filtering support, as well fixes a bug
introduced in 44407100f where returned nodes will never be
attempted.
2018-01-19 12:41:28 -10:00