Commit graph

15336 commits

Author SHA1 Message Date
MeshCollider
77939f27f7 Fix uninitialized g_connman crash in Shutdown() 2017-09-14 16:47:10 +12: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
Cory Fields
1817398b39 mininode: add an optimistic write and disable nagle
Because the poll/select loop may pause for 100msec before actually doing a
send, and we have no way to force the loop awake, try sending from the calling
thread if the queue is empty.

Also, disable nagle as all sends should be either full messages or unfinished
sends.

This shaves an average of ~1 minute or so off of my accumulated runtime, and
10-15 seconds off of actual runtime.
2017-09-13 13:31:44 -04:00
MarcoFalke
42973f8344
Merge #11078: [tests] Make p2p-leaktests.py more robust
0063d2c3d [tests] Make p2p-leaktests.py more robust (John Newbery)

Pull request description:

  There has been an example of p2p-leaktests.py failing on travis in the new service bits test (introduced in #11001 . It appeared to me that the previous p2p connections had not been fully disconnected before attempting to add new p2p connections.

  I've added a sleep and restarted the NetworkThread, but I don't know whether this will fix the problem, since I'm unable to reproduce the failure locally.

  @MarcoFalke - not sure what you want to do here? I don't think this change could make things any worse.

Tree-SHA512: f5427c26267185a903c9b75bb3925bf153b8afce70c8e493bf8f585f57d809d20643b4ee69081300b211d22e960242aecc3d719f4ddd230aa08fdc5484b55055
2017-09-13 18:54:50 +02:00
MarcoFalke
8df48b36ed
Merge #11308: [qa] zapwallettxes: Wait up to 3s for mempool reload
fadd0c16b [qa] zapwallettxes: Wait up to 3s for mempool reload (MarcoFalke)

Pull request description:

  There had been intermittent test failures on zapwallettxes, as no time was allotted to reload the mempool.

Tree-SHA512: 993254d2aaca6ea42fceefffed0cf90bdda91c64150179ef2a11337c3fe2cc6bf42b83ea9d9a1a575204fbde2676d7203443b00d053e8c2ed43e017c09d3ab11
2017-09-13 18:18:24 +02:00
Suhas Daftuar
f97ab35fa9 qa: Fix bug introduced in p2p-segwit.py
Changing __init__() -> set_test_params() in the tests should not have
applied to NodeConnCB-derived objects.
2017-09-13 09:21:27 -04:00
Suhas Daftuar
a7820422e0 qa: Treat mininode p2p exceptions as fatal 2017-09-13 09:17:15 -04:00
Paul Berg
d552ed678c Put back inadvertently removed copyright notices
In an abundance of caution this restores "Bitcoin Developers" to the COPYING file in
case there were contributors before that point in time that would object to the
current label.  It's harmless and more pedantically correct.

[Change extracted from the Bitcoin-abc repository, commit message by gmaxwell]

Signed-off-by: Gregory Maxwell <greg@xiph.org>
2017-09-13 07:24:42 +00:00
MarcoFalke
96ac26e566
Merge #11310: [tests] Test listwallets RPC
fb1f32582 Add listwallets RPC test to multiwallet.py (Cristian Mircea Messel)

Pull request description:

Tree-SHA512: acf3377ac86fcc4e7fe36e3b97120f3e51b7bd94cb7136ce22e7e2043ce8ec5555c246c41f8501272aeb1e56ad16d05eb8c4eeb6acf3315a218c1ed4e5844871
2017-09-12 23:56:04 +02:00
Cristian Mircea Messel
fb1f325822 Add listwallets RPC test to multiwallet.py 2017-09-13 00:41:14 +03:00
MarcoFalke
fadd0c16b6 [qa] zapwallettxes: Wait up to 3s for mempool reload 2017-09-12 23:33:08 +02:00
MarcoFalke
cce94c518a
Merge #11311: travis: Revert default datadir check
fa4fad9d8 travis: Revert default datadir check (MarcoFalke)

Pull request description:

  This still breaks builds. The default datadir check needs more work to stay in master.

Tree-SHA512: b930df4ff8cb76089030aedb2ebbbc1ecc26f9e3d1aba29c78f9f03d7611c6ecaa27afb15ee643690643439d78b98aef9c0c5b2657c7f2fe0c28a3076d6913c2
2017-09-12 23:29:23 +02:00
MarcoFalke
fa4fad9d86 travis: Revert default datadir check 2017-09-12 22:59:48 +02:00
MarcoFalke
801dd40666
Merge #7142: Travis: Test build against system libs (& Qt4)
6d2aac8bb Travis: Test build against system libs (& Qt4) (Luke Dashjr)
8d82e1336 Travis: Remove bc tool from dependencies (Luke Dashjr)

Pull request description:

  Also removes now-unnecessary `bc` dependency from other builds.

Tree-SHA512: 815215994eeba0acf27774f57cf3a0bf77bbc22834d3242a227e0d90b5948a05f8b5ef846eb384e3ee575bec60880ae215ccc3882f13b60004a62549d3b3a28f
2017-09-12 21:16:32 +02:00
MarcoFalke
ce829855cf
Merge #10691: Trivial: Properly comment about shutdown process in init.cpp file.
581c41157 Properly comment about shutdown process in init.cpp file (Kyuntae Ethan Kim)

Pull request description:

Tree-SHA512: 8aaf739ca5eb2cf6f777b69a0d65f391ba311a33d2e23abc4d3008f90c6ef9da79d0683845abfc08978309f43409f0a7021663f8c564e157224c1dbe15138158
2017-09-12 21:08:06 +02:00
MarcoFalke
b148803b18
Merge #11264: [doc] Fix broken Markdown table in dependencies.md
b8d91e03a [Docs] Fix broken Markdown table in dependencies.md. Cleanups. (practicalswift)

Pull request description:

  Changes made to `dependencies.md`:
  * Fix broken table Markdown.
  * Use correct capitalization.
  * Sort dependencies.
  * Minor cleanups.

Tree-SHA512: ff3826dd779a8593738ef5297889a7d28a716220f75af77f63f425206441537738cc589d67f387b9356577b227673b028a61849ee08dd757a311923033fe7271
2017-09-12 19:42:06 +02:00
MarcoFalke
c377feaad8
Merge #11267: rpc: update cli for estimate*fee argument rename
5acd82de9 rpc: make estimatesmartfee argument naming consistent with documentation (Wladimir J. van der Laan)
24697c40e rpc: update cli for estimatefee argument rename (Wladimir J. van der Laan)

Pull request description:

  The first argument of `estimaterawfee` was renamed from `nblocks` to `conf_target` in 06bcdb8da6. Update the client-side table as well.
  This makes #10753 pass again.

Tree-SHA512: 107c0072a45e0f4e083dc803d534973e6bd4c005e62337a867815d7c98ab1c21d97b7a495c32763883975cbbb001b80003001a6709b7d9bdd81ce4d441b667be
2017-09-12 19:31:30 +02:00
MarcoFalke
b37cab65c6
Merge #11230: [tests] fixup dbcrash interaction with add_nodes()
8fdb6f912 [tests] fixup dbcrash interaction with add_nodes() (John Newbery)

Pull request description:

  Another conflict with #11121. Apologies - this is entirely my fault. I didn't run the extended test suite after rebasing on master.

  @MarcoFalke @sdaftuar

Tree-SHA512: eefce1d1c63dc4a63c5e030a541e046ad4832e8a709c0a8aad40ffdc4712b2065486778b406dfa57cfd34e66db86064278ee3fea8f2c2afd2390772875e6fa3e
2017-09-12 19:24:37 +02:00
Alex Morcos
bf64c3cb34 Ignore transactions added to mempool during a reorg for fee estimation purposes. 2017-09-12 12:40:06 -04:00
Alex Morcos
04f78ab5b9 Do not reject based on mempool min fee when bypass_limits is set.
This should have always been the case, but we will correctly trim to size after
a reorg which is when bypass_limits is set.
2017-09-12 12:35:35 -04:00
Alex Morcos
fd849e1b03 Change AcceptToMemoryPool function signature
Combine fLimitFree and fOverrideMempoolLimit into a single boolean:
bypass_limits.  This is used to indicate that mempool limiting based on feerate
should be bypassed.  It is used when readding transactions from a reorg and then
the mempool is trimmed to size after all transactions are added and they can be
evaluated in the context of their descendants. No changes to behavior.
2017-09-12 12:30:26 -04:00
MarcoFalke
fadf31ef02 wallet: Display non-HD error on first run 2017-09-12 12:40:41 +02:00
MarcoFalke
fa65dcdda0 doc: Update release notes for 0.16.0 2017-09-12 09:56:13 +02:00
MarcoFalke
fa2c3b6cf7 doc: Bump manpages to 0.15.99 2017-09-12 09:55:21 +02:00
Marko Bencun
05cae8aefd range-based loops and const qualifications in net.cpp
Plus a use of std::copy() instead of manual copying.
2017-09-12 09:11:22 +02:00
Pieter Wuille
b9bceaf1c0
Merge #11252: [P2P] When clearing addrman clear mapInfo and mapAddr.
b86a42077 when clearing addrman clear mapInfo and mapAddr (Gregory Sanders)

Pull request description:

  Power failure on my machine resulted in a corrupted addrman that would hit bad assertions when trying to serialize the "cleared" addrman to disk: 6866b4912b/src/addrman.h (L320)

Tree-SHA512: 07ca8b6cbd88407e5f3f0dccb346ae31bd1392f4210b2d5c5647c853986bfec95cf70240b92bafdc61b90e452a5d8315962738d10c10c2b53fdabff10503d05a
2017-09-11 15:33:20 -07:00
Matt Corallo
1789e4675b Force explicit double -> int conversion for CFeeRate constructor
This resolves an issue where estimatesmartfee would return 999
sat/byte instead of 1000, due to floating point loss of precision

Thanks to sipa for suggesting is_integral.
2017-09-11 18:07:52 -04:00
Pieter Wuille
1afc22a766
Merge #11100: Fix confusing blockmax{size,weight} options, dont default to throwing away money
6f703e9bf Add release notes describing blockmaxweight deprecation (Matt Corallo)
3dc263c9b Use a sensible default for blockmaxweight (Matt Corallo)
ba206d2c6 Deprecate confusing blockmaxsize, fix getmininginfo output (Matt Corallo)

Pull request description:

  No sensible user will ever keep the default settings here, so not
  having sensible defaults only serves to screw users who are
  paying less attention, which makes for terrible defaults.

  Additionally, support for block-size-limiting directly has been removed:

  * This removes block-size-limiting code in favor of GBT clients
    doing the limiting themselves (if at all).
  * -blockmaxsize is deprecated and only used to calculate an implied
    blockmaxweight, addressing confusion from multiple users.
  * getmininginfo's currentblocksize return value was returning
    garbage values, and has been removed, also removing a
    GetSerializeSize call in some block generation inner loops and
    potentially addressing some performance edge cases.

Tree-SHA512: 33010540faf5d6225ad575488b804e180a8d53a41be484ca2932a0485595e28da62f0ade4b279a6bf1c947c7ce389f51fde8651b2ba25deb25e766e0813b993c
2017-09-11 13:00:09 -07:00
Matt Corallo
53a6590f49 Make float <-> int casts explicit outside of test, qt, CFeeRate 2017-09-11 15:51:37 -04:00
Matt Corallo
0b1b9148cd Remove countMaskInv caching in bench framework
We were saving a div by caching the inverse as a float, but this
ended up requiring a int -> float -> int conversion, which takes
almost as much time as the difference between float mul and div.

There are lots of other more pressing issues with the bench
framework which probably require simply removing the adaptive
iteration count stuff anyway.
2017-09-11 15:51:36 -04:00
Matt Corallo
6f703e9bf1 Add release notes describing blockmaxweight deprecation 2017-09-11 15:51:26 -04:00
Matt Corallo
3dc263c9b9 Use a sensible default for blockmaxweight
No sensible user will ever keep the default settings here, so not
having sensible defaults only serves to screw users who are
paying less attention, which makes for terrible defaults.
2017-09-11 15:51:26 -04:00
Matt Corallo
ba206d2c63 Deprecate confusing blockmaxsize, fix getmininginfo output
* This removes block-size-limiting code in favor of GBT clients
  doing the limiting themselves (if at all).
* -blockmaxsize is deprecated and only used to calculate an implied
  blockmaxweight, addressing confusion from multiple users.
* getmininginfo's currentblocksize return value was returning
  garbage values, and has been removed, also removing a
  GetSerializeSize call in some block generation inner loops and
  potentially addressing some performance edge cases.
2017-09-11 15:51:25 -04:00
Wladimir J. van der Laan
31e72b284e
Merge #11268: [macOS] remove Growl support, remove unused code
f151f5f50 [macOS] remove Growl support, remove unused code (Jonas Schnelli)

Pull request description:

  There is no longer a reason to support Growl.
  A) It went to pay-ware since a couple of years
  B) Since OSX 10.8, the operating system has its own modal notification options (Notification Center).

  This PR removes support for Growl.
  OSX notification centre is still supported after this PR.

Tree-SHA512: eee18098d7354c4e98f927bca9963d4843ff6bceee74795f73a66c27eed33efaac00ec2cabde8807efcbc936b16ab712249006fa13f5a3f55e4d44d163f5f9a0
2017-09-11 21:42:43 +02:00
Marko Bencun
35e5c2269c remove unused IsArgSet check
Forgotten in 506b700dcb
2017-09-11 16:17:47 +02:00
Marko Bencun
605918272c add m_added_nodes to connman options 2017-09-11 16:17:01 +02:00
MeshCollider
df10edfd03 More user-friendly error message when partially signing 2017-09-11 22:15:44 +12:00
MarcoFalke
16e41844e7
Merge #11297: Make sure ~/.bitcoin doesn't exist before build
b73628d5a Make sure ~/.bitcoin doesn't exist before build (MeshCollider)

Pull request description:

  We've been getting some random travis failures since https://github.com/bitcoin/bitcoin/pull/11260 was merged, because the `~/.bitcoin` directory exists after tests are run. Not sure exactly what's causing it, but this PR ensures the directory doesn't exist before running the build and tests, to see if this fixes the issue.

  Edit: travis has been run on this merge twice, and all tests passed both times, so either this fixes the issue or it just got lucky

Tree-SHA512: d48e594cfc19a16f4c6e360ec78956ff4274169e92fac4602ab0b980de32875c1e9d3cb24a40c708b5334dbbf8bf55a8003121591bdb5f3fdd256d63e1235aa8
2017-09-11 07:59:26 +02:00
Anthony Towns
d601f16621 Fix invalid memory access in CScript::operator+= 2017-09-11 13:40:31 +10:00
MarcoFalke
ee50c9e487
Merge #11276: [Docs] Update CONTRIBUTING.md to reduce unnecessary review workload
91c39e38d Update CONTRIBUTRING.md to reduce unnecesarry review workload (Jonas Schnelli)

Pull request description:

  The current workload for reviewing pull requests is relatively high and trivial, non-beneficial pull requests tend to slow down the overall development process.

  We may want to directly close trivial, non-beneficially pull requests during time of high pull request load.

  This PR would prepare for possible direct PR closing.

Tree-SHA512: 6a0fb0133e42a400133cc77e4830620c26af4fe5b69f6238e0e77e686d785bd984d85c681a942701e7719de836147e646091a6c492f1d1e2abb906129566082f
2017-09-10 18:40:23 +02:00
MeshCollider
b73628d5a8 Make sure ~/.bitcoin doesn't exist before build 2017-09-10 16:30:52 +12:00
MarcoFalke
11dacc6154
Merge #11286: [depends] Don't build libevent sample code
f38c05104 [depends] Don't build libevent sample code (fanquake)

Pull request description:

  Noticed today while doing Windows depends builds.
  Before and after libevent build on OS X.

  ```
  Building libevent...
    GEN      include/event2/event-config.h
  /Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
    CC       buffer.lo
    CC       bufferevent.lo
    CC       bufferevent_filter.lo
    CC       bufferevent_ratelim.lo
    CC       bufferevent_sock.lo
    CC       bufferevent_pair.lo
    CC       event.lo
    CC       evmap.lo
    CC       evthread.lo
    CC       evutil.lo
    CC       evutil_rand.lo
    CC       evutil_time.lo
    CC       listener.lo
    CC       log.lo
    CC       select.lo
    CC       poll.lo
    CC       kqueue.lo
    CC       signal.lo
    CC       evdns.lo
    CC       event_tagging.lo
    CC       evrpc.lo
    CC       http.lo
    CC       evthread_pthread.lo
    CC       sample/dns-example.o
    CC       sample/event-read-fifo.o
    CC       sample/hello-world.o
    CC       sample/http-server.o
    CC       sample/http-connect.o
    CC       sample/signal-test.o
    CC       sample/time-test.o
    CCLD     libevent_core.la
    CCLD     libevent_pthreads.la
    CCLD     libevent.la
    CCLD     libevent_extra.la
    CCLD     sample/event-read-fifo
    CCLD     sample/dns-example
    CCLD     sample/hello-world
    CCLD     sample/http-server
    CCLD     sample/http-connect
    CCLD     sample/signal-test
    CCLD     sample/time-test
  Staging libevent...
  ```

  ```
  Building libevent...
    GEN      include/event2/event-config.h
  /Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
    CC       buffer.lo
    CC       bufferevent.lo
    CC       bufferevent_filter.lo
    CC       bufferevent_pair.lo
    CC       bufferevent_ratelim.lo
    CC       bufferevent_sock.lo
    CC       event.lo
    CC       evmap.lo
    CC       evthread.lo
    CC       evutil.lo
    CC       evutil_rand.lo
    CC       evutil_time.lo
    CC       listener.lo
    CC       log.lo
    CC       select.lo
    CC       poll.lo
    CC       kqueue.lo
    CC       signal.lo
    CC       evdns.lo
    CC       event_tagging.lo
    CC       evrpc.lo
    CC       http.lo
    CC       evthread_pthread.lo
    CCLD     libevent_core.la
    CCLD     libevent_pthreads.la
    CCLD     libevent.la
    CCLD     libevent_extra.la
  Staging libevent...
  ```

Tree-SHA512: a82bde38e110a16f934c0f1e95d3ae66662c1b3c1367e4a6e7c4994f585ebeea4f5cbee4d98a8dc64a8e8936eb9f4bb0c55fb65e718f724d88e81cb8fa84be88
2017-09-10 04:39:11 +02:00
MeshCollider
c626dcb50e Make fUseCrypto atomic 2017-09-10 11:29:08 +12:00
Pieter Wuille
3255d6347b
Merge #11285: Add -usehd to excluded args in check-doc.py
7d03418ae Add -usehd to excluded args in check-doc.py (MeshCollider)

Pull request description:

  All Travis builds on master are currently failing due to contrib/devtools/check-doc.py picking up `-usehd` in `src/wallet/wallet.cpp#L3845` as an undocumented argument (removed in https://github.com/bitcoin/bitcoin/pull/11250). Just need to add it to the list of unsupported, deprecated and duplicate args in check-doc.py so that it's ignored. Otherwise all builds on top of https://github.com/bitcoin/bitcoin/pull/11250 will fail until this is merged.

Tree-SHA512: 205c9be759b04bc3b85ac2b53fd455b3c0e229320d8e2b7f7d0ef5d5bd8033594b38a2d948250894ee2f4451584aca698476cd4b5cdf82955925683e3068a67c
2017-09-08 11:41:10 -07:00
fanquake
f38c051048
[depends] Don't build libevent sample code 2017-09-08 16:29:01 +08:00
practicalswift
b8d91e03a9 [Docs] Fix broken Markdown table in dependencies.md. Cleanups.
Use the correct capitalization for the dependencies

Sort dependencies

Fix header formatting. Minor style cleanups.
2017-09-08 09:44:20 +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
c22a53cd63
Merge #11250: Bump wallet version to 159900 and remove the usehd option
713a92073 Remove usehd option and warn when it is used (Andrew Chow)
d4c18f733 Bump wallet version number to 159900 (Andrew Chow)

Pull request description:

  Bump the wallet version number to 159900 so that new wallets made without a default key will no longer work on previous versions at all. Also remove the `usehd` option to avoid weird interaction with wallet version numbers and HD-ness of wallets.

Tree-SHA512: dd7965505bfad6a926c79afd423236f509229a398a8398076f8d57d90a5974243f9459a61225c4daee560c796f427445c9e55a3ad528a3a97a9123ca6a1269ab
2017-09-08 02:28:12 +02:00