Commit Graph

249 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
846473aed2 Merge #15219: lint: Enable python linters via an array
948d8f4f10c31220ba4b6779cc862e2b6a0af5f6 lint: Enable python linters via an array (Ben Woosley)

Pull request description:

  This assures consistent recording of the enabled linters.

  This applies the same fix as #15170 to lint-python.sh

Tree-SHA512: 6d03f919e86e7c2465475c88b25dd84391282bcc11728078024daf0432a7dccddf9e4a2cdae35d6ef374971cb4e12f0fa21b58f757e25f2fe7c12ceb4f4b2c57
2021-08-24 19:14:50 -04:00
UdjinM6
8f7bfe7ef0
Merge pull request #4345 from linuxsh2/qt5-syntax
backport v0.18 (13529) and Qt5 connect syntax for Dash specific code
2021-08-24 19:14:18 +03:00
Wladimir J. van der Laan
57e895a9c6 Merge #13529: Use new Qt5 connect syntax
3567b247f43decb6fc102d5b0989d1746fce0441 test: Add lint to prevent SIGNAL/SLOT connect style (João Barbosa)
f78558f1e39198779bdb17e2b0e256fb99ad4b28 qt: Use new Qt5 connect syntax (João Barbosa)

Pull request description:

  Pros&cons in https://wiki.qt.io/New_Signal_Slot_Syntax.

  Note that connecting to/from overloaded slot/signal is ugly before qt 5.7 (see https://stackoverflow.com/a/16795664).

Tree-SHA512: ab81f035099fecd34be546f7091bc29595349f2fd0fea26f6414242702955fca27faa4fe19ebfe105c01217908b51db762cb5a9f6ce25bc5e8e6f64c77428c22
2021-08-23 12:12:31 -04:00
fanquake
b10159648f partial merge bitcoin#19844: lint: add C++ code linter
This currently only checks for boost::bind usage.

Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
2021-08-21 15:33:37 -05:00
MarcoFalke
33384816b5 Merge #14519: tests: add utility to easily profile node performance with perf
13782b8ba8 docs: add perf section to developer docs (James O'Beirne)
58180b5fd4 tests: add utility to easily profile node performance with perf (James O'Beirne)

Pull request description:

  Adds a context manager to easily (and selectively) profile node performance during functional test execution using `perf`.

  While writing some tests, I encountered some odd bitcoind slowness. I wrote up a utility (`TestNode.profile_with_perf`) that generates performance diagnostics for a node by running `perf` during the execution of a particular region of test code.

  `perf` usage is detailed in the excellent (and sadly unmerged) https://github.com/bitcoin/bitcoin/pull/12649; all due props to @eklitzke.

  ### Example

  ```python
  with node.profile_with_perf("large-msgs"):
      for i in range(200):
          node.p2p.send_message(some_large_msg)
      node.p2p.sync_with_ping()
  ```

  This generates a perf data file in the test node's datadir (`/tmp/testtxmpod0y/node0/node-0-TestName-large-msgs.perf.data`).

  Running `perf report` generates nice output about where the node spent most of its time while running that part of the test:

  ```bash
  $ perf report -i /tmp/testtxmpod0y/node0/node-0-TestName-large-msgs.perf.data --stdio \
    | c++filt \
    | less

  # To display the perf.data header info, please use --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 135  of event 'cycles:pp'
  # Event count (approx.): 1458205679493582
  #
  # Children      Self  Command          Shared Object        Symbol
  # ........  ........  ...............  ...................  ........................................................................................................................................................................................................................................................................
  #
      70.14%     0.00%  bitcoin-net      bitcoind             [.] CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)
                  |
                  ---CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

      70.14%     0.00%  bitcoin-net      bitcoind             [.] CNetMessage::readData(char const*, unsigned int)
                  |
                  ---CNetMessage::readData(char const*, unsigned int)
                     CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

      35.52%     0.00%  bitcoin-net      bitcoind             [.] std::vector<char, zero_after_free_allocator<char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<char*, std::vector<char, zero_after_free_allocator<char> > >, unsigned long, char const&)
                  |
                  ---std::vector<char, zero_after_free_allocator<char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<char*, std::vector<char, zero_after_free_allocator<char> > >, unsigned long, char const&)
                     CNetMessage::readData(char const*, unsigned int)
                     CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

  ...
  ```

Tree-SHA512: 9ac4ceaa88818d5eca00994e8e3c8ad42ae019550d6583972a0a4f7b0c4f61032e3d0c476b4ae58756bc5eb8f8015a19a7fc26c095bd588f31d49a37ed0c6b3e
2021-08-18 22:24:36 -03:00
Dzutte
4b603e64e4
Backports v0.18: PR 13743: refactor: Replace boost::bind with std::bind (#4343)
* Merge #13743: refactor: Replace boost::bind with std::bind

cb53b825c2 scripted-diff: Replace boost::bind with std::bind (Chun Kuan Lee)
2196c51821 refactor: Use boost::scoped_connection in signal/slot, also prefer range-based loop instead of std::transform (Chun Kuan Lee)

Pull request description:

  Replace boost::bind with std::bind

  - In `src/rpc/server.cpp`, replace `std::transform` with simple loop.
  - In `src/validation.cpp`, store the `boost::signals2::connection` object and use it to disconnect.
  - In `src/validationinterface.cpp`, use 2 map to store the `boost::signals2::scoped_connection` object.

Tree-SHA512: 6653cbe00036fecfc495340618efcba6d7be0227c752b37b81a27184433330f817e8de9257774e9b35828026cb55f11ee7f17d6c388aebe22c4a3df13b5092f0

* Replace boost::bind with std::bind and remove Boost.Bind includes

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
2021-08-17 23:31:09 +03:00
PastaPastaPasta
d7e57bdbe8
lint: fix linter failure in lint-python-dead-code.sh (#4344)
Signed-off-by: pasta <pasta@dashboost.org>
2021-08-17 23:08:49 +03:00
rkarthik2k21
883c84aa3e
Merge bitcoin#14272: init: Remove deprecated args from hidden args (#4335)
* Merge 9a3a984bb

Merge #14272: init: Remove deprecated args from hidden args

fa910e4301 init: Remove deprecated args from hidden args (MarcoFalke)

Pull request description:

  The args have been deprecated since 0.17 (maybe longer) and since we reject unknown args, there is no need to add deprecated args to the list of hidden args and then hand-craft an error message if a user provides them.

Tree-SHA512: 3a3191439ab0d7969fb72801d097bd86998524f84b3819380224f746cbe4b0f57beec1ad34744424f6587038035b0ddf418ad13171a8d9c3b97b4f3b7b3222a3

* Address review comment
Modified hidden_args in SetupServerArgs()
Removed usehd from list of unsupported/deprecated args

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
2021-08-17 22:53:28 +03:00
PastaPastaPasta
592cd0a939
Merge pull request #4333 from Munkybooty/backports-0.18-pr13
Backports 0.18 pr13
2021-08-16 14:24:51 -05:00
Wladimir J. van der Laan
debac13960 Partial Merge #14831: Scripts and tools: Use #!/usr/bin/env bash instead of #!/bin/bash.
688f665a5e526fda0fb797bf617412fe9cbe64fd Scripts and tools & Docs: Used #!/usr/bin/env bash instead of obsolete #!/bin/bash, added linting for .sh files shebang and updated the Developer Notes. (vim88)

Pull request description:

  As it was discussed in [#13510](https://github.com/bitcoin/bitcoin/pull/13510), it is better to use `#!/usr/bin/env bash` instead of `#!/bin/bash`.

Tree-SHA512: 25f71eb9a6a0cdc91568b5c6863205c5fe095f77a69e633503a2ac7805bd9013af8538e538c0c666ce96a28e3f43ce7a8df5f08d4ff007723bb588d85674f2da
2021-08-15 11:08:08 -04:00
Wladimir J. van der Laan
31924dbd30 Merge #14864: test: Run scripted-diff in subshell
43f909990190b3ff7883f0b2c117daa876d8fd99 scripted-diff: Run scripted-diff in subshell (Carl Dong)

Pull request description:

  scripted-diffs should be run in subshells so that their execution does not
  affect the shell variables of commit-script-check. Shell variables are not
  unset before evaluating the scripted-diff, so that they might be used in
  the subshell. To this end, the variable previously named i is now more
  descriptively named commit, this also allows scripted-diffs to use the
  commonly used variable i without fear of losing a reference to the
  commit.

Tree-SHA512: 0d86c069c2a978ca07d71bcd2b1b273e9bfabfe7e31a50c7b1b860e04f178b81c65814c3a38fb01e50b41a5065b646f0dab5b05d9be71138e72d4baba607e37b
2021-08-15 11:08:08 -04:00
MarcoFalke
12047d77d0 Merge #14365: tests: Add Python dead code linter (vulture) to Travis
c82190cdb6 tests: Add Python dead code linter (vulture) (practicalswift)
590a57fdec tests: Remove unused testing code (practicalswift)

Pull request description:

  Add Python dead code linter (`vulture`) to Travis.

  Rationale for allowing dead code only after explicit opt-in (via `--ignore-names`):
  * Less is more :-)
  * Unused code is by definition "untested"
  * Unused code can be an indication of bugs/logical errors. By making the contributor aware of newly introduced unused code it gives him/her an opportunity to investigate if the unused code they introduce is malignant or benign :-)
  * Unused code is hard to spot for humans and is thus often missed during manual review
  * [YAGNI](https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it)

  Based on #14312 to make linter job pass.

Tree-SHA512: 4c581df7c34986e226e4ade479e0d3c549daf38f4a4dc4564b25564d63e773a1830ba55d1289c771b1fa325483e8855b82b56e61859fe8e4b7dfa54034b093b6
2021-08-12 14:42:32 -03:00
PastaPastaPasta
39e34e2b52
Merge pull request #4334 from linuxsh2/bp-19
Backports v0.19 (16767, 16646, 16470, 16329, 16234, 16059, 15968, 15866, 15755, 15617, 15466, 15491)
2021-08-11 16:57:34 -05:00
fanquake
b08bc1c56c Merge #16767: test: Check for codespell in lint-spelling.sh
8340763dc3278c828ee7d525de4c71b4615d17cc Check for codespell in lint-spelling.sh (Kristaps Kaupe)

Pull request description:

  Similar check for `spellcheck` already exists in `lint-shell.sh`

ACKs for top commit:
  practicalswift:
    ACK 8340763dc3278c828ee7d525de4c71b4615d17cc -- diff looks correct
  fanquake:
    ACK 8340763dc3278c828ee7d525de4c71b4615d17cc  - Test is the same as in `lint-shell.sh`.

Tree-SHA512: f590fc4eae391c5246e86cb70cf79431bd3763ac872f82d3b2222c3a095235ca046a7072c5e61bbaeb3ed6ecd5ff85979769ee8b585de4fb97ac8cfbbf73b956
2021-08-11 13:58:48 -04:00
Kittywhiskers Van Gogh
798bebce33 tests: remove unneeded boost dependency to satisfy linter 2021-08-11 15:01:08 +05:30
Kittywhiskers Van Gogh
fc8952aa19
build: add libgmp detection, make immer a package (#4311)
* build: detect the presence of libgmp before generating Makefile

* depends: add arximboldi/immer@v0.6.2 as a package and add detection

* depends: remove immer from source tree, build using package only

* Drop immer refs from tools

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-08-10 22:35:55 +03:00
Jonas Schnelli
c2b8e5f0c9 Merge #15196: [test]: Update all subprocess.check_output functions to be Python 3.4 compatible
fdf82ba18 Update all subprocess.check_output functions in CI scripts to be Python 3.4 compatible (Graham Krizek)

Pull request description:

  CI is failing the `lint` stage on every Cron run (regular PR/Push runs still pass). The failure was introduced in 74ce326 and has been broken since. The Python version running in CI was downgraded to 3.4 from 3.6. There were a couple files that were using the `encoding` argument in the `subprocess.check_output` function. This was introduced in Python 3.6 and therefore broke the scripts that were using it. The `universal_newlines` argument was used as well, but in order to use it we must be able to set encoding because of issues on some BSD systems.

  To get CI to pass, I removed all `universal_newline` and `encoding` args to the `check_ouput` function. Then I decoded all `check_output` return values. This should keep the same behavior but be Python 3.4 compatible.

Tree-SHA512: f5e5885e98cf4777be9cc254446a873eedb03bdccbd8e06772a964db95e9fcf46736aa9cdcab1d8f123ea9f4947ed6020679898d8b2f47ffb1d94c21a4b08209
2021-08-03 10:43:56 -04:00
Wladimir J. van der Laan
d70d401c72 Merge #14884: Travis: enforce Python 3.4 support through linter
31926ee8cfc73501524dfa0fef2ccbaa786d6a00 [test] functional framework: add CScript hex() for Python 3.4 (Sjors Provoost)
74ce32683199b987e45eb16f0320ae392ff10edc [test] Travis: enforce Python 3.4 support in functional tests (Sjors Provoost)

Pull request description:

  The minimum supported version of Python is 3.4 according to [dependencies.md](https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md). This PR makes the Travis linter use this version in order to catch accidental use of modern syntax.

Tree-SHA512: 71b2c102be72b135a8ba049378d66875760f20a04a657102a399240c5c2b2ddbdfa7d5ab4c0c0242ecc3259e0ee8eb2273f331bc5eb824f4ae4c3cc58aea37ac
2021-08-03 10:39:19 -04:00
PastaPastaPasta
f87d62d677
refactor: misc bls, evo, include refactoring (#4305)
* refactor/bls: misc refactoring and spelling/grammar fixes in bls code

* refactor/evo: misc refactoring and spelling/grammar fixes in evo code

* refactor: some include changes

* refactor: remove redundant `public`

* fix linter

Signed-off-by: pasta <pasta@dashboost.org>

* Sort includes

* Move `class CTxDSIn;`

* Drop unused functions in CBLSWorker

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-07-31 21:29:12 +03:00
MarcoFalke
ce8b04fc38 Merge #16618: [Fix] Allow connection of a noban banned peer
d117f4541d4717e83c9396273e92960723622030 Add test for setban (nicolas.dorier)
dc7529abf0197dccb876dc4a93cbdd2ad9f03e5c [Fix] Allow connection of a noban banned peer (nicolas.dorier)

Pull request description:

  Reported by @MarcoFalke on https://github.com/bitcoin/bitcoin/pull/16248#discussion_r314026195

  The bug would mean that if the peer connecting to you is banned, but whitelisted without specific permissions, it would not be able to connect to the node.

  The solution is just to move the same line below.

ACKs for top commit:
  Sjors:
    Agree inline is more clear. utACK d117f45
  MarcoFalke:
    ACK d117f4541d4717e83c9396273e92960723622030

Tree-SHA512: 0fed39acb1e8db67bb0bf4c4de3ad034ae776f38d55bd661f1ae0e1a4c6becaf1824ab46ed8279f2f31df3f4b29ff56461d8b167d3e9cece62cfe58b5a912811
2021-07-19 19:00:04 -05:00
UdjinM6
9b4a29393d
Add unparseable to lint-spelling.ignore-words.txt 2021-07-19 12:52:02 -05:00
UdjinM6
16877311da
Ignore crypto and immer in lint-spelling.sh 2021-07-19 12:52:02 -05:00
Pieter Wuille
07abb538c3
Merge #14495: build: Warn (don't fail!) on spelling errors
c32cf6a0f2 Add ignored word: mut (practicalswift)
4ae50daaa7 Revert "qa: Fix codespell error and have lint-spelling error instead of warn" (practicalswift)

Pull request description:

  Revert `codespell` policy change introduced in #14179.

  Context: https://github.com/bitcoin/bitcoin/pull/13954#issuecomment-430200183

Tree-SHA512: 4606b19bb32cdd661f90b3778759818d3493e5ed1a4a2f95982f07eeb6b9c889bc8d53cde31706e0a3b9524c3d3a7378f1b769a60baeb0d00da4c68fd3068114
2021-07-19 12:51:30 -05:00
MarcoFalke
41494eea70
Merge #13954: Warn (don't fail!) on spelling errors. Fix typos reported by codespell.
f8a81f73ac lint: Add spell check linter (codespell) (practicalswift)
ada356208e Fix typos reported by codespell (practicalswift)

Pull request description:

  * Check for common misspellings using `codespell`.
  * Fix recently introduced typos reported by `codespell`.

Tree-SHA512: 9974c0e640b411c7d0ebc5b45de253c19bac7fe3002cd98601ff8da8db584224c2fd7d331aee3df612c9f2cfef540d647a9b4c5a1a73fd208dc93ce4bf9e5e3e
2021-07-19 12:51:24 -05:00
UdjinM6
f11c1bc1f8
Ignore immer in code coverage checks, lint-whitespace.sh and copyright_header.py scripts (#4268) 2021-07-19 12:32:29 +03:00
UdjinM6
46e3a8c295
Fix lint-git-commit-check.sh (#4267)
We merge PRs into develop, not in master
2021-07-19 12:32:12 +03:00
Kittywhiskers Van Gogh
4619630551 merge #13671: Remove boost/algorithm/string/case_conv.hpp 2021-07-16 20:19:42 +05:30
MarcoFalke
fb7b4bbdca Merge #19654: lint: Don't use TRAVIS_COMMIT_RANGE in commit message linter
72351784b3df21a89f79076f4b814a6e700b6469 lint: Remove travis env var from commit linter (Fabian Jahr)

Pull request description:

  #19439 was recently merged and seemed to work fine but I now noticed strange behavior when it was running in Travis, which I could not reproduce locally. It turns out `TRAVIS_COMMIT_RANGE` which is used in Travis to get the commits for the linter, uses all the commits that were in a push, which includes all rebase commits for example. This means that the linter can fail on a commit that the developer has never even seen before, which can be very confusing. See an example here which caused me to look into this: https://travis-ci.org/github/bitcoin/bitcoin/jobs/714296381 The commit that is reported as failing in my PR is not part of my PR.

  I think we rather want to use something like `git merge-base` to get the commit range by default and in Travis. I am leaving the env variable functionality in place with a different name but this is not a variable that can be expected to be present in the CI environments so the `merge-base` range should be used there by default.

ACKs for top commit:
  hebasto:
    ACK 72351784b3df21a89f79076f4b814a6e700b6469, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: afb27bb386855cb8d5cf84fd3a6c11ef1160b25af6175ed0aa146bf04b9a26eb77298df70df0a855f8c46f19f08b3f62c49872c12974fcfa5526a15ee05b3c10
2021-07-15 19:30:07 -05:00
MarcoFalke
7a92af887d Merge #19439: script: Linter to check commit message formatting
284a969cc082ae3c63ab523f22e71da86ad4ab20 Linter to check commit message formatting (Amir Ghorbanian)

Pull request description:

  Write linter to check that commit messages have a new line before the body or no body at all. fixes issue #19091.

ACKs for top commit:
  troygiorshev:
    ACK 284a969cc082ae3c63ab523f22e71da86ad4ab20 Reviewed, manually tested. Works great!
  fjahr:
    tested ACK 284a969cc082ae3c63ab523f22e71da86ad4ab20
  adamjonas:
    utACK 284a969cc082ae3c63ab523f22e71da86ad4ab20

Tree-SHA512: fa278f090780b54e4fa6e2967a62b4c1a4da55d112ec1ad6dd7e1181ac490c5c1af0165524b5781b463fdd6d0f79fd3d95b5160184e6eca432ccff1189f77390
2021-07-15 19:30:07 -05:00
Kittywhiskers Van Gogh
da33c9619c
partial merge #17398: Update leveldb to 1.22+ (#4230)
* Update to leveldb upstream using subtree merge

* Import crc32c using subtree merge as as 'src/crc32c'

* build: Update build system for new leveldb

Upstream leveldb switched build systems, which means we need to define
a few different values.

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* doc: Add crc32c subtree to developer notes

* test: Add crc32c to subtree check linter

* test: Add crc32c exception to various linters and generation scripts

* build: Add LCOV exception for crc32c

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* build: CRC32C build system integration

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-07-15 15:42:55 -05:00
UdjinM6
07e7be34d2
Merge pull request #4250 from PastaPastaPasta/backport-triv-pr11
backport: 'trivial' pr11
2021-07-15 20:34:04 +03:00
Wladimir J. van der Laan
a426a8b2e6 Merge #18056: ci: Check for submodules
2a95c7c95690112a03b14ccb0fb8f66db12cb75b ci: Check for submodules (Emil Engler)

Pull request description:

  See #18019.
  The current solution looks like this (I also tested with multiple submodules):
  ```
  These submodules were found, delete them:
   355a5a310019659d9bf6818d2fd66fbb214dfed7 curl (curl-7_68_0-108-g355a5a310)
  ```
  The submodule example command was `git submodule add https://github.com/curl/curl.git curl`

ACKs for top commit:
  laanwj:
    ACK 2a95c7c95690112a03b14ccb0fb8f66db12cb75b

Tree-SHA512: 64bf388123f0a88d12e3e41ff29bc190339377a0615c35dc3f2700bb7773470a8fa426e0ff57188a60ed88bded39f75082ff0b73118651ff403b163422395005
2021-07-13 21:17:15 -05:00
fanquake
2747862848 Merge #17329: linter: Strip trailing / in path for git-subtree-check
60582d6060542c1e3a23141ea825e36818fbbd54 [linter] Strip trailing / in path for git-subtree-check (John Newbery)

Pull request description:

  git-subtree-check fails if the directory is given with a trailing slash,
  eg:

  ```
  > test/lint/git-subtree-check.sh src/univalue/
  ERROR: src/univalue/ is not a subtree
  ```

  Shell autocompletes will add the trailing slash when autofilling the
  path name, which will therefore cause the script to fail.

  Just ignore any trailing slash.

ACKs for top commit:
  laanwj:
    ACK 60582d6060542c1e3a23141ea825e36818fbbd54
  dongcarl:
    ACK 60582d6060542c1e3a23141ea825e36818fbbd54
  fanquake:
    ACK 60582d6060542c1e3a23141ea825e36818fbbd54 - tested before and after.

Tree-SHA512: 5a91979b60e1d4b1310fd02a0ccc5465dbff57d9c94bba81e4758442a627cfa32217ab8f973990a17b5d961ecae61fb56b56ccf10f87e61dd03e88a1e0b8f99d
2021-07-13 20:43:16 -05:00
UdjinM6
3004c3498b
Merge pull request #4245 from PastaPastaPasta/backport-triv-pr9
backport: 'trivial' pr9
2021-07-14 02:52:00 +03:00
UdjinM6
6aea99094b
Merge pull request #4243 from Munkybooty/backports-0.18-pr7.1
Merge bitcoin#13877: utils: Make fs::path::string() always return utf-8 string on Windows
2021-07-13 20:53:30 +03:00
PastaPastaPasta
48487122ad
Merge pull request #4239 from Munkybooty/backports-0.18-pr7
Backports 0.18 pr7
2021-07-13 11:51:50 -05:00
MarcoFalke
e8c2117b16 Merge #13877: utils: Make fs::path::string() always return utf-8 string on Windows
2c3eade704 Make fs::path::string() always return utf-8 string (Chun Kuan Lee)

Pull request description:

  Imbue `fs::path` with `std::codecvt_utf8_utf16` at `SetupEnvironment()`, so that default string encoding will be utf-8 inside `fs::path`.

Tree-SHA512: 0cb59464d777278decbf24771fc5ff0cb2caa7bc2fe8ee5cd36c97a2324873a3caad131f08f050393b488316ee7f4ab0b28b7fa4699e41839f8e51b9867d5118

# Conflicts:
#	src/qt/guiutil.cpp
2021-07-13 09:51:49 -04:00
Wladimir J. van der Laan
c585c4a792 Merge #13734: gui: Drop boost::scoped_array and use wchar_t API explicitly on Windows
bb6ca65f9890e8280ace32de5a37774e14705859 gui: get special folder in unicode (Chun Kuan Lee)
1c5d22585384c8bb05a27a04eab5c57b31d623fb Drop boost::scoped_array (Chun Kuan Lee)

Pull request description:

  Drop boost::scoped_array and simplify the code.

  `TCHAR` should be defined as `wchar_t` if `UNICODE` is defined. So we can use `.toStdWString().c_str()` to get wchar_t C-style string.

  Fix #13819

Tree-SHA512: 3fd4aa784129c9d1576b01e6ee27faa42d793e152d132f2dde504d917dad3a8e95e065fcbc54a3895d74fb6b2a9ed4f5ec67d893395552f585e225486a84a454

# Conflicts:
#	src/qt/guiutil.cpp
2021-07-12 21:57:11 -04:00
MarcoFalke
d36d5efee5 Merge #16768: test: Make lint-includes.sh work from any directory
490da639cbd48ce0dc438abbfc89ab796391cb2a Make lint-includes.sh work from any directory (Kristaps Kaupe)

Pull request description:

  Before this change it works from root folder of bitcoin git repo, but if you do `cd test/lint; ./test-includes.sh`, you will have a lot of false positive messages like this:
  ```
  Good job! The circular dependency "chainparamsbase -> util/system -> chainparamsbase" is no longer present.
  Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in ./lint-circular-dependencies.sh
  to make sure this circular dependency is not accidentally reintroduced.

  Good job! The circular dependency "index/txindex -> validation -> index/txindex" is no longer present.
  Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in ./lint-circular-dependencies.sh
  to make sure this circular dependency is not accidentally reintroduced.

  ```

Top commit has no ACKs.

Tree-SHA512: 07fa69cb2883181dcee922191acac4b242722eeb2916cdffdc7163421302b22f3c9525aaf4c754a9dba1c307032c05285e38191d5c6aabc894321f8a27bbceaa
2021-07-12 20:52:56 -05:00
gabriel-bjg
ee6d2f5b0d
Fix data races in bls_worker and use ctpl_stl queue. (#4240)
Change ctpl implementation to use STL queue & mutex.

Use ctpl synchronized queue instead of boost lockfree queue in bls worker aggregator.

Use smart pointers for memory management of Aggregator and VectorAggregator. With 'delete this;' the objects are prone to data race on the delete operator.

Use smart pointers for memory management of ContributionVerifier.

Pass shared_ptr by value to other threads via worker pool.
2021-07-11 22:25:27 -05:00
UdjinM6
08558d67ee
Merge pull request #4235 from PastaPastaPasta/backport-triv-pr7
backport: 'trivial' pr7
2021-07-10 21:46:25 +03:00
MarcoFalke
038997ff45 Merge #16036: travis: Run all lint scripts even if one fails
f3b90f2e05 Run all lint scripts (Julian Fleischer)

Pull request description:

  The description reads:

  ```
  # This script runs all contrib/devtools/lint-*.sh files, and fails if any exit
  # with a non-zero status code.
  ```

  This runs all scripts and returns with a non-zero exit code if any failed.

ACKs for commit f3b90f:

Tree-SHA512: 4f1f6435855dd5074a38c5887be6f096ec66f4dbe8712bdfd5fed0c510f1b2c083b7318cf3bfbdcc85982429fb7b4309e57ce48cc11736c86376658ec7ffea8f
2021-07-10 12:10:51 -05:00
UdjinM6
90266a9465
Merge pull request #4234 from UdjinM6/backports-0.17-pr35
Backports 0.17 pr35
2021-07-10 12:11:49 +03:00
PastaPastaPasta
3bdf9922af
Merge pull request #4223 from Munkybooty/backports-0.18-pr4
Backports 0.18 pr4
2021-07-09 12:10:22 -05:00
UdjinM6
637a8a28fe
Merge pull request #4226 from PastaPastaPasta/backport-triv-pr6
backport: 'trivial' pr6
2021-07-08 23:25:09 +03:00
MarcoFalke
4c2211dd41 Partial merge #13863: travis: move script sections to files in .travis/ subject to shellcheck
414326952c use export LC_ALL=C.UTF-8 (Julian Fleischer)
728c82d029 make script exit if a command fails (Julian Fleischer)
506890b24d move remaining travis build steps into individual files (Julian Fleischer)
272306ea57 number .travis/ script according to build lifecycle and add README to explain (Julian Fleischer)
519e2739cf move lint stage up to resemble travis build ui (Julian Fleischer)
86d34f0e65 abort script in END_FOLD on non-zero exit code (Julian Fleischer)
4f2f88c7b0 move script sections info individual files and comply with shellcheck (Julian Fleischer)

Pull request description:

  This PR is extracted from https://github.com/bitcoin/bitcoin/pull/13816 to make that one easier to review. It follows on https://github.com/bitcoin/bitcoin/pull/13849 and https://github.com/bitcoin/bitcoin/pull/13851

  In here the shell script parts from `travis.yml` are extracted into `.travis/before_install.sh`, `.travis/install.sh`, `.travis/before_script.sh`, `.travis/script.sh`, and `.travis/lint.sh`.

  This has the benefit that `test/lint/lint-shell.sh` will also shellcheck these parts. Also it makes the individual script parts more readable.

Tree-SHA512: c497e1687ceb1c1d795de177d3fc35af908bc8e3f781a871afabdecf031e581d4db229290627249e35ef7c09952bc34884e4734ea91d40f57b4a9efb85bba2e3
2021-07-08 13:09:43 -04:00
MarcoFalke
f10236c2bd
Merge #14960: lint/format-strings: Correctly exclude escaped percent symbols
57281199b8 lint/format-strings: Correctly exclude escaped percent symbols (Luke Dashjr)

Pull request description:

  The current code fails to exclude correctly for patterns like `"%%%X"`

Tree-SHA512: cac6f6fb3f06a9190310cd9764ec31cd7d636f9c831057622f418ae5fd2e1d80927a88f585d18f57b279ac21e81518f714dc1a25155377b9297741a73600461e
2021-07-08 11:57:15 -05:00
Wladimir J. van der Laan
7214b034eb Merge #14128: lint: Make sure we read the command line inputs using utf-8 decoding in python
5d62dcf9cfb5c0b2511c10667ed47ec3b3610d72 lint: Make sure we read the command line inputs using utf-8 decoding in python (Chun Kuan Lee)

Pull request description:

  Make sure we read the command line inputs using utf-8 decoding in python

  occurred from travis cron job:

  contrib/verify-commits/verify-commits.py should run with utf-8, otherwise it would raise UnicodeDecodeError
  `UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 744: ordinal not in range(128)`

Tree-SHA512: 90e4ad57fdbbbecb0a21fc2d2b03a04f5ef125e54124719ef36e5a85326930b732b47534757a7c3a8730096f3947b009ec898191928b5c2d38f9f4b3e37db48d

# Conflicts:
#	contrib/devtools/optimize-pngs.py
2021-07-07 12:04:53 -04:00
MarcoFalke
9f4f52ae4e
Merge #13054: tests: Enable automatic detection of undefined names in Python tests scripts. Remove wildcard imports.
68400d8b96 tests: Use explicit imports (practicalswift)

Pull request description:

  Enable automatic detection of undefined names in Python tests scripts. Remove wildcard imports.

  Wildcard imports make it unclear which names are present in the namespace, confusing both readers and many automated tools.

  An additional benefit of not using wildcard imports in tests scripts is that readers of a test script then can infer the rough testing scope just by looking at the imports.

  Before this commit:

  ```
  $ contrib/devtools/lint-python.sh | head -10
  ./test/functional/feature_rbf.py:8:1: F403 'from test_framework.util import *' used; unable to detect undefined names
  ./test/functional/feature_rbf.py:9:1: F403 'from test_framework.script import *' used; unable to detect undefined names
  ./test/functional/feature_rbf.py:10:1: F403 'from test_framework.mininode import *' used; unable to detect undefined names
  ./test/functional/feature_rbf.py:15:12: F405 bytes_to_hex_str may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:17:58: F405 CScript may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:25:13: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:26:31: F405 satoshi_round may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:26:60: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:30:41: F405 satoshi_round may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:30:68: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  $
  ```

  After this commit:

  ```
  $ contrib/devtools/lint-python.sh | head -10
  $
  ```

Tree-SHA512: 3f826d39cffb6438388e5efcb20a9622ff8238247e882d68f7b38609877421b2a8e10e9229575f8eb6a8fa42dec4256986692e92922c86171f750a0e887438d9
2021-07-06 20:29:33 +03:00
Kittywhiskers Van Gogh
b5db3c3d65 merge #18011: Replace current benchmarking framework with nanobench 2021-07-05 18:28:55 +05:30
Wladimir J. van der Laan
a9fb8a57ab
Merge #13482: Remove boost::program_options dependency
f447a0a7079619f0d650084df192781cca9fd826 Remove program options from build system (Chun Kuan Lee)
11588c639e8912f1b28e981c1a2a0e4306dbd093 Replace boost program_options (Chun Kuan Lee)

Pull request description:

  Concept from #12744, but without parsing negated options.

Tree-SHA512: 7f418744bb8934e313d77a5f162633746ef5d043de802b9c9cd9f7c1842e7e566eb5f171cd9e2cc13317281b2449c6fbd553fa4f09b837e6af2f5d2b2aabdca2
2021-07-02 12:59:27 +03:00
Wladimir J. van der Laan
4cd32e43e4
Merge #13235: Break circular dependency: init -> * -> init by extracting shutdown.h
1fabd59e7 Break circular dependency: init -> * -> init by extracting shutdown.h (Ben Woosley)
e62fdfeea Drop unused init.h includes (Ben Woosley)

Pull request description:

  Most includers just wanted to react to pending shutdown.

  This isolates access to `fRequestShutdown` and limits access to the shutdown api functions, including the new `CancelShutdown` for setting it to `false`.

Tree-SHA512: df42f75dfbba163576710e9a67cf1228531fd99d70a2f187bfba0bcc476d6749cf88180a97e66a81bb5b6c3c7f0917de7402d26039ba7b644cb7509b02f7e267
2021-07-02 00:42:18 +03:00
Wladimir J. van der Laan
cd5a39c8af Merge #14088: tests: Don't assert(...) with side effects
ca1a093127c11bb2aea10bf96c38dbfb40f8d170 Add regression test: Don't assert(...) with side effects (practicalswift)
4c3c9c38699360f93d3c52a01a90ff15ee5e1a62 Don't assert(...) with side effects (practicalswift)

Pull request description:

  Don't `assert(...)` with side effects.

  From the developer notes:

  > **Assertions should not have side-effects**
  >
  > Rationale: Even though the source code is set to refuse to compile with assertions disabled, having side-effects in assertions is unexpected and makes the code harder to understand

  These assertions were introduced quite recently (in #14069 which was merged two days ago) and since this is a recurring thing (see #13534 – "Don't assert(foo()) where foo() has side effects" from May) I added a simple regression test for the most obvious common side effect.

Tree-SHA512: be65db9d8d5d0f5752152ba73fe3fbb0531880f156d3cd7dfdf1752709979b63214e46ae64b1adbe1e09fa121278f4087f4ae49bff16cf8f5aec16ea6bde3650
2021-07-01 16:33:23 -05:00
MarcoFalke
69c601c2c3 Merge #13939: lint: Make format string linter understand basic template parameter syntax
4441ad677a Make format string linter understand basic template parameter syntax (practicalswift)

Pull request description:

  Make format string linter understand basic template parameter syntax.

  Fixes issue described in https://github.com/bitcoin/bitcoin/pull/13705#issuecomment-412046126.

  Thanks to @ken2812221 for reporting!

Tree-SHA512: 8fb995bc6b29d8b9926ef5969e02cf71c494e829434fcdeb4ed5fabad5ab96e86e5b8eea705e8a416927757b4fa4e58abc0fd4f483daa58c94e2c6fdcb8ee822
2021-06-28 21:31:44 -05:00
Wladimir J. van der Laan
a54f338783
Merge #15170: refactor/lint: Add ignored shellcheck suggestions to an array
cbd9091ed5a76bb2e1e57cd0d8db035c15529341 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
2021-06-28 13:40:55 -05:00
Wladimir J. van der Laan
de60193469
Merge #15164: qa: Ignore shellcheck warning SC2236
f652f85d0c88629b4284f69b179362254307fb55 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
2021-06-28 13:40:54 -05:00
Kittywhiskers Van Gogh
ef4dfa8524 merge bitcoin#14555: Move util files to directory
(script modified to account for Dash backports, doesn't account for rebasing)

------------- BEGIN SCRIPT ---------------
mkdir -p src/util
git mv src/util.h src/util/system.h
git mv src/util.cpp src/util/system.cpp
git mv src/utilmemory.h src/util/memory.h
git mv src/utilmoneystr.h src/util/moneystr.h
git mv src/utilmoneystr.cpp src/util/moneystr.cpp
git mv src/utilstrencodings.h src/util/strencodings.h
git mv src/utilstrencodings.cpp src/util/strencodings.cpp
git mv src/utiltime.h src/util/time.h
git mv src/utiltime.cpp src/util/time.cpp
git mv src/utilasmap.h src/util/asmap.h
git mv src/utilasmap.cpp src/util/asmap.cpp
git mv src/utilstring.h src/util/string.h
git mv src/utilstring.cpp src/util/string.cpp

gsed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utilasmap\.h>/<util\/asmap\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utilstring\.h>/<util\/string\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')

gsed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h
gsed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h
gsed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h
gsed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h
gsed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h
gsed -i 's/BITCOIN_UTILASMAP_H/BITCOIN_UTIL_ASMAP_H/g' src/util/asmap.h
gsed -i 's/BITCOIN_UTILSTRING_H/BITCOIN_UTIL_STRING_H/g' src/util/string.h

gsed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am
gsed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am
gsed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am
gsed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am
gsed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am
gsed -i 's/utilasmap\.\(h\|cpp\)/util\/asmap\.\1/g' src/Makefile.am
gsed -i 's/utilstring\.\(h\|cpp\)/util\/string\.\1/g' src/Makefile.am

gsed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh
gsed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh
gsed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh
gsed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh
------------- END   SCRIPT ---------------
2021-06-27 12:03:13 +05:30
UdjinM6
11796986df
Merge pull request #4200 from Munkybooty/backports-0.18-pr1
Backports 0.18 pr1
2021-06-26 16:10:09 +03:00
UdjinM6
c5cc285d0e
Merge pull request #4191 from kittywhiskers/checkqueue
partial #15842, merge #15849, #17342, #18710: Add local thread pool to CCheckQueue
2021-06-26 16:08:02 +03:00
Kittywhiskers Van Gogh
c9d0d92b2d merge #18710: Add local thread pool to CCheckQueue 2021-06-25 12:25:14 +05:30
Kittywhiskers Van Gogh
94e3a5de64 bitcoin#14209: Replace LogPrint macros with regular functions 2021-06-24 23:43:02 +05:30
Wladimir J. van der Laan
82659a4eb8 Merge #12257: [wallet] Use destination groups instead of coins in coin select
232f96f5c8a3920c09db92f4dbac2ad7d10ce8cf doc: Add release notes for -avoidpartialspends (Karl-Johan Alm)
e00b4699cc6d2ee5697d38dd6607eb2631c9b77a clean-up: Remove no longer used ivars from CInputCoin (Karl-Johan Alm)
43e04d13b1ffc02b1082176e87f420198b40c7b1 wallet: Remove deprecated OutputEligibleForSpending (Karl-Johan Alm)
0128121101fb3ee82f3abd3973a967a4226ffe0e test: Add basic testing for wallet groups (Karl-Johan Alm)
59d6f7b4e2f847ec1f2ff46c84e6157655984f85 wallet: Switch to using output groups instead of coins in coin selection (Karl-Johan Alm)
87ebce25d66952f5ce565bb5130dcf5e24049872 wallet: Add output grouping (Karl-Johan Alm)
bb629cb9dc567cc819724d9f4852652926e60cbf Add -avoidpartialspends and m_avoid_partial_spends (Karl-Johan Alm)
65b3eda458221644616d0fdd6ba0fe01bdbce893 wallet: Add input bytes to CInputCoin (Karl-Johan Alm)
a443d7a0ca333b0bae63e04b5d476f9ad9c7aeac moveonly: CoinElegibilityFilter into coinselection.h (Karl-Johan Alm)
173e18a289088c6087ba6fac708e322aa63b7a94 utils: Add insert() convenience templates (Karl-Johan Alm)

Pull request description:

  This PR adds an optional (off by default) `-avoidpartialspends` flag, which changes coin select to use output groups rather than outputs, where each output group corresponds to all outputs with the same destination.

  It is a privacy improvement, as each time you spend some output, any other output that is publicly associated with the destination (address) will also be spent at the same time, at the cost of fee increase for cases where coin select without group restriction would find a more optimal set of coins (see example below).

  For regular use without address reuse, this PR should have no effect on the user experience whatsoever; it only affects users who, for some reason, have multiple outputs with the same destination (i.e. address reuse).

  Nodes with this turned off will still try to avoid partial spending, if the fee of the resulting transaction is not greater than the fee of the original transaction.

  Example: a node has four outputs linked to two addresses `A` and `B`:

  * 1.0 btc to `A`
  * 0.5 btc to `A`
  * 1.0 btc to `B`
  * 0.5 btc to `B`

  The node sends 0.2 btc to `C`. Without `-avoidpartialspends`, the following coin selection will occur:
  * 0.5 btc to `A` or `B` is picked
  * 0.2 btc is output to `C`
  * 0.3 - fee is output to (unique change address)

  With `-avoidpartialspends`, the following will instead happen:
  * Both of (0.5, 1.0) btc to `A` or `B` is picked (one or the other pair)
  * 0.2 btc is output to `C`
  * 1.3 - fee is output to (unique change address)

  As noted, the pro here is that, assuming nobody sends to the address after you spend from it, you will only ever use one address once. The con is that the transaction becomes slightly larger in this case, because it is overpicking outputs to adhere to the no partial spending rule.

  This complements #10386, in particular it addresses @luke-jr and @gmaxwell's concerns in https://github.com/bitcoin/bitcoin/pull/10386#issuecomment-300667926 and https://github.com/bitcoin/bitcoin/pull/10386#issuecomment-302361381.

  Together with `-avoidreuse`, this fully addresses the concerns in #10065 I believe.

Tree-SHA512: 24687a4490ba59cf4198ed90052944ff4996653a4257833bb52ed24d058b3e924800c9b3790aeb6be6385b653b49e304453e5d7ff960e64c682fc23bfc447621

# Conflicts:
#	src/Makefile.am
#	src/bench/coin_selection.cpp
#	src/wallet/coincontrol.h
#	src/wallet/coinselection.cpp
#	src/wallet/coinselection.h
#	src/wallet/init.cpp
#	src/wallet/test/coinselector_tests.cpp
#	src/wallet/wallet.cpp
#	src/wallet/wallet.h
#	test/functional/test_runner.py
2021-06-24 13:21:20 -04:00
Wladimir J. van der Laan
edac135e2d Merge #13707: tests: Add usage note to check-rpc-mappings.py
03a2d680101a9fee47c6fd818df7585cfc93ac06 Tests: add usage note to check-rpc-mappings.py (Mason Simon)

Pull request description:

  This test would previously fail without a user-friendly warning message, if invoked with no arguments.

  Test plan:
  ```
  bitcoin @_@$ python3 test/lint/check-rpc-mappings.py
  Usage: test/lint/check-rpc-mappings.py ROOT-DIR
  bitcoin @_@$ echo $?
  1
  bitcoin @_@$ python3 test/lint/check-rpc-mappings.py .
  * Checking consistency between dispatch tables and vRPCConvertParams
  bitcoin @_@$ echo $?
  0
  ```

Tree-SHA512: 0b7a94125d18ba5dbf3c3281a4af60718d2e495bf7645d7c2a3e1a2a1d80cffcea1383c90247186728037f1f2b38de75d0f59ccf7f792d69edd33884f3698c07
2021-06-15 13:15:26 -04:00
Pieter Wuille
7ff6515c88
Merge #13033: Build txindex in parallel with validation
9b2704777c [doc] Include txindex changes in the release notes. (Jim Posen)
ed77dd6b30 [test] Simple unit test for TxIndex. (Jim Posen)
6d772a3d44 [rpc] Public interfaces to GetTransaction block until synced. (Jim Posen)
a03f804f2a [index] Move disk IO logic from GetTransaction to TxIndex::FindTx. (Jim Posen)
e0a3b80033 [validation] Replace tx index code in validation code with TxIndex. (Jim Posen)
8181db88f6 [init] Initialize and start TxIndex in init code. (Jim Posen)
f90c3a62f5 [index] TxIndex method to wait until caught up. (Jim Posen)
70d510d93c [index] Allow TxIndex sync thread to be interrupted. (Jim Posen)
94b4f8bbb9 [index] TxIndex initial sync thread. (Jim Posen)
34d68bf3a3 [index] Create new TxIndex class. (Jim Posen)
c88bcec93f [db] Migration for txindex data to new, separate database. (Jim Posen)
0cb8303241 [db] Create separate database for txindex. (Jim Posen)

Pull request description:

  I'm re-opening #11857 as a new pull request because the last one stopped loading for people

  -------------------------------

  This refactors the tx index code to be in it's own class and get built concurrently with validation code. The main benefit is decoupling and moving the txindex into a separate DB. The primary motivation is to lay the groundwork for other indexers that might be desired (such as the [compact filters](https://github.com/bitcoin/bips/pull/636)). The basic idea is that the TxIndex spins up its own thread, which first syncs the txindex to the current block index, then once in sync the BlockConnected ValidationInterface hook writes new blocks.

  ### DB changes

  At the suggestion of some other developers, the txindex has been split out into a separate database. A data migration runs at startup on any nodes with a legacy txindex. Currently the migration blocks node initialization until complete.

  ### Open questions

  - Should the migration of txindex data from the old DB to the new DB block in init or should it happen in a background thread? The downside to backgrounding it is that `getrawtransaction` would return an error message saying the txindex is syncing while the migration is running.

  ### Impact

  In a sample size n=1 test where I synced nodes from scratch, the average time [Index writing](https://github.com/bitcoin/bitcoin/blob/master/src/validation.cpp#L1903) was 3.36ms in master and 1.72ms in this branch. The average time between `UpdateTip` log lines for sequential blocks between 400,000 and IBD end on mainnet was 0.297204s in master and 0.286134s in this branch. Most likely this is just variance in IBD times, but I can try with some more trials if people want.

Tree-SHA512: 451fd7d95df89dfafceaa723cdf0f7b137615b531cf5c5035cfb54e9ccc2026cec5ac85edbcf71b7f4e2f102e36e9202b8b3a667e1504a9e1a9976ab1f0079c4
2021-05-25 13:48:04 +03:00
Kittywhiskers Van Gogh
96eaef33ee Merge #13862: drop boost::interprocess::file_lock 2021-05-20 10:15:17 +05:30
UdjinM6
f488d938f9
Make shellcheck 0.7.2 happy
Fixes `SC2268: Avoid x-prefix in comparisons as it no longer serves a purpose.`
2021-05-05 14:12:04 +03:00
PastaPastaPasta
da480fcd70
refactoring: governance tidying and include refactoring (#4111)
* remove unneeded semi-colons

* remove an unneeded CGovernanceException

* adjust and optimize listVotes to vector conversion

* governance-vote.h forward declare and include in cpp

* governance: use more forward decl. less includes in headers

* remove a number of unneeded includes in dash rpc code

* resolve circular depends linter

* Reorder includes

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-04-23 00:32:03 +02:00
PastaPastaPasta
d70d987be2
refactor: remove some validationinterface includes, resolve circular depends (#4116) 2021-04-20 22:32:27 +03:00
PastaPastaPasta
5074e6df9e
Extensive include refactoring (#4095)
* Simple changes, mostly just includes

* Continued include changes combined with using pointers to avoid including more than necessary in headers

* remove dup include

* masternode-utils.cpp include net.h in all builds

* resolve linter -7 +11

* drop quorums.h from dkgsessionhandler.cpp

* Add `<utilstrencodings.h>`

* Initialize lastMNListForVotingKeys

* Refactor GetMinedCommitment to return sharedptr

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-04-15 23:41:16 -04:00
UdjinM6
6ba3b2f3b8
Merge pull request #4081 from xdustinface/pr-fix-issue-3521
backport: Some wallet related PRs
2021-04-07 00:38:41 +03:00
Wladimir J. van der Laan
d4ac6d62a9 Merge #14350: Add WalletLocation class
65f3672f3b82a6fa30e5171f85bc8d8a29e0797e wallet: Refactor to use WalletLocation (João Barbosa)
01a4c095c87500650663341533f000c6b613e9da wallet: Add WalletLocation utility class (João Barbosa)

Pull request description:

  Advantages of this change:
   - avoid resolving wallet absolute path and name repetitively and in multiple places;
   - avoid calling `GetWalletDir` in multiple places;
   - extract these details from the actual wallet implementation.

  The `WalletLocation` class can be a way to represent a wallet not yet loaded that exists in the wallet directory.

Tree-SHA512: 71ec09786e038499710e7acafe92d66ab9883fc894964e267443ae9c10a6872a10995c3987a169c436a4e793dae96b28fb97bd7f78483c4b72ac930fa23f8686
2021-04-05 03:31:50 +02:00
PastaPastaPasta
a72acc113d
Move net.h include from quorums_*.h into quorums.cpp (#4075)
* Remove net include from quorums-util.h

* circular depends -1

* include timedata.h in quorums_debug.cpp

* fix circular depends linter
2021-04-02 03:19:34 +02:00
PastaPastaPasta
7e71a54e54
trivial: various include adjustments (#4074)
* remove unused includes in validation.cpp

circular depends -2

* use more specific include in quorums.h

circular depends -1

* Remove unneeded include from quorums.cpp

circular depends -1
2021-03-31 16:02:22 -04:00
PastaPastaPasta
4a84c99bad
trivial: Remove unneeded include from quorums_instantsend.cpp (#4073)
* Remove unneeded include from quorums_instantsend.cpp

Signed-off-by: pasta <pasta@dashboost.org>

* circular depends -6
2021-03-31 16:01:59 -04:00
PastaPastaPasta
9d1c35438c
rely on stopRequested which is set when ShutdownRequested (#4069)
circular depends -1

Signed-off-by: pasta <pasta@dashboost.org>
2021-03-29 14:03:17 -04:00
PastaPastaPasta
f492291aca
refactor: llmq pretty trivial refactor circular dependancy (#4065)
* move DEFAULT_WATCH_QUORUMS to quorums.h

Signed-off-by: pasta <pasta@dashboost.org>

* resolve circular lint, -10, +4
2021-03-26 13:21:41 +01:00
UdjinM6
6bcc1bf0a3
backport bitcoin#13190: Have gArgs handle printing help 2021-03-19 18:00:24 +03:00
dustinface
ae506bae66
refactor: PrivateSend -> CoinJoin + Move the tab (#4038)
* qt|wallet|privatesend: Rename PrivateSend to CoinJoin in GUI strings

* qt: Move CoinJoin next to Transactions

* qt: Adjust status tip of privateSendCoinsMenuAction

Co-authored-by: thephez <thephez@users.noreply.github.com>

* rename: privateSend -> coinJoin

* rename: privatesend -> coinjoin

* rename: PrivateSend -> CoinJoin

* rename: use_ps -> use_cj

* rename: PRIVATESEND -> COINJOIN

* rename: privatesend -> coinjoin for files and folders

* refactor: Re-order coinjoin files in cmake/make files

* refactor: Re-order coinjoin includes where it makes sense

* test: Update lint-circular-dependencies.sh

* Few cleanups

* test: test/coinjoin_tests.cpp -> wallet/test/coinjoin_test.cpp

* s/AdvancedPSUI/AdvancedCJUI/g

* s/privateSentAmountChanged/coinJoinAmountChanged/g

* wallet: Rename "ps_salt" backwards compatible

* Minimal PrivateSend -> CoinJoin migration for settings and cmd-line

* wallet: Fix privatesendrounds -> coinjoinrounds migration

* qt: Migrate nPrivateSendAmount -> nCoinJoinAmount

* `-coinjoindenoms` never existed

* Migrate all PS options/settings

* rpc: Formatting only

* qt: Make Send/CoinJoin tabs a bit more distinguishable

Co-authored-by: thephez <thephez@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-03-17 18:36:11 -04:00
UdjinM6
8da57523b7
Make recently added help strings dynamic, add one missing string (#3996)
* docs: Add help for -recsigsmaxage option

* Make `-llmq-data-recovery` help string dynamic

* Make devnet/regtest specific help strings dynamic

Only show devnet related help strings on devnet.

* Make linter happy

* Skip FindDevNetGenesisBlock when creating devnet params for help purposes only
2021-02-23 01:46:40 +03:00
UdjinM6
e029f24c1c Fix some circular dependencies, update EXPECTED_CIRCULAR_DEPENDENCIES to make linter happy 2021-02-04 14:58:20 -06:00
Wladimir J. van der Laan
cd59867e7b Merge #13695: lint: Add linter for circular dependencies
5c613aadd64453c75cb2373c6fcc1326c3cf0b7a lint: Add linter for circular dependencies (Ben Woosley)

Pull request description:

  Protects against added circular depencies, makes it explicit in the
  code when circular dependencies have been removed.

  Modeled after EXPECTED_BOOST_INCLUDES in lint-includes.sh

  Example output:
  ```
  $ test/lint/lint-circular-dependencies.sh
  A new circular dependency in the form of "qt/paymentserver -> qt/walletmodel -> qt/paymentserver" appears to have been introduced.

  $ echo $?
  1
  $ test/lint/lint-circular-dependencies.sh
  Good job! The circular dependency "Fake" is no longer present.
  Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in test/lint/lint-circular-dependencies.sh
  to make sure this circular dependency is not accidentally reintroduced.

  $ echo $?
  1
  $ test/lint/lint-circular-dependencies.sh
  $ echo $?
  0

  ```

Tree-SHA512: 4519434de29f6d50859daed1480e531c01c1cdbc3f0a5f093251daf62ae2b5b9073fb274b86f541a985e06837aa1165b76558c5f35fb51a759d72e83f1b61e44
2021-02-04 14:58:13 -06:00
Wladimir J. van der Laan
be4345ce12
Merge #13510: Scripts and tools: Obsolete #!/bin/bash shebang
000000035b20402dea3e8168165cd4eefdc97539 Obsolete #!/bin/bash shebang (DesWurstes)

Pull request description:

  > `#!/bin/bash` assumes it is always installed to `/bin/` which can cause issues
  > `#!/usr/bin/env bash` searches the user's `PATH` to find the `bash` binary

  Details: https://github.com/dylanaraps/pure-bash-bible#obsolete-syntax

  I'm open to comments: Should I also fix `#!/bin/sh`?

Tree-SHA512: b47bb4828116aa119f1899c68fee081270d51a898535490b9c616bf0f3660ad953f29c361eafc759bc64cdd54ee6eeecb2d79e9fdb5291a996a515c719805476
2020-12-18 12:55:45 -06:00
UdjinM6
b559a8f904
Backporting Statoshi and bitcoin#16728 (#2515)
* Backport Statoshi

This backports some of https://github.com/jlopp/statoshi.

Missing stuff: README.md and client name changes, segwit and fee estimation stats.

Fix RejectCodeToString

Fix copy-paste mistake s/InvalidBlockFound/InvalidChainFound/

* Merge #16728: move-only: move coins statistics utils out of RPC

8a3b2eb17572ca2131778d52cc25ec359470a90f move-only: move coins statistics utils out of RPC (James O'Beirne)

Pull request description:

  This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11):

  Parent PR: #15606
  Issue: #15605
  Specification: https://github.com/jamesob/assumeutxo-docs/tree/master/proposal

  ---

  In the short-term, this move-only commit will help with fuzzing (https://github.com/bitcoin/bitcoin/pull/15606#issuecomment-524482297). Later, these procedures will be used to compute statistics (particularly a content hash) for UTXO sets coming in from snapshots.

  Most easily reviewed with `git ... --color-moved=dimmed_zebra`. A nice follow-up would be adding unittests, which I'll do if nobody else gets around to it.

ACKs for top commit:
  MarcoFalke:
    ACK 8a3b2eb17572ca2131778d52cc25ec359470a90f, checked --color-moved=dimmed-zebra

Tree-SHA512: a187d2f7590ad2450b8e8fa3d038c80a04fc3d903618c24222d7e3172250ce51badea35860c86101f2ba266eb4354e6efb8d7d508b353f29276e4665a1efdf74

* Fix 16728

* Modernize StatsdClient

- Reuse some functionality from netbase
- Switch from GetRand to FastRandomContext
- Drop `using namespace std` and add `// namespace statsd`

* Introduce PeriodicStats and make StatsdClient configurable via -stats<smth> (enabled/host/port/ns/period)

* Move/rename tip stats from CheckBlock to ConnectBlock

* Add new false positives to lint-format-strings.py

* Add snprintf in statsd_client to the list of known violations in lint-locale-dependence.sh

* Fix incorrect include guard

* Use bracket syntax includes

* Replace magic numbers with defaults

* Move connection stats calculation into its own function

And bail out early if stats are disabled

* assert in PeriodicStats

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2020-12-15 10:22:23 -06:00
MarcoFalke
7de10e4737
Merge #12284: Remove assigned but never used local variables. Enable Travis checking for unused local variables.
ea04bf7862 Enable flake8 warning F841 ("local variable 'foo' is assigned to but never used") (practicalswift)
169f3e8637 Remove assigned but never used local variables (practicalswift)

Pull request description:

  Remove assigned but never used local variables. Enable Travis checking for unused local variables.

Tree-SHA512: d6052ec9044c5d1f03d874ea3c8addd5a156779213ef9200f89d3ae53230f2fd1691aff405c3dae14178e5ef09912c4432e92f606ef4a5220ed9daa140cdee81
2020-10-26 20:35:28 -04:00
xdustinface
6088650438 test: Add boost/signals2/connection.hpp to lint-inlcudes.sh 2020-10-14 12:10:11 +01:00
UdjinM6
f7218d1899 Make shellcheck happy 2020-07-29 11:20:12 -05:00
UdjinM6
bdb479db4b Update lint-locale-dependence.sh 2020-07-29 11:06:10 -05:00
UdjinM6
2910bf0d49 Update lint-format-strings.py 2020-07-29 11:05:06 -05:00
practicalswift
2e7f07ebeb Fix warnings introduced in shellcheck v0.6.0 (Partial Merge: #15166) 2020-07-29 11:02:55 -05:00
MarcoFalke
27aef40091 Merge #15534: [test] lint-format-strings: open files sequentially (fix for OS X)
21be609b49 In lint-format-strings, open files sequentially (Glenn Willen)

Pull request description:

  In lint-format-strings, we use python argparse to read our file arguments. In
  this mode, argparse opens all the files simultaneously. On OS X, where the
  default filehandle limit is 128, this causes the lint to fail. Instead, ask
  argparse for our filename arguments as strings, and open them one at a time
  using 'with open'.

Tree-SHA512: 4c7dabf98818a7c5d83ab10c61b89a26957fe399e39e933e30c561cb45c5e8ba6f6aedcde8343da0c32ee340289a8897db6a33708e35ee381334ee27e3f4d356
2020-07-29 11:01:38 -05:00
MarcoFalke
481254c86d Merge #14115: lint: Make all linters work under the default macOS dev environment (build-osx.md)
341f7c7b0e macOS fix: Check for correct version of flake8 to avoid spurious warnings. The brew installed flake8 version is Python 2 based and does not work. (practicalswift)
908a559f33 macOS fix: Add excludes for checks added in the newer shellcheck version installed by brew (practicalswift)
ec4d57bbb3 macOS fix: Work around empty (sub)expression error when using BSD grep (practicalswift)
b57d7d92fe macOS fix: Avoid mapfile due to ancient version of bash shipped with macOS (practicalswift)

Pull request description:

  The linters are thoroughly tested under Ubuntu which is what we use in Travis. When reading #14041 I understood that some developers were experiencing problems when running the linters on their local machines.

  Assuming these local machines were running macOS I installed a fresh macOS VM, followed the instructions in `build-osx.md` and ran the linters.

  This PR contains the changes needed to make `lint-all.sh` run as expected.

  Ideally the linters would continuously run also under a Travis macOS environment to make sure we catch these kind of issues before merge.

Tree-SHA512: b39c9a970d14d27db1fb592539923c0bc676b5217f415d02fda3f17bf54d46faa172376e8a3ecab07ca68a3acba9aebe00b2b1b2161b2a36b85fbb672e7efb5c
2020-07-29 10:59:39 -05:00
Wladimir J. van der Laan
7be2b2456a Merge #13281: test: Move linters to test/lint, add readme
fa3c910bfeab00703c947c5200a64c21225b50ef test: Move linters to test/lint, add readme (MarcoFalke)

Pull request description:

  This moves the checks and linters from `devtools` to a subfolder in `test`. (Motivated by my opinion that the dev tools are mostly for generating code and updating the repo whereas the linters are read-only checks.)

  Also, adds a readme to clarify that checks and linters are only meant to prevent bugs and user facing issues, not merely stylistic preference or inconsistencies. (This is motivated by the diversity in developers and work flows as well as existing code styles. It would be too disruptive to change all existing code to a single style or too burdensome to force all developers to adhere to a single style. Also note that our style guide is changing, so locking in at the wrong style "too early" would only waste resources.)

Tree-SHA512: 9b10e89f2aeaf0c8a9ae248aa891d74e0abf0569f8e5dfd266446efa8bfaf19f0ea0980abf0b0b22f0d8416ee90d7435d21a9f9285b66df43f370b7979173406
2020-07-29 10:59:04 -05:00
Wladimir J. van der Laan
036125c9a5 Merge #13705: build: Add format string linter
bcd4b0f5cdde2a1b562a612c78ec1ef1fe47d3dd Add linting of WalletLogPrintf(...) format strings (practicalswift)
a3e455694901a887e0feef69bd63e3aa122ea44b build: Add format string linter (practicalswift)

Pull request description:

  Add format string linter.

  This linter checks that the number of arguments passed to each variadic format string function matches the number of format specifiers in the format string.

  Example output:

  ```
  $ test/lint/lint-format-strings.sh
  src/init.cpp: Expected 2 argument(s) after format string but found 1 argument(s):
    LogPrintf("We have a mismatch here: foo=%s bar=%d\n", foo)
  src/init.cpp: Expected 1 argument(s) after format string but found 2 argument(s):
    LogPrint(BCLog::RPC, "RPC stopped. This is a mismatch: %s\n", s1, s2)
  $ echo $?
  1
  ```

Tree-SHA512: 19ab844a63f04bf193d66682ca42745a1c7d6c454b30222491b9fe8dc047054c4a6d3ee7921ec0676fb9ca2e7f6f93bd6c97996fb09667269bd491cb875349f3
2020-07-28 21:35:31 -05:00
MarcoFalke
9a6c8277b6 Merge #13494: Follow-up to #13454: Fix broken build by exporting LC_ALL=C
7b23e6e13f Follow-up to #13454: Fix broken build by exporting LC_ALL=C (practicalswift)

Pull request description:

  Follow-up to #13454: Fix broken build by exporting `LC_ALL=C`.

Tree-SHA512: 5cca3182ba034dce28a0df5f4a4b343de6c2526048f17fee30e2f8d946e976b39d9cc54faae6c31bfe89022f9f4c360e9ec8e163a1690bc0656410a48bb81dbf
2020-07-28 21:35:31 -05:00
Wladimir J. van der Laan
cb5d0d8b99 Merge #13454: Make sure LC_ALL=C is set in all shell scripts
47776a958b08382d76d69b5df7beed807af168b3 Add linter: Make sure all shell scripts opt out of locale dependence using "export LC_ALL=C" (practicalswift)
3352da8da1243c03fc83ba678d2f5d193bd5a0c2 Add "export LC_ALL=C" to all shell scripts (practicalswift)

Pull request description:

  ~~Make sure `LC_ALL=C` is set when using `grep` range expressions.~~

  Make sure `LC_ALL=C` is set in all shell scripts.

  From the `grep(1)` documentation:

  > Within a bracket expression, a range expression consists of two characters separated by a hyphen. It matches any single character that sorts between the two characters, inclusive, using the locale's collating sequence and character set. For example, in the default C locale, `[a-d]` is equivalent to `[abcd]`. Many  locales sort characters in dictionary order, and in these locales `[a-d]` is typically not equivalent to `[abcd]`; it might be equivalent to `[aBbCcDd]`, for example. To obtain the traditional interpretation of bracket expressions, you can use the C locale by setting the `LC_ALL` environment variable to the value C.

  Context: [Locale issue found when reviewing #13450](https://github.com/bitcoin/bitcoin/pull/13450/files#r194877736)

Tree-SHA512: fd74d2612998f9b49ef9be24410e505d8c842716f84d085157fc7f9799d40e8a7b4969de783afcf99b7fae4f91bbb4559651f7dd6578a6a081a50bdea29f0909
2020-07-28 21:35:31 -05:00
Wladimir J. van der Laan
361d254524 Merge #13496: Test: Harden lint-filenames.sh
927e1150bc207181f7d5b0948e87d04b737a1c27 Test: Harden lint-filenames.sh (wodry)

Pull request description:

  - This fixes that only files with lower case file name suffix where found before, which contradicted the Regex to find uppercase characters in file names (including suffixes I guess).
  - `--full-name` switch was added to git ls-files, to define that the found file always includes it's full path in the git project.
  - since we know now that the file name includes the full path, we can harden the Regex to exclude the  secp256k1 and univalue sub folders.
  - use backslash line break to make code easier to read and avoid too long line.

Tree-SHA512: 9b55fe4965ae2084112b9f8a81bf9c657756c2cb5004986e7b6102a76adaf62c7d7a53257d9f13c5d8a1c75870b52c744d13830e3edd454a099e810357c914e5
2020-07-08 18:32:04 -05:00
Wladimir J. van der Laan
d1200755f1 Merge #13448: Add linter: Make sure we explicitly open all text files using UTF-8 encoding in Python
c8176b3cc7556d7bcec39a55ae4d6ba16453baaa Add linter: Make sure we explicitly open all text files using UTF-8 or ASCII encoding in Python (practicalswift)
634bd970013eca90f4b4c1f9044eec8c97ba62c2 Explicitly specify encoding when opening text files in Python code (practicalswift)

Pull request description:

  Add linter: Make sure we explicitly open all text files using UTF-8 encoding in Python.

  As requested by @laanwj in #13440.

Tree-SHA512: 1651c00fe220ceb273324abd6703aee504029b96c7ef0e3029145901762c733c9b9d24927da281394fd4681a5bff774336c04eed01fafea997bb32192c334c06
Signed-off-by: pasta <pasta@dashboost.org>

# Conflicts:
#	contrib/devtools/circular-dependencies.py
#	contrib/linearize/linearize-data.py
#	contrib/linearize/linearize-hashes.py
#	contrib/seeds/generate-seeds.py
#	contrib/verify-commits/verify-commits.py
#	test/functional/multiwallet.py
#	test/functional/notifications.py
#	test/functional/test_runner.py
#	test/util/rpcauth-test.py
2020-07-07 11:50:56 -05:00
MarcoFalke
fa3eed7af9 Merge #13450: Add linter: Enforce the source code file naming convention described in the developer notes
ad691f666b Add linter: Enforce the source code file naming convention described in the developer notes (practicalswift)

Pull request description:

  Add linter: Enforce the source code file naming convention described in the developer notes.

Tree-SHA512: 6458acf5383de7e81554bdd954c3a74c2bbf26286687ea69d934f11174d2f6bd573e8d2c16a7e77bbd12065e65be7700ecd7791d215f286e18f346bf964cd17d
2020-07-07 11:39:49 -05:00
Wladimir J. van der Laan
28b02f42e1 Merge #13041: build: Add linter checking for accidental introduction of locale dependence
698cfd081144845f6246171b8a2a0cfa8daaecdb docs: Mention lint-locale-dependence.sh in developer-notes.md (practicalswift)
0a4ea2f4589961868ab4d25e0277485c31938e20 build: Add linter for checking accidental locale dependence (practicalswift)

Pull request description:

  This linter will check for code accidentally introducing locale dependencies.

  Unnecessary locale dependence can cause bugs that are very tricky to isolate and fix. We should avoid using locale dependent functions if possible.

  Context: https://github.com/bitcoin/bitcoin/pull/12881#issuecomment-378564722

  Example output:

  ```
  $ contrib/devtools/lint-locale-dependence.sh
  The locale dependent function tolower(...) appears to be used:
  src/init.cpp:    if (s[0] == '0' && std::tolower(s[1]) == 'x') {

  Unnecessary locale dependence can cause bugs that are very
  tricky to isolate and fix. Please avoid using locale dependent
  functions if possible.

  Advice not applicable in this specific case? Add an exception
  by updating the ignore list in contrib/devtools/lint-locale-dependence.sh
  ```

  **Note to reviewers:** What is the most appropriate `LOCALE_DEPENDENT_FUNCTIONS` function list? What should be added or removed?

Tree-SHA512: 14e448828804bb02bf59070647e38b52fce120c700c903a4a8472769a2cee5dd529bd3fc182386993cb8720482cf4250b63a0a477db61b941ae4babe5c65025f
2020-07-01 20:12:03 -05:00