Commit graph

1021 commits

Author SHA1 Message Date
Jeff Frontz f44a0ebfff Ensure gitian-build.sh uses bash
If the user has some other login shell (e.g., ksh), the bashisms in gitian-build.sh don't work so well.
2018-05-29 15:55:24 +02:00
fanquake 93843f6891
doc: remove leftover check-doc documentation 2018-05-29 21:49:34 +08:00
Wladimir J. van der Laan 2ac6315f44
Merge #13281: test: Move linters to test/lint, add readme
fa3c910bfe 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
2018-05-29 15:45:48 +02:00
MarcoFalke fa3c910bfe
test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
MarcoFalke d792e47421
Merge #13228: Add script to detect circular dependencies between source modules
a7b295e91e Add circular dependencies script (Pieter Wuille)

Pull request description:

  This script finds dependencies between source code modules, treating the `.cpp` and `.h` file as one unit (so it will detect `A.cpp` depending on `B.h` where `B.cpp` depends on `A.h`). This can be used to find out which modules cannot be used independently from each other.

  It is very simplistic at this point, and assumes that a `.cpp` file's corresponding header has the exact same name, with `.cpp` replaced by `.h`. Furthermore, it assumes all `#include`s are relative to the `src/` directory.

  This is not a linter, and is not enforced through Travis or otherwise.

  This is the current output:

  ```
  $ ../contrib/devtools/circular-dependencies.py {*,*/*,*/*/*}.{h,cpp}
  Circular dependency: chain -> pow -> chain
  Circular dependency: chainparamsbase -> util -> chainparamsbase
  Circular dependency: checkpoints -> validation -> checkpoints
  Circular dependency: init -> index/txindex -> init
  Circular dependency: init -> validation -> init
  Circular dependency: init -> net_processing -> init
  Circular dependency: init -> rpc/server -> init
  Circular dependency: init -> txdb -> init
  Circular dependency: init -> validationinterface -> init
  Circular dependency: random -> util -> random
  Circular dependency: sync -> util -> sync
  Circular dependency: txmempool -> validation -> txmempool
  Circular dependency: txmempool -> policy/fees -> txmempool
  Circular dependency: validation -> index/txindex -> validation
  Circular dependency: validation -> policy/policy -> validation
  Circular dependency: validation -> validationinterface -> validation
  Circular dependency: qt/addresstablemodel -> qt/walletmodel -> qt/addresstablemodel
  Circular dependency: qt/bantablemodel -> qt/clientmodel -> qt/bantablemodel
  Circular dependency: qt/bitcoingui -> qt/walletview -> qt/bitcoingui
  Circular dependency: qt/bitcoingui -> qt/walletframe -> qt/bitcoingui
  Circular dependency: qt/bitcoingui -> qt/utilitydialog -> qt/bitcoingui
  Circular dependency: qt/clientmodel -> qt/peertablemodel -> qt/clientmodel
  Circular dependency: qt/paymentserver -> qt/walletmodel -> qt/paymentserver
  Circular dependency: qt/recentrequeststablemodel -> qt/walletmodel -> qt/recentrequeststablemodel
  Circular dependency: qt/sendcoinsdialog -> qt/walletmodel -> qt/sendcoinsdialog
  Circular dependency: qt/transactiontablemodel -> qt/walletmodel -> qt/transactiontablemodel
  Circular dependency: qt/walletmodel -> qt/walletmodeltransaction -> qt/walletmodel
  Circular dependency: rpc/rawtransaction -> wallet/rpcwallet -> rpc/rawtransaction
  Circular dependency: wallet/coincontrol -> wallet/wallet -> wallet/coincontrol
  Circular dependency: wallet/fees -> wallet/wallet -> wallet/fees
  Circular dependency: wallet/rpcwallet -> wallet/wallet -> wallet/rpcwallet
  Circular dependency: wallet/walletdb -> wallet/wallet -> wallet/walletdb
  Circular dependency: txmempool -> validation -> policy/rbf -> txmempool
  Circular dependency: txmempool -> validation -> validationinterface -> txmempool
  Circular dependency: qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/addressbookpage
  Circular dependency: qt/guiutil -> qt/walletmodel -> qt/optionsmodel -> qt/guiutil
  Circular dependency: qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/signverifymessagedialog -> qt/addressbookpage
  Circular dependency: qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/receivecoinsdialog -> qt/addressbookpage
  Circular dependency: qt/guiutil -> qt/walletmodel -> qt/optionsmodel -> qt/intro -> qt/guiutil
  Circular dependency: qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/sendcoinsdialog -> qt/sendcoinsentry -> qt/addressbookpage
  ```

Tree-SHA512: 29bc985b7a41699f4666b0aaa785ca63c2145e84c37458536f4dcf8e3de8f1312cf0323fe09cb8f348a9d363583f76eac2d5bee574bc6a9f9cc97a9b0aad406f
2018-05-18 12:52:20 -04:00
Pieter Wuille a7b295e91e Add circular dependencies script 2018-05-16 16:55:47 -07:00
Cristian Mircea Messel 73cd5b25b9 [gui] Add proxy icon in statusbar 2018-05-15 23:23:56 +03:00
practicalswift 506c5785fb Enable Travis checking for two Python linting rules we are currently not violating 2018-05-11 09:18:19 +02:00
John Bampton 0d31ef4762 Enable W191 and W291 flake8 checks.
Remove trailing whitespace from Python files.
Convert tabs to spaces.
2018-05-11 07:59:05 +10:00
Andrew Chow 4d4185a4f0 Make gArgs aware of the arguments
gArgs knows what the available arguments are and their help. Getting
the help message is moved to gArgs and HelpMessage() is removed
2018-05-09 12:21:05 -04:00
Wladimir J. van der Laan bf9b03ddcc
Merge #13094: tests: Add test for 64-bit Windows PE, modify 32-bit test results
ab3f4dd tests: Add test for 64-bit PE, modify 32-bit test results (Chun Kuan Lee)

Pull request description:

  9a75d29b6f change the error result from `PIE` to `DYNAMIC_BASE`. And there are no test for 64-bit, so I made one

Tree-SHA512: 9d5643dadf4d9fc34ea32d94655bfb98eec2f7bc2820b4b0f525d5acf1cd22f3acf38bf8904dda4f50fd9ca5a5e56d566a392e6f804eea6e50e03cba40048621
2018-05-07 15:14:43 +02:00
MarcoFalke 4b75dcf0ec devtools: Make linter check LogPrint calls 2018-05-02 15:14:37 +02:00
Wladimir J. van der Laan 1408d6cf76
Revert #12769: Add systemd service to bitcoind in debian package
After discussion with Matt on IRC, this is not ready for prime time
until 2019 and shouldn't have been ACKed and merged.

- Revert "Add systemd service for bitcoind"

This reverts commit 2a87b1b07c.

- Revert "Sync contrib/debian from Matt Corallo's PPA"

This reverts commit 9085532d35.

Tree-SHA512: 439f4ccc3e196011af448b220adf26b0e653ac589bf4cfbbc276c1500c9d08f209c9d6101e4d232857779d9f25164cfb222ed30e3d63de116f9121e6ebde31c3
2018-05-01 17:05:06 +02:00
Wladimir J. van der Laan 35eb9d6c88
Merge #12769: Add systemd service to bitcoind in debian package
2a87b1b Add systemd service for bitcoind (ctp-tsteenholdt)
9085532 Sync contrib/debian from Matt Corallo's PPA (ctp-tsteenholdt)

Pull request description:

  On suggestion from @TheBlueMatt I have updated `contrib/debian` files to include a systemd service in the `bitcoind` build. Tested and working on Ubuntu 16.04 and 17.10.

  This fixes Issue #12758

Tree-SHA512: b6137fafee940c7410df1242c8716a87f47c5bc60eb8df3ad0184a50c2d67ef3f2728761c742670a0ad546ab6e7ad60472a721350cd6280b3bcbdc582e50ee07
2018-05-01 16:52:57 +02:00
MarcoFalke fa85de9ff5
Remove script to clean up datadirs
This reverts commit 33c055c4f1. (#2295)
2018-04-29 18:33:25 -04:00
Chun Kuan Lee ab3f4dd27f tests: Add test for 64-bit PE, modify 32-bit test results
9a75d29b6f change the error result from `PIE` to `DYNAMIC_BASE`. And there are no test for 64-bit, so I made one
2018-04-27 01:34:05 +08:00
ctp-tsteenholdt 2a87b1b07c Add systemd service for bitcoind
Adding systemd service for bitcoind, to provide for a simpler
out-of-the-box experience.

Configuration file is /etc/bitcoin/bitcoin.conf. This file is a
copy of the sample configuration file.

The service user 'bitcoin' is added during install. Its homedir
is in '/var/lib/bitcoin'.

bitcoind.service is disabled by default to allow the user to
configure it, before starting it the first time.

On package purge, the 'bitcoin' user as well as its homedir is
left intact, to not accidentally remove a wallet or something of
equal importance. Instead the user is presented with information
on how to perform the cleanup manually, after making sure all
important data has been backed up.
2018-04-20 08:34:12 -02:00
ctp-tsteenholdt 9085532d35 Sync contrib/debian from Matt Corallo's PPA 2018-04-20 08:31:58 -02:00
MarcoFalke 07825088f9
Merge #12972: Add python3 script shebang lint
2bff472992 [contrib] convert test-security-check to python3 (John Newbery)
958bf40489 add lint tool to check python3 shebang (practicalswift)

Pull request description:

  base58.py can executed by python3

Tree-SHA512: 30511204feefd4ccd5b4bf698fb88e516633e692dc95d31fe957b1c0c4879de25906355b28a5a0522171887315c8464a611e601ff00540db172d5bd463ee13d9
2018-04-16 16:03:22 -04:00
practicalswift 643aad17fa Enable additional flake8 rules 2018-04-16 17:25:11 +02:00
practicalswift f020aca297 Minor Python cleanups to make flake8 pass with the new rules enabled 2018-04-16 17:25:11 +02:00
John Newbery 2bff472992 [contrib] convert test-security-check to python3 2018-04-14 02:13:42 +08:00
practicalswift 958bf40489 add lint tool to check python3 shebang 2018-04-14 02:13:24 +08:00
MarcoFalke 3cf76c23fb
Merge #12933: doc: Refine header include policy
fad0fc3c9a Refine travis check for duplicate includes (MarcoFalke)

Pull request description:

  Since there is no harm in having "duplicate" includes and it makes it obvious what are the dependencies of each file, without having to do static analysis or jumping between files, I'd suggest to revert the travis check for duplicate includes.

  Generally, I think that enforcing minor style preferences should not be done via travis. The cost of maintaining and the burden on other developers is too high. C.f discussion in https://github.com/bitcoin/bitcoin/pull/10973#discussion_r180142594

Tree-SHA512: 97ab0e769d457ccfb873fff6c99613f8b944cd7ef95bfdccb0e1bbe8f5df1f16548c658fa03af42516f806546e75646d338a061e7b057619490235d311ca21f1
2018-04-11 10:45:47 -04:00
practicalswift 1499fdc350 Add shell script linting: Check for shellcheck warnings in shell scripts 2018-04-11 15:41:18 +02:00
MarcoFalke fad0fc3c9a
Refine travis check for duplicate includes
This partially reverts commit c36b720d00.
2018-04-10 15:12:42 -04:00
Wladimir J. van der Laan 5ca1509d6a
Merge #12854: Add P2P, Network, and Qt categories to the desktop icon
b63f23c Add P2P, Network, and Qt categories to the desktop icon (Luke Dashjr)

Pull request description:

Tree-SHA512: 10526bfb4b559ce43b28c6c82fa615cd167162e5c487025ade51fb6b67389a65d8b43138228ced49d6d6cdc8ac87654a7b76673e92e7b43b5a09c81642d59145
2018-04-10 15:33:57 +02:00
Wladimir J. van der Laan ebd786b72a
Merge #12852: [doc] devtools: Setup ots git integration
fa385c3 [doc] devtools: Setup ots git integration (MarcoFalke)

Pull request description:

  Document the simple steps on how to set up ots git integration.

Tree-SHA512: 1b9f99bfaa6cd9dc581243d3a3584301645e95450acc3b5898dcdb53849569de16bb8ef2676b18f6b8dd402de10aee80119e15c1b28cef36f17ad121cbba2ba3
2018-04-10 15:29:10 +02:00
MarcoFalke fa385c3a8b
[doc] devtools: Setup ots git integration 2018-04-09 08:23:24 -04:00
practicalswift c36b720d00 Add Travis check for duplicate includes
This enforces parts of the project header include guidelines (added by @sipa in #10575).
2018-04-09 09:18:49 +02:00
Wladimir J. van der Laan 3190785c11
Merge #12891: [logging] add lint-logs.sh to check for newline termination.
d207207 [logging] add lint-logs.sh to check for newline termination. (John Newbery)
5c21e6c [logging] Comment all continuing logs. (John Newbery)

Pull request description:

  Check that all calls to LogPrintf() are terminated by a newline,
  except those that are explicitly marked as 'continued' logs.

Tree-SHA512: fe5162b2b2df1e8a4c807da87584fa9af97a6b8377e4090fe0caa136d90bf29a487a123cde94569bdce7101fee3478196d99aa13f1212e24bfe5f41c773604fc
2018-04-08 11:04:49 +02:00
Wladimir J. van der Laan d6f10b248a
Merge #12895: tests: Add note about test suite name uniqueness requirement to developer notes
d1b622b tests: Add check for test suite name uniqueness in lint-tests.sh (practicalswift)
dc8067b tests: Add note about uniqueness requirement for test suite names (practicalswift)
3ebfb2d tests: Avoid test suite name collision in wallet crypto_tests (MarcoFalke)

Pull request description:

  * Add documentation: Add note about test suite name uniqueness requirement in developer notes
  * Add regression test: Update `lint-tests.sh` to make it check also for test suite name uniqueness

  Context: #12894 (`tests: Avoid test suite name collision in wallet crypto_tests`)

Tree-SHA512: 3c8502db069ef3d753f534976a86a997b12bac539e808a7285193bf81c9dd8c1b06821c3dd1bdf870ab87722b02c8aa9574c62ace70c2a1b8091785cb8c9aace
2018-04-08 10:47:35 +02:00
Wladimir J. van der Laan b2e5fe8b55
Merge #12708: Make verify-commits.sh test that merges are clean
577f111 Make verify-commits.sh test that merges are clean (Pieter Wuille)

Pull request description:

  Unsure if we want this.

  This modifies verify-commits.sh to redo all merges along the leftmost commit branch (which includes all PR merges), and verify whether they match the merge commit's trees.

  The benefit is that it will detect a case where one of the maintainers merges a PR, but makes an unrelated change inside the merge commit. This on itself is not very strong, as unrelated changes can also be included in the merged branch itself - but perhaps the merge commit is not something that people are otherwise likely to look at.

  Fixes #8089

Tree-SHA512: 2c020f5ac3f771ac775aa726832916bb8e03a311b2745d7a9825047239bd0660d838f086f3456f2bb05cea14c1529f74436b8cdd74cc94b70e40b4617309f62c
2018-04-07 18:48:27 +02:00
John Newbery d207207fd3 [logging] add lint-logs.sh to check for newline termination.
Check that all calls to LogPrintf() are terminated by a newline,
except those that are explicitly marked as 'continued' logs.
2018-04-07 12:29:52 -04:00
practicalswift d1b622b5a2 tests: Add check for test suite name uniqueness in lint-tests.sh 2018-04-06 16:29:14 +02:00
Luke Dashjr b63f23c175 Add P2P, Network, and Qt categories to the desktop icon 2018-04-02 02:43:53 +00:00
MarcoFalke 0c5f67b8e5
Merge #12757: Clarify include guard naming convention
3bcc0059b8 Add lint-include-guards.sh which checks include guard consistency (practicalswift)
8fd6af89a0 Fix missing or inconsistent include guards (practicalswift)
8af65d96f4 Document include guard convention (practicalswift)

Pull request description:

  * **Documentation**: Document include guard convention
  * **Fix**: Fix missing or inconsistent include guards
  * **Regression test**: Add `lint-include-guards.sh` which checks include guard consistency

Tree-SHA512: 8171878f60fd08ccbea943a11e835195750592abb9d7ab74eaa4265ae7fac523b1da9d31ca13d6ab73dd596e49986bfb7593c696e5f39567c93e610165bc2acc
2018-04-01 18:30:21 -04:00
MarcoFalke 9beded5860
Merge #12719: tests: Add note about test suite naming convention in developer-notes.md
db983beba6 tests: Add lint-tests.sh which checks the test suite naming convention (practicalswift)
5fd864fe8a tests: Rename test suits not following the test suite naming convention (practicalswift)
7b4a296a71 tests: Add note about test suite naming convention (practicalswift)

Pull request description:

  Changes:
  * Add note about test suite naming convention
  * Fix exceptions
  * Add regression test

  Rationale:
  * Consistent naming of test suites makes programmatic test running of specific tests/subsets of tests easier
  * Explicit is better than implicit

  Before this commit:

  ```
  $ contrib/devtools/lint-tests.sh
  The test suite in file src/test/foo_tests.cpp should be named
  "foo_tests". Please make sure the following test suites follow
  that convention:

  src/test/blockchain_tests.cpp:BOOST_FIXTURE_TEST_SUITE(blockchain_difficulty_tests, BasicTestingSetup)
  src/test/prevector_tests.cpp:BOOST_FIXTURE_TEST_SUITE(PrevectorTests, TestingSetup)
  src/wallet/test/coinselector_tests.cpp:BOOST_FIXTURE_TEST_SUITE(coin_selection_tests, WalletTestingSetup)
  src/wallet/test/crypto_tests.cpp:BOOST_FIXTURE_TEST_SUITE(wallet_crypto, BasicTestingSetup)
  $
  ```

  After this commit:

  ```
  $ contrib/devtools/lint-tests.sh
  $
  ```

Tree-SHA512: 7258ab9a6b9b8fc1939efadc619e2f2f02cfce8034c7f2e5dc5ecc769aa12e17f6fb8e363817feaf15c026c5b958b2574525b8d2d3f6be69658679bf8ceea9e9
2018-04-01 18:28:22 -04:00
MarcoFalke fa5825d610
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
2018-04-01 18:24:30 -04:00
MarcoFalke 5e53b80b02
Merge #12820: contrib: Fix check-doc script regexes
0c17e27630 init: Remove help text for non-existent -fuzzmessagestest arg (MarcoFalke)
136084470c contrib: Fix check-doc script regexes (MarcoFalke)

Pull request description:

  Fixup the regexes to properly find all used args. The regex should now match all of the getter and setter methods of the `ArgsManager`. See https://dev.visucore.com/bitcoin/doxygen/class_args_manager.html#pub-methods

  Before:
  ```
  Args used        : 159
  Args documented  : 188
  Args undocumented: 0
  Args unknown     : 29
  ```

  After:
  ```
  Args used        : 183
  Args documented  : 188
  Args undocumented: 0
  Args unknown     : 5
  ```

Tree-SHA512: 1a7fb7ea55b2f6030358a1055d8f2c19b31f69d0603be0b009e6e603564014b4e2bb824357c9d43d0fba3ce7159b7c4e7eaa60b3f962053d94f73d0e626294fc
2018-03-30 11:40:16 -04:00
Wladimir J. van der Laan ff48f62671
Merge #12822: Revert 7deba93bdc and fix expired-key-sigs properly
9471576 [verify-commits] Add some additional useful documentation. (Matt Corallo)
de7e931 Add Marco-expired-key-signed-commits to allow-revsig-commits (Matt Corallo)
99f6d48 Revert "test: Update trust git root". (Matt Corallo)

Pull request description:

  7deba93bdc was took the wrong approach to updating verify-commits for a key expiration. Namely, adding each commit to allow-revsig-commits should have been done instead, allowing them to still be validated, but with the expired key.

Tree-SHA512: 9fdc67eda8f6daa95082f6c1a2af81beb730a9ff3f8cf930bb2311fe29b5f05e1f89259aba5f112153ca2e9c62577cf60d31b4c8e9ac1bf3f5506e78f8401378
2018-03-30 12:28:37 +02:00
Wladimir J. van der Laan 252c1b0fae
Merge #12829: Python3 fixup
f50975b [contrib] fixup symbol-check.py Python3 support (John Newbery)
5de2b18 [contrib] fixup security-check.py Python3 support (John Newbery)

Pull request description:

  security-check.py and symbol-check.py were broken by #11881. Fix them.

Tree-SHA512: 86de3d6dc3292b1ae4cc04c2d7d7dbbf39c9270551d7b224b8d8b19e3184c30c897dbf823200403706d06bb405c0decad5cfd690cb2c0312992a235a4ffcf6bf
2018-03-29 22:34:25 +02:00
practicalswift ea04bf7862 Enable flake8 warning F841 ("local variable 'foo' is assigned to but never used") 2018-03-29 18:21:03 +02:00
practicalswift 169f3e8637 Remove assigned but never used local variables 2018-03-29 17:47:12 +02:00
Matt Corallo 94715767a3 [verify-commits] Add some additional useful documentation. 2018-03-29 10:31:56 -04:00
John Newbery f50975b136 [contrib] fixup symbol-check.py Python3 support 2018-03-28 16:58:42 -04:00
John Newbery 5de2b18c67 [contrib] fixup security-check.py Python3 support 2018-03-28 15:46:54 -04:00
Matt Corallo de7e93138a Add Marco-expired-key-signed-commits to allow-revsig-commits 2018-03-28 14:55:50 -04:00
Matt Corallo 99f6d48e23 Revert "test: Update trust git root".
This reverts commit 7deba93bdc.

This is neither a "test" change, nor should the trusted-git-root
have been updated - there is a process for expired PGP keys.
2018-03-28 14:55:50 -04:00
MarcoFalke 05120ee755 contrib: Remove unused import string 2018-03-28 14:35:28 -04:00
MarcoFalke 136084470c contrib: Fix check-doc script regexes 2018-03-28 14:13:29 -04:00
Evan Klitzke 18740586ba Make base58 python contrib code work with python3 2018-03-28 09:20:42 -04:00
John Newbery bc6fdf2d15 Change all python files to use Python3 2018-03-26 16:49:33 -04:00
practicalswift 3bcc0059b8 Add lint-include-guards.sh which checks include guard consistency 2018-03-22 19:41:16 +01:00
practicalswift db983beba6 tests: Add lint-tests.sh which checks the test suite naming convention 2018-03-19 08:54:08 +01:00
Pieter Wuille 577f11141c Make verify-commits.sh test that merges are clean 2018-03-16 10:24:59 -07:00
Florian Schmaus 79ddfad486 Apply hardening measurements in bitcoind systemd service file
Adds typical systemd hardening measurements for network services.
2018-03-14 08:11:07 +01:00
MarcoFalke d8d9162f5b
Merge #12572: [script] lint-whitespace: find errors more easily
0fbed98e42 [script] lint-whitespace: improve print linenumber (Akio Nakamura)

Pull request description:

  Before this PR, the linenumber infomaition is output if trailing-space or tab code was found, but the output occurence is only per a file.
  This PR separates the output timing of file name and line number.
  As a result, users will find where they need to fix more easily.

  example:

  0) git diff
  ```
  diff --git a/dummy.txt b/dummy.txt
  index c0ce4d776..aebbdb88d 100644
  --- a/dummy.txt
  +++ b/dummy.txt
  @@ -1,2 +1,2 @@
  -1
  -2
  +1
  +       2
  @@ -8,2 +8,2 @@
  -8
  -9
  +       8
  +9
  ```

  1) before this PR - Is there "9 " in second line? It may lead to be misunderstood.
  ```
  This diff appears to have added new lines with trailing whitespace.
  The following changes were suspected:

  diff --git a/dummy.txt b/dummy.txt
  @@ -1,2 +1,2 @@
  +1
  +9
  ```

  2) after this PR
  ```
  This diff appears to have added new lines with trailing whitespace.
  The following changes were suspected:

  diff --git a/dummy.txt b/dummy.txt
  @@ -1,2 +1,2 @@
  +1
  @@ -8,2 +8,2 @@
  +9
  ```

Tree-SHA512: 2fd52e3c982786f86cfe10aa2578589bc9c502bcad9b85111467840d726143330c23968cde5483ee0f563893c8381044b80e8c22a7c8eca56fc73c548b9a9496
2018-03-11 17:30:04 -04:00
Karl-Johan Alm e690cf4b86
[gitian] Add kallewoof key for signing 2018-03-07 09:57:57 -05:00
Karl-Johan Alm 92fa6d2232
[gitian] Re-order keys by owner first name alphabetic order 2018-03-07 09:57:44 -05:00
Wladimir J. van der Laan 17c44b208f
Merge #12098: [scripts] lint-whitespace: add param to check last N commits
8dbf740f8 [scripts] lint-whitespace: check last N commits or unstaged changes (Sjors Provoost)

Pull request description:

  E.g. before you push three commits to Github and upset Travis, check if you didn't make any whitespace mistakes:
  ```sh
  contrib/devtools/lint-whitespace.sh 3
  ```

  This is slightly more convenient than doing:
  ```sh
  TRAVIS_COMMIT_RANGE=HEAD~3...HEAD contrib/devtools/lint-whitespace.sh
  ```

Tree-SHA512: 5d9c1ae978ccbe59477e8cf53391e9bd697d2da87f417a2519264af560d4768138e0b2d320dd497a1f1e704e18ab279d724f523b57c17a80ccd753133a5445bf
2018-03-06 23:17:26 +01:00
Wladimir J. van der Laan 14475e2dcd
Merge #12097: [scripts] lint-whitespace: use perl instead of grep -P
40b17f5f9 [scripts] lint-whitespace: use perl instead of grep -P (Sjors Provoost)

Pull request description:

  MacOS does not support `grep -P` out of the box. This change makes
  it easier for developers to check for whitespace problems locally.

  Based on [this](https://stackoverflow.com/a/16658690) and [this](https://serverfault.com/a/504387) Stack Exchange answer.

  Tested with:
  ```sh
  export TRAVIS_COMMIT_RANGE='fe78c9a...62e0453'
  contrib/devtools/lint-whitespace.sh
  This diff appears to have added new lines with tab characters instead of spaces.
  The following changes were suspected:

  diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp
  @@ -0,0 +1,110 @@
  +	num.setint64(n);
  ```

Tree-SHA512: 37c342a0ca2580289cf326a278a051a7c21ba918d6b2143fd9987f159fab85f1de3d770fcf532a642cd5d1957afc8595678128196e102dc473924758f133db7f
2018-03-06 23:09:40 +01:00
Wladimir J. van der Laan d74b01db0c
Merge #12588: [Utils] Remove deprecated PyZMQ call from Python ZMQ example
6058766de Remove deprecated PyZMQ call from Python ZMQ example (Michał Zabielski)

Pull request description:

  PyZMQ 17.0.0 has deprecated and removed zmq.asyncio.install() call
  with advice to use asyncio native run-loop instead of zmq specific.

  This caused exception when running the contrib/zmq/zmq_sub*.py examples.

  This commit simply follows the advice and fixes mentioned examples.

Tree-SHA512: af357aafa5eb9506cfa3f513f06979bbc49f6132fddc1e96fbcea175da4f8e2ea298be7c7055e7d3377f0814364e13bb88b5c195f6a07898cd28c341d23a93c5
2018-03-06 19:03:13 +01:00
Wladimir J. van der Laan 7deba93bdc
test: Update trust git root
Marco Falke's old key expired, causing a travis error while verifying
commits 36afd4db44 and before:

    gpg: Good signature from "Marco Falke <marco.falke@tum.de>" [unknown]
    gpg:                 aka "Marco Falke <falke.marco@gmail.com>" [unknown]
    gpg: Note: This key has expired!
    Primary key fingerprint: B8B3 F1C0 E58C 15DB 6A81  D30C 3648 A882 F431 6B9B
      Subkey fingerprint: FE09 B823 E6D8 3A3B C798  3EAA 2D7F 2372 E50F E137

Update the trusted root commit to the commit after that, to fix
this issue.

Tree-SHA512: 41e5913728099b131f73f8b4621cf6474d8914b2ffd524be8bac356426820f58016cc427fb32d043367688c8dbb60c26a7e34756589b61d0ba4ca3f8529a300f
2018-03-06 15:03:00 +01:00
Michał Zabielski 6058766de4 Remove deprecated PyZMQ call from Python ZMQ example
PyZMQ 17.0.0 has deprecated and removed zmq.asyncio.install() call
with advice to use asyncio native run-loop instead of zmq specific.

This caused exception when running the contrib/zmq/zmq_sub*.py examples.

This commit simply follows the advice.
2018-03-03 06:05:53 +01:00
Ken Lee 87c4320dfc gitian-build.sh: fix signProg being recognized as two parameters 2018-03-02 03:49:08 +08:00
Akio Nakamura 0fbed98e42 [script] lint-whitespace: improve print linenumber
Before this PR, the linenumber infomaition is output if trailing-space
or tab code was found, but the output occurence is only per a file.
This PR separates the output timing of file name and line number.
As a result, users will find where they need to fix more easily.
2018-03-01 16:03:38 +09:00
MarcoFalke dcfe218626
Merge #12308: contrib: Add support for out-of-tree builds in gen-manpages.sh
526e28220a contrib: Add support for out-of-tree builds in gen-manpages.sh (Wladimir J. van der Laan)

Pull request description:

  This adds support for setting the environment variable `BUILDDIR` to point to executables that are outside the source directory.

  E.g. to invoke the tool when the build is in $PWD/build:

  ```bash
  BUILDDIR=$PWD/build contrib/devtools/gen-manpages.sh
  ```

  This avoids having to manually copy the generated manpages after they end up in the build instead of source path, when setting TOPDIR instead.

Tree-SHA512: 8dc6dd7a47a0c014ae7d27f0ac9d86f69238ec6bac8a3007b975bb88c9f37014755c716c5e62604dd91baad2f8a41fd1544cdca3ba4b59bc76602e6593f4a4a7
2018-02-18 18:04:57 -05:00
Wladimir J. van der Laan 1f055ef9d7
Merge #12444: gitian: bump descriptors for (0.)17
d7f438a gitian: bump descriptors for (0.)17 (Cory Fields)

Pull request description:

  Bumping before we forget again. If we end up calling the next release 17.0, we'll have to fixup the descriptors anyway, so there's no harm in just doing the trivial bump now.

Tree-SHA512: f3401ec9f813132765280c60d47ae5d1697af5e6966a3798cb907dad10b7d76398032bf2a642a5a4de1055facec07a76a3055e0e9050cdab1d50caf32940e738
2018-02-16 09:06:55 +01:00
Cory Fields d7f438a026 gitian: bump descriptors for (0.)17 2018-02-15 17:29:39 -05:00
MarcoFalke fafbf7f74e
devtools: Exclude patches from lint-whitespace 2018-02-15 14:39:04 -05:00
Wladimir J. van der Laan 108af52ef7
Merge #12393: Fix a-vs-an typos
11376b5 Fix a-vs-an typos (practicalswift)

Pull request description:

  Fix a-vs-an typos.

Tree-SHA512: 2cf74c15656a20ec13d2da7d86a39d14e634db368833d92da06a78d1266950accfc4fcc89cfecdaadd46e6b48b17e6fad29080428e564871e78482c53f3e855c
2018-02-12 10:50:03 +01:00
practicalswift 11376b5583 Fix a-vs-an typos 2018-02-11 10:48:15 +01:00
Sjors Provoost 464015f6f1
[scripts] gitian-builder.sh: fix --setup doc, LXC is default 2018-02-09 10:57:10 +01:00
MarcoFalke 935eb8de03
Merge #12295: Enable flake8 warnings for all currently non-violated rules
a9d0ebc262 Enable flake8 warnings for all currently non-violated rules (practicalswift)
4cbab15e75 tests: Fix accidental redefinition of previously defined variable via list comprehension (practicalswift)
0b9207efbe Enable flake8 warning for "list comprehension redefines 'foo' from line N" (F812) (practicalswift)

Pull request description:

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

Tree-SHA512: 738b87789e99d02abb2c6b8ff58f65c0cbfeb93e3bf320763e033e510ebd0a4f72861bc8faaf42c14a056a5d4659c33dc70a63730a32cc15159559427bf21193
2018-02-08 09:52:07 -05:00
Wladimir J. van der Laan b264528674
Merge #12354: add gpg key for fivepiece
27736f2 add fivepiece key fingerprint (fivepiece)

Pull request description:

Tree-SHA512: 6b2b7ca22eb02338ac2e41e8ac577bd9401f771571531d3d4c473aacc544bd4304318e311cc50b7e84236bebd7a2fda9d4c16232fefe0de4291bbbc6959b4f4b
2018-02-08 13:51:13 +01:00
Akira Takizawa b947d3811c
Add gitian PGP key: akx20000 2018-02-07 07:18:23 +09:00
fivepiece 27736f22d5 add fivepiece key fingerprint 2018-02-06 18:14:48 +02:00
Wladimir J. van der Laan 88971352f6
Merge #11909: contrib: Replace developer keys with list of pgp fingerprints
fabb72b contrib: Remove xpired 522739F6 key (MarcoFalke)
faeab66 contrib: Replace developer keys with list of pgp fingerprints (MarcoFalke)

Pull request description:

  Having to host a copy of the keys in this repo was a common source of discussion and distraction, caused by problems such as:

  * Outdated keys. Unclear whether and when to replace by fresh copies.
  * Unclear when to add a key of a new developer or Gitian builder.

  The problems are solved by
  * Having no keys but only the fingerprints
  * Adding a rule of thumb, when to add a new key

  <strike>Moving the keys to a different repo solves none of these issues, but since the keys are not bound to releases or git branches of Bitcoin Core, they should live somewhere else.

  Obviously, all keys are hosted and distributed on key servers, but were added to the repo solely for convenience and redundancy.

  Moving the mirror of those keys to a different repo makes it less distracting to update them -- let's say -- prior to every major release.

  I updated our `doc/release-process.md` to reflect the new location.

  DEPENDS_ON https://github.com/bitcoin-core/gitian.sigs/pull/621
  </strike>

Tree-SHA512: c00795a07603190e26dc4526f6ce11e492fb048dc7ef54b38f859b77dcde25f58ec4449f5cf3f85a5e9c2dd2743bde53f7ff03c8eccf0d75d51784a6b164e47d
2018-02-06 15:54:29 +01:00
Wladimir J. van der Laan 526e28220a contrib: Add support for out-of-tree builds in gen-manpages.sh
This adds support for setting the environment variable `BUILDDIR`
to point to executables that are outside the source directory.

E.g. to invoke the tool when the build is in $PWD/build:

```bash
BUILDDIR=$PWD/build contrib/devtools/gen-manpages.sh
```
2018-01-31 11:27:36 +01:00
practicalswift a9d0ebc262 Enable flake8 warnings for all currently non-violated rules 2018-01-29 23:22:58 +01:00
practicalswift 0b9207efbe Enable flake8 warning for "list comprehension redefines 'foo' from line N" (F812) 2018-01-29 20:23:58 +01:00
Wladimir J. van der Laan 3fa1ab4368
Merge #12095: [contrib] Use BDB_LIBS/CFLAGS and pass --disable-replication
f3196a0 [contrib] Add --disable-replication to install_db4 (fanquake)
311a423 [contrib] Use BDB_LIBS/CFLAGS in install_db4 (fanquake)

Pull request description:

  Switch install_db4 to use BDB_LIBS/BDB_CFLAGS, mentioned [here](https://github.com/bitcoin/bitcoin/pull/12041/files#r159616003).

  Pass ```--disable-replication``` to configure to match what we do in [depends](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/bdb.mk#L9).

  Documentation about --disable-replication is available [here](https://docs.oracle.com/cd/E17275_01/html/programmer_reference/build_unix_small.html).

Tree-SHA512: 6f58728f27859614f499719583b0c2e8cd0ee89cb7e8fa34d1c54399877d6822ec2d8549c72ae4aff61daf7169bd330ad6ddc6c81e63008dedf028abd834f24c
2018-01-29 11:33:02 +01: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
Wladimir J. van der Laan 55f52bd280 contrib: Update ATTERN_AGENT to include 0.15.x 2018-01-24 17:30:46 +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
Matt Corallo 51ae7660b8 Use GetDesireableServiceFlags in static seeds, document this.
44407100f broke inserting entries into addrman from static seeds
(as well as dnsseeds which did not support service bits). 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, we will later fix by falling back to oneshot if a
seed does not support filtering.
2018-01-19 12:40:05 -10:00
Sjors Provoost 8dbf740f80
[scripts] lint-whitespace: check last N commits or unstaged changes
Get usage instructions:
.lint-whitespace.sh -?
2018-01-08 12:10:07 +01:00
Sjors Provoost 40b17f5f91
[scripts] lint-whitespace: use perl instead of grep -P
MacOS does not support 'grep -P' out of the box. This change makes
it easier for developers to check for whitespace problems locally.
2018-01-05 14:41:01 +01:00
fanquake f3196a03aa
[contrib] Add --disable-replication to install_db4 2018-01-05 08:37:22 +08:00
fanquake 311a423bd8
[contrib] Use BDB_LIBS/CFLAGS in install_db4 2018-01-05 08:36:42 +08:00
MarcoFalke 36a5a44048
Merge #12063: [Trivial] Update license year range to 2018
c9439e735a [Trivial] Update license year range to 2018 (Akira Takizawa)

Pull request description:

  The same as #9617.

  Happy new year! 😃

Tree-SHA512: 4b8fe343bf841da12157595bb51b59ac8e5cfa8ceb5910a499f26cff35c7ef8420dbf3ad8e5dd9f4225441e2fecff7fc6939f1a55f98ea51b57e420d326bda47
2018-01-04 03:13:13 -09:00
MarcoFalke c991b304de
Merge #12075: [scripts] Add missing univalue file to copyright_header.py
415f86c6ae [scripts] Add missing univalue file to copyright_header.py (fanquake)

Pull request description:

  This needs to be added so that PRs like #12062 don't modify the subtree.

Tree-SHA512: 3642bdb0c8271ae700857a79fa5800b0c26c4b3f126d4406f224293817fb74d498fa1fc581d576ae747fbbb6952d4369fc4ab823ab48fd0946c1e8ccbe93cee6
2018-01-03 06:03:03 -09:00
Akira Takizawa 595a7bab23 Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
fanquake 415f86c6ae
[scripts] Add missing univalue file to copyright_header.py 2018-01-02 10:20:50 +08:00
Akira Takizawa c9439e735a [Trivial] Update license year range to 2018 2018-01-01 04:33:09 +09:00
Wladimir J. van der Laan 7a11ba7e01
Merge #11945: Improve BSD compatibility of contrib/install_db4.sh
2712742 doc: Update FreeBSD build instructions to use bdb4 (Wladimir J. van der Laan)
d95c83d contrib: FreeBSD compatibility in install_db4.sh (Wladimir J. van der Laan)
c0298b0 contrib: Make X=Y arguments work in install_db4 (Wladimir J. van der Laan)
b798f9b contrib: New clang patch for install_db4 (Wladimir J. van der Laan)

Pull request description:

  This PR improves the BSD compatibility of the bdb4 installer script.

  See #11921, #11868.

  I've tested this on OpenBSD 6.2 (clang) and Ubuntu 16.04 (gcc).

  This needs testing on OSX at least, ~~and on gcc/Linux to make sure that applying the patch unconditionally doesn't negatively affect gcc~~.

  ~~NB: this is not yet sufficient to make `install_db4.sh` work on FreeBSD, as we need to use yet another `sha256` tool there. But it's a step in the right direction.~~

  ### contrib: New clang patch for install_db4

  Replace the clang patch with a new and improved version that also fixes the build issues with OpenBSD and FreeBSD's clang, and apply it unconditionally.

  Thanks to @fanquake for finding the patch.

  ### contrib: Make X=Y arguments work in install_db4

  Trailing X=Y arguments are supposed to be passed through unchanged to bdb's configure. This was not the case, at least with OpenBSD 6.2's shell.

  Fix this by not storing the arguments in a temporary variable but passing "$@" through directly.

  ### contrib: FreeBSD compatibility in install_db4.sh

  Unfortunately, FreeBSD uses yet another syntax for `sha256`.

  Support FreeBSD's syntax too. Using `uname` is a bit of a hack but it works and I found no way to distinguish the two.

Tree-SHA512: 12461a58dfeb4834701891762efc747c8187d834f41d98c8451edee1402a3958c4842bbc02c61bacbc7b0d90cc6b020a2ca158b65304d9760c9f0d2052ff36d4
2017-12-21 09:30:25 +01:00
Wladimir J. van der Laan 79399c8cd0
Merge #10657: Utils: Improvements to ECDSA key-handling code
63179d0 Scope the ECDSA constant sizes to CPubKey / CKey classes (Jack Grigg)
1ce9f0a Ensure that ECDSA constant sizes are correctly-sized (Jack Grigg)
48abe78 Remove redundant `= 0` initialisations (Jack Grigg)
17fa391 Specify ECDSA constant sizes as constants (Jack Grigg)
e4a1086 Update Debian copyright list (Jack Grigg)
e181dbe Add comments (Jack Grigg)
a3603ac Fix potential overflows in ECDSA DER parsers (Jack Grigg)

Pull request description:

  Mostly trivial, but includes fixes to potential overflows in the ECDSA DER parsers.

  Cherry-picked from Zcash PR https://github.com/zcash/zcash/pull/2335

Tree-SHA512: 8fcbd51b0bd6723e5d33fa5d592f7cb68ed182796a9b837ecc8217991ad69d6c970258617dc00eb378c8caa4cec5d6b304d9d2c066acd40cda98e4da68e0caa4
2017-12-20 18:00:32 +01:00
Wladimir J. van der Laan d95c83d193 contrib: FreeBSD compatibility in install_db4.sh
Unfortunately, FreeBSD uses yet another syntax for `sha256`.

Support FreeBSD's syntax too. Using `uname` is a bit of a hack but it
works and I found no way to distinguish the two.
2017-12-20 14:58:39 +01:00
MarcoFalke fabb72baa2 contrib: Remove xpired 522739F6 key 2017-12-19 07:18:57 -05:00
Wladimir J. van der Laan c0298b06e5 contrib: Make X=Y arguments work in install_db4
Trailing X=Y arguments are supposed to be passed through unchanged
to bdb's configure. This was not the case, at least with OpenBSD
6.2's shell.

Fix this by not storing the arguments in a temporary variable but
passing "$@" through directly.
2017-12-19 12:53:45 +01:00
Wladimir J. van der Laan b798f9bab9 contrib: New clang patch for install_db4
Replace the clang patch with a new and improved version that also fixes
the build issues with OpenBSD and FreeBSD's clang, and apply it
unconditionally.

This needs testing on OSX.
2017-12-19 12:53:34 +01:00
Wladimir J. van der Laan ce552b62e4
contrib: fix typo in install_db4.sh help message
It installs db4, not db5.
2017-12-19 10:00:25 +01:00
MarcoFalke faeab66f88 contrib: Replace developer keys with list of pgp fingerprints 2017-12-17 23:08:34 -05:00
Wladimir J. van der Laan d44535d818
Merge #11836: Rename rpcuser.py to rpcauth.py
3121d76 doc: Update release notes for share/rpcauth/rpcauth.py rename (Henrik Jonsson)
3fdb297 Rename rpcuser.py to rpcauth.py (Henrik Jonsson)

Pull request description:

  This script creates `rpcauth` entries for bitcoin.conf, not the deprecated `rpcuser` entry, so this changes the name of the script to match.

  As discussed in #11830.

Tree-SHA512: cd71c2a4043ef1381d3810b057cc83be3fac612df576b91b683ef91fdb7998c534b3b97a3313845eb867dc4bf7cc42a1250474d2261ab3f9ed2f884ca8ebd9f4
2017-12-11 17:59:01 +01:00
practicalswift d60b320740 Add Travis check for unused Python imports 2017-12-10 11:49:43 +01:00
Henrik Jonsson 3fdb29778a Rename rpcuser.py to rpcauth.py
This script creates `rpcauth` entries for bitcoin.conf,
not the deprecated `rpcuser` entry, so this changes the name
of the script to match.
2017-12-06 13:11:02 +00:00
Matt Corallo a38686cea0 [verify-commits] Fix gpg.sh's echoing for commits with '\n' 2017-12-05 15:21:23 -05:00
Pieter Wuille c17f11f7b4
Merge #10773: Shell script cleanups
13a81b19d Add quotes to variable assignment (as requested by @TheBlueMatt) (practicalswift)
683b9d280 Fix valid path output (practicalswift)
193c2fb4c Use bash instead of POSIX sh. POSIX sh does not support arrays. (practicalswift)
80f5f28d3 Fix incorrect quoting of quotes (the previous quotes had no effect beyond unquoting) (practicalswift)
564a172df Add required space to [[ -n "$1" ]] (previously [[ -n"$1" ]]) (practicalswift)
1e44ae0e1 Add error handling: exit if cd fails (practicalswift)
b9e79ab41 Remove "\n" from echo argument. echo does not support escape sequences. (practicalswift)
f6b3382fa Remove unused variables (practicalswift)

Pull request description:

  Shell script cleanups:
  * Add required space to `[ -n ]`.
  * Avoid quote within quote.
  * Exit if `cd` fails.
  * Remove `\n` which is not handled by `echo`.
  * ~~Remove redundant `$` in arithmetic variable expression.~~
  * ~~Use `$(command)` instead of legacy form `` `command` ``.~~
  * Arrays are not supported in POSIX `sh`. Use `bash` when arrays are used.
  * ~~`[ foo -a bar ]` is not well defined, use `[ foo ] && [ bar ]` instead.~~
  * ~~`[ foo -o bar ]` is not well defined, use `[ foo ] || [ bar ]` instead.~~

Tree-SHA512: 80f6ded58bce625b15b4da30d69d2714c633e184e62b21ed67d2c58e2ebaa08b4147593324012694d02bf4f1f252844cdff2fd1cf5e817ddb07e2777db7a6390
2017-12-04 15:52:11 -08:00
aaron-hanson 33698c94be Trivial: fix comments for ZeroMQ bitcoind args 2017-11-29 17:14:03 -06:00
Wladimir J. van der Laan 595ec11d80
Merge #11700: Add gitian PGP key: willyko
f88d900 Add gitian PGP key: willyko (Willy Ko)

Pull request description:

  First gitian sig: [https://github.com/bitcoin-core/gitian.sigs/pull/619](url)

Tree-SHA512: 3e6b017bd982a05d9a966948292b2d9a95e1bff6f28139a6a7545d63d7320f77d257fa0628c4fe28b39b8ae844be521dfb6224b1611e1e9d0fa49e7bceacb27c
2017-11-17 14:19:41 +01:00
James O'Beirne af9103eb75 [build] Add a script for installing db4
Instead of maintaining not-easily-tested instructions for building BerkeleyDB
in doc/build-unix.md, package the installation as a script in contrib/. This
allows shared usage from a number of contexts, e.g. Docker.

Thanks to @jonasschnelli, @laanwj for feedback.
2017-11-16 11:49:19 -08:00
Willy Ko f88d900354 Add gitian PGP key: willyko 2017-11-15 16:28:26 -08:00
Evan Klitzke b077fe908e fix the StartupWMClass for bitoin-qt, so gnome-shell can recognize it 2017-11-15 00:07:52 -08:00
MarcoFalke 5e468994fb
Merge #11676: contrib/init: Update openrc-run filename
2f041f0e7 contrib/init: Update openrc-run filename (Luke Dashjr)

Pull request description:

  OpenRC changed their program binary names in 2014 (3 years ago), and using the old names has loud warnings now

Tree-SHA512: 2b81802b21c32b8df6010142f9593c0b6cc814a052f83b7f5654f6885566e8dbcaf4da772145fa2cf5d94c16c2fb488c5d4879f71021407c4d7b3a3b7e7ed21e
2017-11-13 17:01:46 -05:00
Luke Dashjr 2f041f0e7d contrib/init: Update openrc-run filename
OpenRC changed their program binary names in 2014 (3 years ago), and using the old names has loud warnings now
2017-11-13 15:46:25 +00:00
Wladimir J. van der Laan 927e5280bd
Merge #11035: [contrib] Add Valgrind suppressions file
4a426d8 Add note about Valgrind suppressions file in developer-notes.md (practicalswift)
84e2462 contrib: Add Valgrind suppressions file (practicalswift)

Pull request description:

  Includes known Valgrind warnings in our dependencies that cannot be fixed in-tree.

  Example use:

  ```
  $ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin
  $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
        --show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite
  ```

  Running with the suppressions file under Ubuntu 16.04:

  ```
  $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full --show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite --run_test=wallet_crypto
  …
  ==10769== LEAK SUMMARY:
  ==10769==    definitely lost: 0 bytes in 0 blocks
  ==10769==    indirectly lost: 0 bytes in 0 blocks
  ==10769==      possibly lost: 0 bytes in 0 blocks
  ==10769==    still reachable: 0 bytes in 0 blocks
  ==10769==         suppressed: 72,704 bytes in 1 blocks
  ```

  Running without the suppressions file under Ubuntu 16.04:

  ```
  $ valgrind --leak-check=full --show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite --run_test=wallet_crypto
  …
  ==10724== 72,704 bytes in 1 blocks are still reachable in loss record 1 of 1
  ==10724==    at 0x4C2DBF6: malloc (vg_replace_malloc.c:299)
  ==10724==    by 0x6F74EFF: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
  ==10724==    by 0x40106B9: call_init.part.0 (dl-init.c:72)
  ==10724==    by 0x40107CA: call_init (dl-init.c:30)
  ==10724==    by 0x40107CA: _dl_init (dl-init.c:120)
  ==10724==    by 0x4000C69: ??? (in /lib/x86_64-linux-gnu/ld-2.23.so)
  ==10724==    by 0x2: ???
  ==10724==    by 0x1FFF0006D2: ???
  ==10724==    by 0x1FFF0006E8: ???
  ==10724==    by 0x1FFF0006FF: ???
  ==10724==
  ==10724== LEAK SUMMARY:
  ==10724==    definitely lost: 0 bytes in 0 blocks
  ==10724==    indirectly lost: 0 bytes in 0 blocks
  ==10724==      possibly lost: 0 bytes in 0 blocks
  ==10724==    still reachable: 72,704 bytes in 1 blocks
  ==10724==         suppressed: 0 bytes in 0 blocks
  ```

Tree-SHA512: 9c92079fc61313ea678deb6aaa16a3a71c3154c757459793eb9ca0d90a9a74c6faebfb04c9135e1b398ca34224fb7f03bd9c488ea0e8debf6894f69f030a31d3
2017-11-13 15:00:45 +01:00
MarcoFalke 6e4e98ee8c
Merge #11394: Perform a weaker subtree check in Travis
487aff421 Check subtree consistency in Travis (Pieter Wuille)
e1d0cc23a Improve git-subtree-check.sh (Pieter Wuille)

Pull request description:

  Apparently many of our subtrees get modified by PRs in this repository, without getting noticed.

  To improve upon this:
  * Make git-subtree-check.sh capable of doing a weaker consistency check (that doesn't need access to external repositories), but which should be sufficient to detect unintended changes. It can be fooled by a fake subtree merge commit, but that would hopefully be obvious to reviewers.
  * Make Travis invoke this subtree check for each of our subtrees.

  Note that Travis is currently expected to fail on this PR, as 2 out of 4 subtrees (`src/secp156k1` and `src/univalue` have been modified directly in master).

Tree-SHA512: 465b680392d3daf38a8c1dda77d6f74b1d1c23324c378774777fb95aa673e119a8f7e3ccc124e41d97b5ac8975f3d79f3015797d2d309666582394364917ec4e
2017-11-09 17:06:20 -05:00
MarcoFalke fa0025dc3c Revert "Remove unused variable in shell script"
This partially reverts commit ab8e8b97a3
2017-11-09 16:49:25 -05:00
Wladimir J. van der Laan 23e9074e0a
Merge #10771: Remove unused variables in shell scripts
ab8e8b9 Remove unused variables in shell scripts. (practicalswift)

Pull request description:

  Remove unused variables in shell scripts. Use `_` where we don't care about the result.

Tree-SHA512: 35049e79ee432c805f061456c32902a92811b5214d50ce6770b22d1442cc5999ed53cfe05bb2347f6995ca33c707a0f3fe92d5829c0385c4a3e254953924cbc4
2017-11-09 21:20:20 +01:00
Wladimir J. van der Laan 331352f99f
Merge #10529: Improve bitcoind systemd service file
16be7dd Improve bitcoind systemd service file (Florian Schmaus)

Pull request description:

  Add comment how further options can be added or existing ones
  modified. Use /run/${RuntimeDirectory} for PID file.

  Remove TimeoutStopSec, TimeoutStartSec, StartLimitInterval,
  StartLimitBurst directives as those should be set indivdually.

  Remove Group to user the bitcoin user's default group.

  Changed Restart from 'always' to 'on-failure' (can also be overwritten
  individually).

Tree-SHA512: f76674c11fd6e3faaf786aa05686926523d9c875aad6b776337f800108fdb716470286805c532b494f8cf713cb5eea6b735e1c7c238ffb407a5cc909dda41aa4
2017-11-09 13:17:05 +01:00
Sjors Provoost 41b15cfc9e
Add sjors gitian key 2017-11-04 20:35:06 +01:00
Matt Corallo d23be309c2 [verify-commits] Allow revoked keys to expire 2017-10-20 16:35:16 -04:00
practicalswift 13a81b19df Add quotes to variable assignment (as requested by @TheBlueMatt) 2017-10-18 17:10:23 +02:00
practicalswift 683b9d280b Fix valid path output 2017-10-18 17:10:23 +02:00
practicalswift 193c2fb4c8 Use bash instead of POSIX sh. POSIX sh does not support arrays. 2017-10-18 17:10:23 +02:00
practicalswift 80f5f28d38 Fix incorrect quoting of quotes (the previous quotes had no effect beyond unquoting) 2017-10-18 17:10:23 +02:00
practicalswift 564a172dfd Add required space to [[ -n "$1" ]] (previously [[ -n"$1" ]]) 2017-10-18 17:09:36 +02:00
practicalswift 1e44ae0e19 Add error handling: exit if cd fails 2017-10-18 17:09:36 +02:00
practicalswift b9e79ab415 Remove "\n" from echo argument. echo does not support escape sequences. 2017-10-18 17:09:36 +02:00
practicalswift f6b3382fa3 Remove unused variables 2017-10-18 17:09:36 +02:00
Pieter Wuille e1d0cc23a9 Improve git-subtree-check.sh
We have several pieces of information about subtrees:
1) What their current directory contents is
2) What their directory contents was at the time of the last subtree merge
3) What the directory contents of the upstream project is in the commit referred to by the subtree merge.

Normally, all 3 should be identical. git-subtree-check.sh so far only compared (1) with (3) however.

Fix this by comparing all three, and give some more useful diff output in the case of mismatch.

The added benefit is that (1) and (2) can be compared without needing to see the upstream repository.
2017-10-11 11:40:57 -07:00
practicalswift 0aacfa43c1 Remove accidental stray semicolon 2017-10-09 16:23:08 +02:00
Wladimir J. van der Laan a4c833fec1
Merge #11443: [qa] Allow "make cov" out-of-tree; Fix rpc mapping check
fae60e3 qa: Fix lcov for out-of-tree builds (MarcoFalke)
fae2673 qa: check-rpc-mapping must not run on empty lists (MarcoFalke)

Pull request description:

  Random qa fixups:

  * `make cov` should work for out-of-tree builds
  * `check-rpc-mappings.py` should assert that it is actually checking something and the lists are not empty.

Tree-SHA512: 2b66f69d6a1ae035c772f8ceb1d58dce904d98058330dad6ccb1421941e167aa748fe1c12126b87f43b0843f51fa85d89de079d586629fcaf8261c44a8dc6053
2017-10-04 14:26:03 +02:00
Jonas Schnelli 093074b843
Merge #11419: Utils: Fix launchctl not being able to stop bitcoind
ab5bba778 Fix launchctl not being able to stop bitcoind (Alejandro Avilés)

Pull request description:

  `bitcoind` should not be launched as daemon from the Launch Agent. Otherwise, the process cannot be stopped from `launchctl stop`/`launchctl unload`.

  To reproduce the issue:

  ```console
  $ launchctl load ~/Library/LaunchAgents/org.bitcoin.bitcoind.plist
  $ pgrep -fla bitcoin
  60225 /usr/local/opt/bitcoin/bin/bitcoind
  $ launchctl unload ~/Library/LaunchAgents/org.bitcoin.bitcoind.plist
  ```

  Wait a few seconds and then run `pgrep` again:

  ```console
  $ pgrep -fla bitcoin
  60225 /usr/local/opt/bitcoin/bin/bitcoind
  ```

  The node is still running. This happens because Launch Agent is not supposed to run programs as daemons, since the agent makes sure they run in the background. Running them as daemons makes the Launch Agent lose control of the process and, so, it cannot be stopped.

Tree-SHA512: 5342e1a858e478a226a1db292f1b8f8666bb252ee951753b131902c325ea3d47592cf245298decb423ac658a3175761b54dc2e7df6feea5343d65ba255613f67
2017-10-03 20:15:11 -07:00
MarcoFalke fae2673d5d qa: check-rpc-mapping must not run on empty lists 2017-10-01 16:46:56 +02:00
MarcoFalke 7632310515
Merge #11391: Remove lxcbr0 lines from gitian-build.sh
884913041 Remove lxcbr0 lines from gitian-build.sh (MeshCollider)

Pull request description:

  The `gitian-build.sh` script crashes with an error when I tried to use it, @kallewoof also had this same issue:

  	lxcbr0: ERROR while getting interface flags: No such device
  	SIOCSIFADDR: No such device
  	lxcbr0: ERROR while getting interface flags: No such device

  And then:

  	lxc-execute: failed to find gateway addresses
  	lxc-execute: failed to spawn 'gitian'
  	./bin/gbuild:21:in `system!': failed to run make-clean-vm --suite trusty --arch amd64 (RuntimeError)

  I believe it's because of the two lines which this PR removes, I tested it and seems to work as expected now. These lines are unique to this script and aren't mentioned in `gitian-building.md` or `release-process.md`. We discussed it on IRC, @achow101 agrees removing these lines would probably fix it: https://botbot.me/freenode/bitcoin-core-dev/2017-09-19/?msg=91299782&page=2

  Has anyone successfully used this script as-is? Or does everyone else manually run the builds/write their own script like I have up til this point?

Tree-SHA512: 0cffd3df307ad107fb1d4bae45094fc5002b56c2fe64f03642d968659fdc62f586ba249dbc540b69058b276f2456962e5bc4d665cab21ef1f561735eb78afcc2
2017-09-30 10:10:46 +02:00
Alejandro Avilés ab5bba7783 Fix launchctl not being able to stop bitcoind
bitcoind should not be launched as daemon from launchctl. Otherwise, the
process cannot be stopped from launchctl.
2017-09-29 10:54:10 +02:00
fanquake bb174e19bc
[docs] Remove partial gitian instructions from descriptors dir 2017-09-28 21:07:36 +08:00
MeshCollider 8849130415 Remove lxcbr0 lines from gitian-build.sh 2017-09-24 14:00:26 +13:00
Wladimir J. van der Laan 96d91b79bd
contrib: Ignore historical release notes for whitespace check
Lint checks should not test these, they are historical documents,
and we don't want to encourage silly changes to them to satisfy
a checker.

Hopefully makes travis pass again on master.

Tree-SHA512: 37e6716c4fd5e8a4e579f9b84042e6b0ac224836b6c851cd1ca3f7d46611ffd3003bed0ae08dd0457f69d6eaa485a0d21c631e7ef16b14bdb0f2f78ea700332d
2017-09-14 16:21:09 +02:00
MeshCollider 1f379b1f06 Add tab char lint check and exclude imported dependencies 2017-09-14 11:38:31 +12:00
Evan Klitzke dd365612fd Add a lint check for trailing whitespace.
This adds a new CHECK_DOC check that looks for newly introduced trailing
whitespace. Existing trailing whitespace (of which there is plenty!)
will not trigger an error.

This is written in a generic way so that new lint-*.sh scripts can be
added to contrib/devtools/, as I'd like to contribute additional lint
checks in the future.
2017-09-14 10:49:48 +12:00
MarcoFalke 7fcd61b261
Merge #10753: test: Check RPC argument mapping
77aa9e59e test: Check RPC argument mapping (Wladimir J. van der Laan)

Pull request description:

  Parse the dispatch tables from the server implementation files, and the conversion table from the client (see #10751).

  Perform the following consistency checks:

  - Arguments defined in conversion table, must be present in dispatch table. If not, it was probably forgotten to add them to the dispatch table, and they will not work.

  - Arguments defined in conversion table must have the same names as in the dispatch table. If not, they will not work.

  - All aliases for an argument must either be present in the conversion table, or not. Anything in between means an oversight and some aliases won't work.

  Any of these results in an error.

  It also performs a consistency check to see if the same named argument is sometimes converted, and sometimes not. E.g. one RPC call might have a 'verbose' argument that is converted,
  another RPC call might have one that is not converted. This is not necessarily wrong, but points at a possible error (as well as makes the API harder to memorize) - so it is emitted as a warning (could upgrade this to error).

  This test is added to travis and run when `CHECK_DOC`. Currently fails with the following output:
  ```
  * Checking consistency between dispatch tables and vRPCConvertParams
  ERROR: createrawtransaction argument 3 (named optintorbf in vRPCConvertParams) is not defined in dispatch table
  ERROR: getblock argument ['verbosity', 'verbose'] has conflicts in vRPCConvertParams conversion specifier [True, False]
  WARNING: conversion mismatch for argument named verbose ([('getblock', False), ('getblockheader', True), ('getmempoolancestors', True), ('getmempooldescendants', True), ('getrawmempool', True), ('getrawtransaction', True)])
  ```
  - ~#10698 fixes the first ERROR~
  - #10747 fixes the second ERROR, as well as the WARNING

  Update: #10698 was merged, leaving:
  ```
  * Checking consistency between dispatch tables and vRPCConvertParams
  ERROR: getblock argument ['verbosity', 'verbose'] has conflicts in vRPCConvertParams conversion specifier [True, False]
  WARNING: conversion mismatch for argument named verbose ([('getblock', False), ('getblockheader', True), ('getmempoolancestors', True), ('getmempooldescendants', True), ('getrawmempool', True), ('getrawtransaction', True)])
  ```

Tree-SHA512: feabebfbeda5d4613b2b9d5265aa6bde4e1a0235297ffd48fa415ad7edc531d9ed7913fe76d191ac60d481a915a326f216bc93de3c671e45e1d14e97d07dea7a
2017-09-13 20:16:59 +02:00
MeshCollider 7d03418aea Add -usehd to excluded args in check-doc.py 2017-09-08 19:21:52 +12:00
Wladimir J. van der Laan 77aa9e59ea test: Check RPC argument mapping
Parse the dispatch tables from the server implementation files,
and the conversion table from the client.

Perform the following consistency checks:

- Arguments defined in conversion table, must be present in dispatch
  table. If not, it was probably forgotten to add them to the
  dispatch table, and they will not work.

- Arguments defined in conversion table must have the same names as
  in the dispatch table. If not, they will not work.

- All aliases for an argument must either be present in the
  conversion table, or not. Anything in between means an oversight
  and some aliases won't work.

Any of these results in an error.

It also performs a consistency check to see if the same
named argument is sometimes converted, and sometimes not. E.g.
one RPC call might have a 'verbose' argument that is converted,
another RPC call might have one that is not converted. This is not
necessarily wrong, but points at a possible error (as well as
makes the API harder to memorize) - so it is emitted as a warning
(could upgrade this to error).
2017-09-07 22:34:18 +02:00
Wladimir J. van der Laan 28485c783d
Merge #10825: net: set regtest JSON-RPC port to 18443 to avoid conflict with testnet 18332
ce3baa193 changed regtest RPCport to 18443 to avoid conflict with testnet 18332 (Ferdinando M. Ametrano)

Pull request description:

  using the same JSON-RPC default port for both testnet and regtest prevents running both at the same time on the same machine. Since RPCport=P2Pport-1 for both mainnet and testnet, and regtest P2Pport being 18444, 18443 is proposed for regtest RPCport

  Documentation has been updated (or created where missing); manpages doc/man/bitcoin*.1 could include information for regtest too

Tree-SHA512: d42185f7ef54dc918ece19b543c8681d08bb9c5a971394e21f2d9a1091734b091b08df69fab622c207b46f402cf9323ded5b7a33fbd0af722388930169124e7f
2017-09-06 01:18:35 +02:00
Wladimir J. van der Laan dabee00ef1 github-merge: Coalesce git fetches
Fetch the destination branch as well as PR in one go. Saves a few
seconds (as well as one ssh authentication, when using a yubikey) when
using github-merge.py.
2017-09-05 23:32:09 +02:00
practicalswift 9b94054b7c Avoid reference to undefined name: stderr does not exist, sys.stderr does 2017-08-28 15:18:14 +02:00
practicalswift 51cb6b8221 Use print(...) instead of undefined printf(...) 2017-08-28 15:18:14 +02:00