Commit graph

15868 commits

Author SHA1 Message Date
Wladimir J. van der Laan
dcfef277b4 cli: Reject arguments to -getinfo
Currently it's possible to accidentally type e.g.

    bitcoin-cli -getinfo getbalance

and get an answer which can be confusing; the trialing arguments are
just ignored.

To avoid this, throw an error if the user provides arguments to
`-getinfo`.
2017-11-17 15:11:50 +01:00
Wladimir J. van der Laan
5197100704
Merge #11706: Make default issue text all comments to make issues more readable
e89adba Make default issue text all comments to make issues more readable (Matt Corallo)

Pull request description:

Tree-SHA512: d0a657664e3defd9ace6ce167d593affce6f881f9ae547d53af36a90caa5cf206b00a2cc2e3622ba2c69c71302ec4a29b84612fc91d4ebd94907b4e4926de44d
2017-11-17 15:00:52 +01:00
Wladimir J. van der Laan
ea68190132
Merge #11704: Windows build doc update
1cecea7 doc: Specify required source location for Windows WSL builds (Aaron Clauson)

Tree-SHA512: 6c5bb7f953a4399e1f99da865086a3d5196e7eb0df226f1ec08bde5b9a68bfe8934f45a5dc011623adb607aab7ac79fa8b48ed09f6fec4494179938d9951080e
2017-11-17 14:32:00 +01:00
Aaron Clauson
1cecea71ad doc: Specify required source location for Windows WSL builds
- Added steps to specify required source location for Windows WSL
  builds.
- Attempted to make the introduction and options for building on Windows
  clearer.
2017-11-17 14:31:05 +01: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
Wladimir J. van der Laan
1f7695b419
Merge #11621: [build] Add temp_bitcoin_locale_qrc to CLEAN_QT to fix make distcheck
a7c949f [build] Add temp_bitcoin_locale_qrc to CLEAN_QT to fix make distcheck (fanquake)

Pull request description:

  Fixes #11302

  Tested on OS X 10.12.6 with 0e707919f5

  Was failing like:
  ```
  make distclean
  ....
  rm -f config.status config.cache config.log configure.lineno config.status.lineno
  rm -f Makefile
  ERROR: files left in build directory after distclean:
  ./src/qt/temp_bitcoin_locale.qrc
  make[1]: *** [distcleancheck] Error 1
  make: *** [distcheck] Error 1
  ```

Tree-SHA512: 291c786f20a82e648fdee2bcbc654d93d9abeb7d996ae7706d304697d4952709a0ec5d3aa88d1214f22cfe81ced88f10c187929904eecd60f2165b696727dd88
2017-11-17 14:04:02 +01:00
Wladimir J. van der Laan
ccc70a295f
Merge #11648: [tests] Add messages.py
1135c79 [tests] Tidy up mininode.py module (John Newbery)
f9cd9b1 [tests] Move test_framework Bitcoin primitives into separate module (John Newbery)

Pull request description:

  Second part of #11518.

  Moves the primitive Bitcoin datastructures and message classes into their own module, and tidies up the mininode.py module.

  - First commit is almost entirely move-only
  - Second commit is mostly move-only, but also does a little tidying.

Tree-SHA512: 5d74802677f1ab788e43188653106a96fffd9ab1fe3aa6a4eb94e5807de5dd5c8ee212296f45e8d16c7e3d95cfc4891677e812b7944bd3ab604e04b3b88aa06e
2017-11-17 13:16:40 +01:00
Wladimir J. van der Laan
f6f8d54aff
Merge #10920: [qt] Fix potential memory leak in newPossibleKey(ChangeCWallet *wallet)
446e261 [qt] Fix potential memory leak in newPossibleKey(ChangeCWallet *wallet) (practicalswift)

Pull request description:

  Fix potential memory leak in `newPossibleKey(ChangeCWallet *wallet)`.

Tree-SHA512: 252d3828133a0d241cc649aed1280e14a5d5ea47b7b2989039cfa5061a8e35183c7f36d7320aa0ac1b4dcab31e584b358dbbb2fe645a412371d0a460878e2b58
2017-11-17 13:07:37 +01:00
MeshCollider
c1e5d40e16 Make debugging test crash easier 2017-11-18 00:51:00 +13:00
MeshCollider
8263f6a5ac Create walletdir if datadir doesn't exist and fix tests 2017-11-18 00:50:59 +13:00
MeshCollider
9587a9c12b Default walletdir is wallets/ if it exists 2017-11-18 00:50:59 +13:00
MeshCollider
d9878890e4 Add release notes for -walletdir and wallets/ dir 2017-11-18 00:50:58 +13:00
MeshCollider
80c5cbc14f Add test for -walletdir 2017-11-18 00:50:58 +13:00
MeshCollider
0530ba0eae Add -walletdir parameter to specify custom wallet dir 2017-11-18 00:50:58 +13:00
Wladimir J. van der Laan
41221126c8
Merge #11702: [build] Add a script for installing db4
6e4cdd6 [docs] Add reference to install_db4.sh in OS X build instructions (James O'Beirne)
af9103e [build] Add a script for installing db4 (James O'Beirne)

Pull request description:

  Instead of maintaining rote instructions for building BerkeleyDB in `doc/build-{unix,openbsd}.md`, reference a script that does the same thing and can be called from unanticipated contexts, e.g. Docker builds.

  The script was written with portability in mind, though I haven't tested it on openbsd.

  I wasn't sure if we wanted to create a separate directory for this sort of thing (e.g. `contrib/install`) so I just stuck it in `contrib/`; happy to move it around if anyone has another preference.

Tree-SHA512: d2fc83c065d083458c448e6041e5e9ef67f8165974925560a83881d22d1e9448ea3dd4f7a38196800a8cd6dcf206208a2d6d12417bfe094902d4754e4ca67f18
2017-11-17 12:45:00 +01:00
practicalswift
a720b928c8 Remove includes in .cpp files for things the corresponding .h file already included 2017-11-16 22:26:34 +01:00
James O'Beirne
6e4cdd67b1 [docs] Add reference to install_db4.sh in OS X build instructions 2017-11-16 11:49:34 -08: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
John Newbery
f0c4ab9a70 [tests] fix flakiness in sendheaders.py
Fixes to sources of intermittent failure in sendheaders.py

- at the start of test_null_locators(), a new block is generated and
then a getheaders is sent. check_last_accouncement() is called to assert
that the headers message is received. However, the new block triggers an
inv to be sent over both P2P connections, so there's a race. If the inv
is received at the wrong time, the test fails.

- test_null_locators() ends by sending a block to the node under test.
At the start of test_nonnull_locators(), a block is mined and
check_last_announcement() is called to assert that the inv received is
for the same block. That means there's a race: if the inv from the block
sent in test_null_locators() is received at the wrong time, the test
fails.
2017-11-16 13:45:46 -05:00
John Newbery
25fd6e2c20 [tests] refactor check_last_announcement() in sendheaders.py
All calls of check_last_announcement() asserted that the return
value was True. Just assert inside the function instead. This
gives better debug information if the assert fails.

Also only check the contents of the most recent inv and header if
check_last_announcement() is called with the relevant argument.
2017-11-16 12:05:27 -05:00
John Newbery
f39d4bbd1e [tests] tidy up BaseNode in sendheaders.py 2017-11-16 11:58:01 -05:00
Matt Corallo
e89adbac93 Make default issue text all comments to make issues more readable 2017-11-16 11:50:56 -05:00
John Newbery
2613c545f5 [tests] fix flake8 warnings in sendheaders.py 2017-11-16 09:53:35 -05:00
Wladimir J. van der Laan
99bc0b428b
Merge #11087: Diagnose unsuitable outputs in lockunspent().
28f8b66 Diagnose unsuitable outputs in lockunspent(). (Eelis)

Pull request description:

  Fixes #2667.

  This is a simplified version of pull request #3574, which was abandoned by its author.

  I added some tests as well.

Tree-SHA512: e63e00dec8b1b232079380183805cb0b0b18c78ea6bea769837949aab984689d7f68b2ccfe66b1873517b040b9e616ce0eb058575c3d4382aa8c26eebcf1f14e
2017-11-16 12:24:05 +01:00
Wladimir J. van der Laan
084f52f38d
Merge #11654: tests: Initialize recently introduced non-static class member lastCycles to zero in constructor
069215e Initialize recently introduced non-static class member lastCycles to zero in constructor (practicalswift)

Pull request description:

  Initialize recently introduced non-static class member `lastCycles` to zero in constructor.

  `lastCycles` was introduced in 3532818746 which was merged into master yesterday.

  Friendly ping  @laanwj :-)

Tree-SHA512: cb93b6a8f6e2e3b06cd05a635da95c84f3df64c21fc23fe82f98306ea571badc32040315b563e46ddb5203128226bc334269acd497beead5a5777c434060fd85
2017-11-16 11:49:42 +01:00
Wladimir J. van der Laan
66d46c7901
Merge #11699: [travis-ci] Only run linters on Pull Requests
ec85248 [travis-ci] Only run linters on Pull Requests (John Newbery)

Pull request description:

  Linters should only be run on pull request builds. Once bad code style
  has been merged into master, it's too late. Master and other branches
  should not fail to build because of linter warnings.

Tree-SHA512: f8e56e0c338db60110a67bdd39a5837b42e156180349a81a68a383a5adef07ecf7b4946c1565333b47edd2b1a70e52caf0600bdf448f6eb01fa47595e8df82c9
2017-11-16 11:48:44 +01:00
Wladimir J. van der Laan
3c098a8aa0
Merge #11651: refactor: Make all #includes relative to project root (laanwj, MeshCollider, ryanofsky)
7b91b5f Remove trailing whitespace causing travis failure (MeshCollider)
434f5a2 Recommend #include<> syntax in developer notes (Russell Yanofsky)
96b9281 refactor: Include obj/build.h instead of build.h (Wladimir J. van der Laan)
138016b test: refactor: Use absolute include paths for test data files (Wladimir J. van der Laan)
e7b3163 qt: refactor: Changes to make include paths absolute (Wladimir J. van der Laan)
0c71521 build: Remove -I for everything but project root (Wladimir J. van der Laan)
5b56ec9 qt: refactor: Use absolute include paths in .ui files (Wladimir J. van der Laan)
1a44534 scripted-diff: Replace #include "" with #include <> (ryanofsky) (MeshCollider)

Pull request description:

  Rebase of #11053

  Previously started by @laanwj, ACK'ed by promag, ryanofsky, jonasschnelli, and concept-ACK'ed by practicalswift and jnewbery. Thus should be almost RTM :)

Tree-SHA512: d8d25248309deb06a54686c4a6bafd290ba69dcd0df391a50d1caed2c22ff2659be442459bdd9d1fc3b6a1360ba0804a907b1402d206df3e1cb6e8924e3c7f3e
2017-11-16 09:33:10 +01:00
Willy Ko
f88d900354 Add gitian PGP key: willyko 2017-11-15 16:28:26 -08:00
MarcoFalke
54aedc0137
Merge #11686: Make ISSUE_TEMPLATE a bit shorter, mention hardware tests
ea3f363aa Make ISSUE_TEMPLATE a bit shorter, mention hardware tests (Matt Corallo)

Pull request description:

  Kinda getting tired of "block checksum mismatch error" issues on RPis that dont even have heatsinks...Also a shorter issue template might encourage people to actually read it.

Tree-SHA512: 943a286f6ea5c4f837a8dc3906342e1e428cf788d05ba9110f8005400d9775ae6f9cf3ce31ada201f5f7b95a6101314f2cb93f49dd92e242fbcea00aaae9e6e6
2017-11-15 17:41:20 -05:00
John Newbery
ec85248c48 [travis-ci] Only run linters on Pull Requests
Linters should only be run on pull request builds. Once bad code style
has been merged into master, it's too late. Master and other branches
should not fail to build because of linter warnings.
2017-11-15 17:20:07 -05:00
MarcoFalke
f0c1f8abb0
Merge #11690: [trivial] Fix the StartupWMClass for bitoin-qt, so gnome-shell can recognize it
b077fe908 fix the StartupWMClass for bitoin-qt, so gnome-shell can recognize it (Evan Klitzke)

Pull request description:

  I spent some time trying to figure out how to get the provided `.desktop` file to work correctly in GNOME. When a non-absolute path is used in the desktop file, you need to specify `StartupWMClass` in order for gnome-shell to know that a running application matches one in its desktop database. I also set a version and removed the deprecated `Encoding` field. With these changes, the desktop file passes `desktop-file-validate` cleanly.

  P.S. I found this while working on a new spec file for Bitcoin, which you can find here: https://github.com/eklitzke/bitcoin-copr/blob/master/bitcoin.spec . I plan to contribute this work back upstream as well, once I've figured out more of these packaging issues (desktop files being one of them!).

Tree-SHA512: cb290dd2c2fbcf7f08d838cf911d516d09a4e978d939e719a21a84db7232d1f534043616d7fbb52edd2b7d12389e5f0f8e53d29ac59d7282bdebde8224a2db7f
2017-11-15 16:39:23 -05:00
MeshCollider
7b91b5f8a4 Remove trailing whitespace causing travis failure 2017-11-16 08:23:03 +13:00
Russell Yanofsky
434f5a2506 Recommend #include<> syntax in developer notes 2017-11-16 08:23:03 +13:00
Wladimir J. van der Laan
96b92810a6 refactor: Include obj/build.h instead of build.h 2017-11-16 08:23:03 +13:00
Wladimir J. van der Laan
138016bf92 test: refactor: Use absolute include paths for test data files 2017-11-16 08:23:02 +13:00
Wladimir J. van der Laan
e7b31631c7 qt: refactor: Changes to make include paths absolute
This makes all include paths in the GUI absolute.

Many changes are involved as every single source file in
src/qt/ assumes to be able to use relative includes.
2017-11-16 08:23:02 +13:00
Wladimir J. van der Laan
0c715214dd build: Remove -I for everything but project root
Remove -I from build system for everything but the project root,
and built-in dependencies.
2017-11-16 08:23:02 +13:00
Wladimir J. van der Laan
5b56ec969f qt: refactor: Use absolute include paths in .ui files 2017-11-16 08:23:02 +13:00
MeshCollider
1a445343f6 scripted-diff: Replace #include "" with #include <> (ryanofsky)
-BEGIN VERIFY SCRIPT-
for f in \
  src/*.cpp \
  src/*.h \
  src/bench/*.cpp \
  src/bench/*.h \
  src/compat/*.cpp \
  src/compat/*.h \
  src/consensus/*.cpp \
  src/consensus/*.h \
  src/crypto/*.cpp \
  src/crypto/*.h \
  src/crypto/ctaes/*.h \
  src/policy/*.cpp \
  src/policy/*.h \
  src/primitives/*.cpp \
  src/primitives/*.h \
  src/qt/*.cpp \
  src/qt/*.h \
  src/qt/test/*.cpp \
  src/qt/test/*.h \
  src/rpc/*.cpp \
  src/rpc/*.h \
  src/script/*.cpp \
  src/script/*.h \
  src/support/*.cpp \
  src/support/*.h \
  src/support/allocators/*.h \
  src/test/*.cpp \
  src/test/*.h \
  src/wallet/*.cpp \
  src/wallet/*.h \
  src/wallet/test/*.cpp \
  src/wallet/test/*.h \
  src/zmq/*.cpp \
  src/zmq/*.h
do
  base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f
done
-END VERIFY SCRIPT-
2017-11-16 08:23:01 +13:00
MarcoFalke
4ed818060e
Merge #10600: Make feebumper class stateless
aed1d90ac [wallet] Change feebumper from class to functions (Russell Yanofsky)
37bdcca3c [refactor] Make feebumper namespace (Russell Yanofsky)
7c4f00919 [trivial] Rename feebumper variables according to project code style (Russell Yanofsky)

Pull request description:

  Make feebumper methods static and remove stored state in the class.

  Having the results of feebumper calls persist in an object makes process
  separation between Qt and wallet awkward, because it means the feebumper object
  either has to be serialized back and forth between Qt and wallet processes
  between fee bump calls, or that the feebumper object needs to stay alive in the
  wallet process with an object reference passed back to Qt. It's simpler just to
  have fee bumper calls return their results immediately instead of storing them
  in an object with an extended lifetime.

  In addition to making feebumper methods static, also:

  - Move LOCK calls from Qt code to feebumper
  - Move TransactionCanBeBumped implementation from Qt code to feebumper
  - Rename CFeeBumper class to FeeBumper (every CFeeBumper reference had to be
    updated in this PR anyway so this doesn't increase the size of the diff)

  This change was originally part of https://github.com/bitcoin/bitcoin/pull/10244

Tree-SHA512: bf75e0c741b4e9c8912e66cc1dedf0ff715f77ea65fc33f7020d97d9099b0f6448f5852236dac63eea649de7d6fc03b0b21492e2c5140fb7560a39cf085506fd
2017-11-15 12:50:17 -05:00
MarcoFalke
fa61c6f6a6 qa: Add multiwallet prefix test 2017-11-15 11:02:41 -05:00
Wladimir J. van der Laan
927a1d7d08
Merge #10286: Call wallet notify callbacks in scheduler thread (without cs_main)
89f0312 Remove redundant pwallet nullptr check (Matt Corallo)
c4784b5 Add a dev notes document describing the new wallet RPC blocking (Matt Corallo)
3ea8b75 Give ZMQ consistent order with UpdatedBlockTip on scheduler thread (Matt Corallo)
cb06edf Fix wallet RPC race by waiting for callbacks in sendrawtransaction (Matt Corallo)
e545ded Also call other wallet notify callbacks in scheduler thread (Matt Corallo)
17220d6 Use callbacks to cache whether wallet transactions are in mempool (Matt Corallo)
5d67a78 Add calls to CWallet::BlockUntilSyncedToCurrentChain() in RPCs (Matt Corallo)
5ee3172 Add CWallet::BlockUntilSyncedToCurrentChain() (Matt Corallo)
0b2f42d Add CallFunctionInQueue to wait on validation interface queue drain (Matt Corallo)
2b4b345 Add ability to assert a lock is not held in DEBUG_LOCKORDER (Matt Corallo)
0343676 Call TransactionRemovedFromMempool in the CScheduler thread (Matt Corallo)
a7d3936 Add a CValidationInterface::TransactionRemovedFromMempool (Matt Corallo)

Pull request description:

  Based on #10179, this effectively reverts #9583, regaining most of the original speedups of #7946.

  This concludes the work of #9725, #10178, and #10179.

  See individual commit messages for more information.

Tree-SHA512: eead4809b0a75d1fb33b0765174ff52c972e45040635e38cf3686cef310859c1e6b3c00e7186cbd17374c6ae547bfbd6c1718fe36f26c76ba8a8b052d6ed7bc9
2017-11-15 16:25:40 +01:00
Wladimir J. van der Laan
aca77a4d58
Merge #11655: net: Assert state.m_chain_sync.m_work_header in ConsiderEviction
63c2d83 Explicitly state assumption that state.m_chain_sync.m_work_header != nullptr in ConsiderEviction (practicalswift)

Pull request description:

  Explicitly state assumption that `state.m_chain_sync.m_work_header != nullptr` in `ConsiderEviction(…)`.

  Static analyzer (and humans!) will see the null-check in ...

  ```
  else if (state.m_chain_sync.m_timeout == 0 || (state.m_chain_sync.m_work_header != nullptr && ...
  ```

  ... and infer that `state.m_chain_sync.m_work_header` might be set to `nullptr` when reaching `else if (state.m_chain_sync.m_timeout > 0 && time_in_seconds > state.m_chain_sync.m_timeout)` and thus flag `state.m_chain_sync.m_work_header->GetBlockHash().ToString()` as a potential null pointer dereference.

  This commit makes the tacit assumption of `state.m_chain_sync.m_work_header != nullptr` explicit.

  Code introduced in 5a6d00c6de ("Permit disconnection of outbound peers on bad/slow chains") which was merged into master four days ago.

  Friendly ping @sdaftuar :-)

Tree-SHA512: 32e5631025b7ba7556a02c89d040fbe339c482a03f28d0dbc9871c699e1f8ac867619b89c5fd41fdcfcf0dc4d7c859295b26ccd988572145cc244261aec18ce9
2017-11-15 13:55:40 +01:00
Evan Klitzke
b077fe908e fix the StartupWMClass for bitoin-qt, so gnome-shell can recognize it 2017-11-15 00:07:52 -08:00
Jonas Schnelli
4db82b7aab
Merge #11680: [docs] Add instructions for lcov report generation
5ff01c236 [docs] Add instructions for lcov coverage report generation (James O'Beirne)

Pull request description:

  After rediscovering the `lcov` report generation recipe one too many times, it seemed prudent to write some doc.

Tree-SHA512: 20e1b5f51ecd39e14bd67986a2c1578fb7da03a50625366eaca35b201db66aef99cd4a5456df3aaca5d2d66b18ed7d2e8eb8f3bd9c7aaf9af48164d9bac38931
2017-11-14 21:29:08 -10:00
fanquake
a7c949f644
[build] Add temp_bitcoin_locale_qrc to CLEAN_QT to fix make distcheck 2017-11-15 08:00:53 +08:00
James O'Beirne
5ff01c2363 [docs] Add instructions for lcov coverage report generation 2017-11-14 15:29:45 -08:00
MarcoFalke
3bdf242fc6
Merge #11677: qa: Remove unused NodeConn members
fafdad0d4 qa: Remove unused NodeConn members (MarcoFalke)

Pull request description:

  * `ver_send` and `ver_recv` were completely unused
  * `rpc` was only used once, in p2p-segwit. Imo better only pass it to the constructor in that single test

Tree-SHA512: 7f85554d6d0fd2096516ca3c608811d5370da66cde35d8031bdc921607a7a4efdb26355896012f75f713f8df09e28d46ba46be69fd96a5898fabb1a25cbcb8ad
2017-11-14 17:44:09 -05:00
Matt Corallo
ea3f363aa0 Make ISSUE_TEMPLATE a bit shorter, mention hardware tests 2017-11-14 12:50:55 -05:00
Wladimir J. van der Laan
6d4821b693
Merge #11684: trivial: Fix typo – "Ubutntu" → "Ubuntu"
d8ac893 trivial: Fix typo – "Ubutntu" → "Ubuntu" (practicalswift)

Pull request description:

  Fix typo – "Ubutntu" → "Ubuntu".

Tree-SHA512: 80441cc5bf8b3547c8e5d923cac24af6869d12a626c59f2e7573dd0652e540f8bdb32def318523d84e2856a3c8a32797f761092bfdcdc2600b30d603cdfa2ce7
2017-11-14 12:59:27 +01:00