Commit graph

21395 commits

Author SHA1 Message Date
fanquake d21e8aa0a9
Merge #16732: doc: Add spacing to command in translation_process.md
eb2d64b9e0 doc: Add spacing to command in translation_process.md (Chuf)

Pull request description:

  Add spacing to the command used for updating `bitcoin_locale.qrc` entries. This makes it slightly easier to copy output into the relevant Makefile.

ACKs for top commit:
  fanquake:
    Tested ACK - eb2d64b9e0 - thanks.

Tree-SHA512: 079180962062994a3127ba05f7bb27a4145cb6a50354076864bf546dbbd80802ba9f10c943c43b6b3544d7225b646b7a8f1e38e0f148902c1813426b6f5036c3
2019-08-27 19:19:00 +08:00
Chuf eb2d64b9e0 doc: Add spacing to command in translation_process.md
Added spacing to command for updating bitcoin_locale.qrc entries
2019-08-27 13:36:54 +02:00
fanquake 215eec3bb5
Merge #16723: doc: Update labels in CONTRIBUTING.md
a64dbeffe4 doc: Update labels in CONTRIBUTING.md (Hennadii Stepanov)

Pull request description:

  This PR:
  - adds `build` label
  - makes labels lowercase (in accordance to current customs in this repo); also a lowercase label improves readability of PR title itself, e.g.,
  ```
  doc: Update labels in CONTRIBUTING.md
  ```
  reads better than
  ```
  Doc: Update labels in CONTRIBUTING.md
  ```
  - improves label names readability
  - splits long labels (as suggested by **jonatack**)

ACKs for top commit:
  practicalswift:
    ACK a64dbeffe4
  fanquake:
    ACK a64dbeffe4

Tree-SHA512: f82e5e357490978f41035763b86cc005cf4a94099012cd0b246b664e00567ac7fa7a604bbb466b8318d94568084e3c67eecff5df152e0f39997d0a2fd9cfee77
2019-08-27 08:53:56 +08:00
fanquake efe1ee0d8d
Merge #16730: Support serialization of std::vector<bool>
92528c260e Support serialization of std::vector<bool> (Pieter Wuille)

Pull request description:

  This adds support for serialization of `std::vector<bool>`, as a prerequisite of #16702.

ACKs for top commit:
  MarcoFalke:
    ACK 92528c260e (only looked at the diff on GitHub)
  practicalswift:
    ACK 92528c260e -- diff looks correct
  jamesob:
    ACK 92528c260e

Tree-SHA512: 068246a55a889137098f817bf72d99fc3218a560d62a97c59cccc0392b110f6778843cee4e89d56f271ac64e03a0f64dc5e2cc22daa833fbbbe9234c5f42d7b9
2019-08-27 07:57:50 +08:00
Matt Corallo 9b92538ade
Remove unused fScriptChecks parameter from CheckInputs
fScriptChecks = false just short-circuits the entire function, so
passing it in is entirely useless.
2019-08-26 16:27:58 -07:00
Pieter Wuille 92528c260e Support serialization of std::vector<bool> 2019-08-26 11:36:33 -07:00
MarcoFalke adff8fe321
Merge #16629: doc: Add documentation for the new whitelist permissions
66ad75472f [Doc] Add documentation for the new whitelist permissions (nicolas.dorier)

Pull request description:

  Documenting the new feature https://github.com/bitcoin/bitcoin/pull/16248 . Ping Sjors .

ACKs for top commit:
  Sjors:
    Indeed, re-ACK 66ad75472

Tree-SHA512: e6860bb6fae921287da7920a8db534e6a1a23871dd78dd6da030f00adf23e204cd23b194d67361bf34d4ef5a7815fc3fd7c81a3f2f35e4cfbe6ee2f2e6daec25
2019-08-26 09:22:02 -04:00
MarcoFalke af4100cd6f
Merge #16404: qa: Test ZMQ notification after chain reorg
abdfc5e89b qa: Test ZMQ notification after chain reorg (João Barbosa)
aa2622a726 qa: Refactor ZMQ test (João Barbosa)
6bc1ff915d doc: Add note regarding ZMQ block notification (João Barbosa)

Pull request description:

Top commit has no ACKs.

Tree-SHA512: b93237adc8c84b3aa72ccc28097090eabcb006cf408083218bebf6fec703bd0de2ded80b6879e77096872e14ba9402a6d3f923b146a54d4c4e41dcb862c3e765
2019-08-26 09:13:46 -04:00
practicalswift e4f4ea47eb lint: Catch use of [] or {} as default parameter values in Python functions 2019-08-26 10:53:10 +00:00
practicalswift 25dd867150 Avoid using mutable default parameter values 2019-08-26 10:45:25 +00:00
Hennadii Stepanov a64dbeffe4
doc: Update labels in CONTRIBUTING.md
Add `build' label.
Make labels lowercase.
Split long labels.
2019-08-26 11:48:58 +03:00
Hennadii Stepanov 0912134039
qt: Remove QSignalMapper from TransactionView
The QSignalMapper class is obsolete since Qt 5.10.
2019-08-25 09:12:38 +03:00
Hennadii Stepanov c6dd32da69
qt: Replace obsolete functions of QDesktopWidget 2019-08-25 08:46:32 +03:00
Hennadii Stepanov c53667764e
qt: Remove obsolete QModelIndex::child()
The QModelIndex::child() member function is obsolete since Qt 5.12.
2019-08-25 08:16:14 +03:00
fanquake db67101c74
Merge #16665: scripts: move update-translations.py to maintainer-tools repo
3d50fe2c1f scripts: move update-translations.py to maintainer-tools repo (fanquake)

Pull request description:

  As mentioned in [#16644](https://github.com/bitcoin/bitcoin/pull/16644#issuecomment-522481111), move the `update-translations.py` script out of the `bitcoin/bitcoin` repo. This script is run infrequently by maintainers, and aside from #16644, doesn't see many changes. If it is going to be changed, it probably shouldn't consume review bandwidth in bitcoin/bitcoin anyways.

  PR adding the script to the maintainer-tools repo: https://github.com/bitcoin-core/bitcoin-maintainer-tools/pull/31

  Could also move some other scripts, such as [`gen-manpages.sh`](https://github.com/bitcoin/bitcoin/blob/master/contrib/devtools/gen-manpages.sh).

ACKs for top commit:
  laanwj:
    ACK 3d50fe2c1f

Tree-SHA512: b68da68e2df0c1b3275729890a02726af602eb398507f0a03387a313a73e7629a06db57f3472a1dbcf9e11506e88a8f5f725a397a9ce6afef7627188c88d3d48
2019-08-25 11:26:45 +08:00
João Barbosa d9d8984270 wallet: Use wallet name instead of pointer on unload/release 2019-08-25 02:07:04 +01:00
Sjors Provoost 9924bce317
[gui] intro: enable pruning by default unless disk is big
Color the text "GB needed for full chain" orange for nodes that barely have enough space.
2019-08-24 22:41:32 +02:00
Sjors Provoost c8de347a9d
[gui] intro: add prune preference
Adds a checkbox to the introduction screen letting the user enable pruning from the start.
Disable checkbox when launched with -prune
2019-08-24 22:41:32 +02:00
Sjors Provoost 1bbc49d207
[gui] intro: inform caller if intro was shown 2019-08-24 22:39:47 +02:00
Sjors Provoost 1957103786
[gui] add explicit prune setter
This makes it possible to enable pruning after the OptionsModel has been initialized and reset.
2019-08-24 22:36:11 +02:00
Sjors Provoost 1bccf6a52d
[node] add forceSetArg to interface 2019-08-24 22:36:11 +02:00
nicolas.dorier 66ad75472f
[Doc] Add documentation for the new whitelist permissions 2019-08-24 23:22:29 +09:00
Hennadii Stepanov 2e1455c4a1
Replace obsolete functions of QSslSocket
The QSslSocket::setDefaultCaCertificates() and 
QSslSocket::systemCaCertificates() member functions are obsolete since 
Qt 5.12.
2019-08-24 15:32:04 +03:00
Hennadii Stepanov 9e0c1d676c
qt: Remove QSignalMapper from RPCConsole
The QSignalMapper class is obsolete since Qt 5.10.
2019-08-24 10:23:24 +03:00
MeshCollider 3ca514ddb7
Merge #16370: depends: cleanup package configure flags
c295cba5a2 depends: zeromq: disable draft classes and methods (fanquake)
0072237b9e depends: xproto: configure flags cleanup (fanquake)
6a8ada3a4f depends: qrencode: configure flags cleanup (fanquake)
86beb8cdc4 depends: fontconfig: configure flags cleanup (fanquake)
e656d95ec7 depends: libxcb: configure flags cleanup (fanquake)
e439388b35 depends: libXau: configure flags cleanup (fanquake)

Pull request description:

  Related to #16354.

  This PR adds additional configure flags to packages in depends to explicitly disable features we aren't using; similar to #16183. It also fixes passing `--without-tools` to `qrencode`.

  I've added `--disable-drafts` to `zeromq`:
  ```bash
  Build and install draft classes and methods [default=yes]
  ```

  I'm not entirely sure how far we want to take this. i.e in the `zeromq` package we explicitly pass `--without-libsodium`, even though it's disabled by default.

  Do we also want to explicitly pass all the other `--without` flags? :
  ```bash
    --with-libgssapi_krb5   require libzmq build with libgssapi_krb5
                            [default=no]
    --with-libsodium        use libsodium instead of built-in tweetnacl
                            [default=no]
    --with-pgm              build libzmq with PGM extension. Requires pkg-config
                            [default=no]
    --with-norm             build libzmq with NORM protocol extension,
                            optionally specifying norm path [default=no]
    --with-vmci             build libzmq with VMCI transport [default=no]
  ```

ACKs for top commit:
  dongcarl:
    ACK c295cba5a2

Tree-SHA512: df6d38b863b4008ed2cb06c97eb0e21eaa4b5fde552876065ba7f3c87bf6e372e5b954a51bf3fde2151cfb6d2c022227d34337fc6e50ce0caa1d518abbd2412a
2019-08-24 14:45:05 +12:00
MeshCollider 910ff94cf5
Merge #16690: Prepare release notes for 0.19
74e3876989 Release notes: add previously undocumented changes (David A. Harding)
7e1634a927 Release notes: edit previously-detached notes (David A. Harding)
e7415a5a95 Doc: move detached release notes into release-notes.md (David A. Harding)

Pull request description:

  Merges in detached release notes, edits each change down to a single paragraph bullet point (or, in a couple cases, two individual bullet points in separate sections each with a single paragraph).  Adds notes for some undocumented changes I found reviewing `git log --merges`.  Also tries something new: adds the PR number(s) after each entry to make it easier for both reviewers and end-user readers to look up the details behind each change.  (If the PR numbers are unwanted, they're easy to remove either in this PR or later in the release process.)

  I also checked the 0.18 branch but I didn't find anything in the current release notes that had been backported.

  A particular focus in my editing was trying to keep things concise, particularly by pointing to RPC documentation when available (or upcoming, as in #16629).  I do suspect that one downside of detached notes is that people write longer summaries than they would if they knew there were already 300 other lines of release notes.  :-)

  The first commit only moves notes, puts them in bullet form, adjusts indentation appropriately, and drops unneeded headers.  It can be reviewed with `git diff --color-moved=dimmed-zebra` for a little bit of a speedup, but unfortunately I wasn't smart enough to split my copy/pasting and line wrapping into separate commits, so it's not a transparently move-only change.

ACKs for top commit:
  fanquake:
    ACK 74e3876989 - Thanks for doing this. It's nice to have a gauge of what's going to be in the `0.19.0` release.
  meshcollider:
    ACK 74e3876989

Tree-SHA512: 676668765849d5a67520dd8ac49de85ac1bfb5ba2dc09504e75db77d79c7e2c58b5cee16c58591ec575cb3682e630231baba7fd07565d19f8d02243e06fcb9ab
2019-08-24 14:39:10 +12:00
fanquake d86a906a88
Merge #16694: gui: Ensure transaction send error is always visible
a4765bd77f gui: Ensure tx send error highlight is visible (bpay)

Pull request description:

  Rebased and squashed #14956.

  > If sending to multiple recipients and one of the recipient fields is malformed, the highlighted field may not be visible due to being scrolled out of view. This results in a confusing lack of error feedback.

  > Avoid this problem by ensuring the first field containing an error is scrolled into view when Send is clicked.

  You can see the behavior here: https://imgur.com/a/QZG5TQc

  How to test:
  Add a few recipients and give any of them an invalid address or amount. Scroll the invalid recipient out of view and hit Send. With this change, the GUI will scroll to show the invalid recipient, with master it will not, "hiding" the error.

ACKs for top commit:
  jonatack:
    Tested ACK a4765bd77f on Linux Debian with Qt 5.11.3. Change is that I had added an inadvertent typo in my make bash alias; fixed.
  hebasto:
    ACK a4765bd77f, tested on Debian 9.9 with system Qt 5.7.1.

Tree-SHA512: a5653ca44d6d540214bdb424b0b75a06a5872cff41b0cd8cffd9cef99ebf04a17a3652e561139ac75315b39c3347e5f7ae304fa35e14b48bdae4768a416df9b0
2019-08-24 08:54:19 +08:00
David A. Harding 74e3876989
Release notes: add previously undocumented changes 2019-08-23 09:14:57 -10:00
David A. Harding 7e1634a927
Release notes: edit previously-detached notes 2019-08-23 09:14:06 -10:00
Antoine Riard 7e89994133 Remove SyncTransaction for conflicted txn in CWallet::BlockConnected
We shouldn't rely on this sync call to get an accurate view of txn
state, if a tx conflicts with one in mapTx we are going to update
our wallet dependencies in AddToWalletIfInvolvingMe while conflicting
txn get connected. If it doesn't conflict with one of our dependencies
we are not going to track it anyway.

This is a cleanup, as this SyncTransaction is redundant with the
following one for confirmation which is triggering the MarkConflicted
logic. We keep the loop because set of conflicted txn isn't same as txn
included in block.
2019-08-23 14:53:23 -04:00
Antoine Riard a31be09bfd Encapsulate tx status in a Confirmation struct
Instead of relying on combination of hashBlock and nIndex
values to manage tx in its lifecycle, we introduce 4
status : CONFIRMED, UNCONFIRMED, CONFLICTED, ABANDONED.

hashBlock and nIndex magic values should only be used at
serialization/deserialization for backward-compatibility.

At block disconnection, we know flag txn as UNCONFIRMED where
previously they kept their states until being override by a
block connection or abandontransaction call. This is a change
in behavior for which user may have to call abandon twice
if transaction is disconnected and not accepted back in the mempool.

We assert status transitioning right in AddToWallet. Doing so
flagged a misbehavior in ComputeTimeSmart unit test where same
tx is confirmed twice in different block. To avoid inconsistencies
we unconfirmed tx before new connection in different block. We
also remove a cs_main lock in test, as AddToWallet and its
callees don't rely on locked chain.
2019-08-23 14:53:20 -04:00
Hennadii Stepanov 1260ecd812
qt: Add TextWidth() wrapper
In Qt 5.12 and before the QFontMetrics::width() is used and it is
deprecated since Qt 13.0.
In Qt 5.11 the QFontMetrics::horizontalAdvance() was introduced.
2019-08-23 21:27:50 +03:00
bpay a4765bd77f
gui: Ensure tx send error highlight is visible
If sending to multiple recipients and one of the recipient fields is malformed,
the highlighted field may not be visible due to being scrolled out of view,
leading to a confusing lack of error feedback when clicking Send. To avoid this
problem ensure the first field containing an error is scrolled into view
when Send is clicked.
2019-08-23 19:20:48 +08:00
fanquake 442a9c6477
Merge #16691: doc: improve depends prefix documentation
2483266c59 packages.md: document depends build targets (Russell Yanofsky)
be27161ee4 Clarify need to specify --prefix with depends (Russell Yanofsky)

Pull request description:

  There seems to be some confusion about exactly how to use depends, when to pass a prefix to `./configure` etc (see #16367, #16654).

  I've cherry-picked two of russ's commits out of #16367, as they are clear stand-alone improvements and we don't have to wait for #16367 to improve the depends documentation.

ACKs for top commit:
  Sjors:
    utACK 2483266
  hebasto:
    ACK 2483266c59, I have reviewed the code and it looks OK, I agree it can be merged.
  jonasschnelli:
    ACK 2483266c59

Tree-SHA512: a198c288248f573519a3b0ef384626b61cc803803280af9a448c28466e3d9949bed0332af6618dac19e81c5a6e9694afa83d976b176fd13c32a6c2c3fea3fc1f
2019-08-23 18:41:17 +08:00
Jonas Schnelli d72758c3f6
Merge #16677: gui: remove unused PlatformStyle::TextColorIcon
bca388db0d gui: remove unused PlatformStyle::TextColorIcon (fanquake)

Pull request description:

  This is unused after #16612.

ACKs for top commit:
  emilengler:
    Concept ACK bca388d
  practicalswift:
    ACK bca388db0d -- diff looks correct & less cruft is better
  hebasto:
    ACK bca388db0d, I have reviewed the code and it looks OK, I agree it can be merge.
  jonasschnelli:
    utACK bca388db0d

Tree-SHA512: ae5c5cfc02cf2e6f138e75e227320f4c430b93bd529a8ead7ba971ceb5bbc997cdb721c6fd8a46a5a897008f0bc6e519422d6beef240b9d2e28ecf4f8cbbcc6a
2019-08-23 11:13:36 +02:00
Russell Yanofsky 2483266c59
packages.md: document depends build targets 2019-08-23 14:18:24 +08:00
Russell Yanofsky be27161ee4
Clarify need to specify --prefix with depends
If not cross compiling, it might actually be nice for it to be picked up
automatically. But for now clarify the readme to try to minimize confusion.

https://github.com/chaincodelabs/libmultiprocess/issues/4#issuecomment-515619707
https://github.com/chaincodelabs/libmultiprocess/issues/5#issuecomment-518826298
2019-08-23 14:18:16 +08:00
fanquake 43eaf76e02
Merge #16654: build: latest rapidcheck, update configuration
f7220e85fd build: update RapidCheck Makefile (Jon Atack)

Pull request description:

  - update RapidCheck to the latest commit on master
  - install only the extras needed by Bitcoin Core, e.g. ENABLE_BOOST_TEST instead of INSTALL_ALL_EXTRAS
  - remove cmake warning by providing `-B` arg:
      ```
      CMake Warning:
    No source or binary directory provided.  Both will be assumed to be the
    same as the current working directory, but note that this warning will
    become a fatal error in future CMake releases.
      ```

  Tested with `cd depends && make RAPIDCHECK=1` on Linux Debian.

ACKs for top commit:
  fanquake:
    ACK f7220e85fd - Tested building using depends. `ENABLE_BOOST_TEST` instead of `INSTALL_ALL_EXTRAS` seems fine.

Tree-SHA512: 8033aa25014a87125cd0aa0885a892649039ef888688f4a855d23af21a350792a4081b181b8222ed293b5070dff39c438e9c3f80294eda0c931076a8153403ea
2019-08-23 09:13:42 +08:00
fanquake 12f7147c89
Merge #16570: tests: Make descriptor tests deterministic
b9ee63c71b Make descriptor test deterministic (David Reikher)

Pull request description:

  This is an improvement to a test, inspired by #14343 - removing non determinism from a test.

  The test `descriptor_test` is non-deterministic, as it relies on the `MaybeUseHInsteadOfApostrophy` function which randomly either swaps all apostrophes with 'h' or doesn't at all in a descriptor. This fix makes both cases always run, if an apostrophe is found in a test descriptor.
  This does not reduce test coverage but removes the non-determinism.

  Additionally, the `MaybeUseHInsteadOfApostrophy` function removed the checksum if found at the end of a descriptor when the apostrophes are swapped by 'h's, since after being swapped the checksum is no longer correct. I instead added re-calculation of the checksum using the `DescriptorChecksum` function, which adds coverage for the case of a descriptors having 'h's instead of apostrophes and a checksum. This was previously lacking.
  To achieve this I had to move `DescriptorChecksum` and `PolyMod` out of the anonymous namespace in descriptor.cpp to make `DescriptorChecksum` accessible in descriptor_tests.cpp.

  All tests complete successfully (functional as well as unit tests).

ACKs for top commit:
  achow101:
    Code Review ACK b9ee63c71b

Tree-SHA512: 992c73a6644a07bfe7c72301ee2666f3c4845a012aaedd7a099a05cea8bdac84fa8280b28e44a7856260c00c0be1a6f1b6768f5694c2a22edf4c489e53fec424
2019-08-23 08:02:35 +08:00
David A. Harding e7415a5a95
Doc: move detached release notes into release-notes.md 2019-08-22 13:21:41 -10:00
MarcoFalke 52b9797119
Merge #16670: util: Add Join helper to join a list of strings
faebf62714 rpc: Use Join helper in rpc/util (MarcoFalke)
fa8cd6f9c1 util: Add Join helper to join a list of strings (MarcoFalke)

Pull request description:

  We have a lot of enumerations in the code and sometimes those enumerations need to be mentioned in the RPC or command line documentation. Previously, each caller would have a couple of lines inline to join the strings or the joined string is hardcoded in the documentation. A helper to join strings would make code such as https://github.com/bitcoin/bitcoin/pull/16629#discussion_r315852446 less verbose and easier to read.

  Also, warnings commonly accumulate in complex RPCs, since a warning doesn't lead to an early return. A helper to join those warnings would make code such as https://github.com/bitcoin/bitcoin/pull/16394/files#r309324997 less verbose and easier to read.

ACKs for top commit:
  practicalswift:
    ACK faebf62714

Tree-SHA512: 80f2db86a05c63b686f510585c1c631250271a8958fd71fafaac91559ffd2ec25d609bf7d53412ba27f87eff5893ac9dd9c2f296fc0c73581556e1d6a734a36f
2019-08-22 08:41:00 -04:00
fanquake 868a8cea15
Merge #16674: refactor: remove obsolete qt algorithm usage
153d9dd9ac refactor: replace qLowerBound & qUpperBound with std:: upper_bound & lower_bound (fanquake)
59373e3e94 refactor: replace qSort with std::sort (fanquake)
fea33cbbdf refactor: replace qStableSort with std::stable_sort (fanquake)

Pull request description:

  `qStablesort`, `qSort`, `qLowerBound` and `qUpperBound` have been marked as obsolete since at least Qt 5.9: [Obsolete Members for QtAlgorithms](https://doc.qt.io/qt-5.9/qtalgorithms-obsolete.html).

  This pull request replaces their usage with the suggested `std::` replacements.

  This also removes some warning spam when compiling against newer Qt (5.13.0 via brew):
  ```bash
    CXX      qt/libbitcoinqt_a-walletcontroller.o
  qt/transactiontablemodel.cpp:96:52: warning: 'qLowerBound<QList<TransactionRecord>::iterator, uint256, TxLessThan>' is deprecated: Use std::lower_bound [-Wdeprecated-declarations]
          QList<TransactionRecord>::iterator lower = qLowerBound(
  qt/transactiontablemodel.cpp:98:52: warning: 'qUpperBound<QList<TransactionRecord>::iterator, uint256, TxLessThan>' is deprecated: Use std::upper_bound [-Wdeprecated-declarations]
          QList<TransactionRecord>::iterator upper = qUpperBound(
  ```

  ```bash
    CXX      qt/libbitcoinqt_a-moc_walletcontroller.o
  qt/bantablemodel.cpp:64:13: warning: 'qStableSort<QList<CCombinedBan>::iterator, BannedNodeLessThan>' is deprecated: Use std::stable_sort [-Wdeprecated-declarations]
              qStableSort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder));
  ```

  ```bash
    CXX      qt/libbitcoinqt_a-sendcoinsentry.o
  qt/recentrequeststablemodel.cpp:205:5: warning: 'qSort<QList<RecentRequestEntry>::iterator, RecentRequestEntryLessThan>' is deprecated: Use std::sort [-Wdeprecated-declarations]
      qSort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order));
  ```

ACKs for top commit:
  hebasto:
    ACK 153d9dd9ac
  promag:
    ACK 153d9dd9ac.
  jonasschnelli:
    utACK 153d9dd9ac

Tree-SHA512: 22f7290ed798ce8b0f5f313405377845d4c8e48dc8687be7464e27fff53363b451a40e9e18910a8c3b4b9d4dcc236a366c92e7d171fcb8576c48f149a1886c26
2019-08-22 18:07:01 +08:00
fanquake bca388db0d
gui: remove unused PlatformStyle::TextColorIcon
This is unused after #16612.
2019-08-22 14:50:29 +08:00
fanquake 153d9dd9ac
refactor: replace qLowerBound & qUpperBound with std:: upper_bound & lower_bound 2019-08-22 13:43:47 +08:00
fanquake 59373e3e94
refactor: replace qSort with std::sort 2019-08-22 13:42:44 +08:00
fanquake fea33cbbdf
refactor: replace qStableSort with std::stable_sort 2019-08-22 13:40:51 +08:00
Jon Atack f7220e85fd
build: update RapidCheck Makefile
- update RapidCheck to latest commit on master
- install only the extras needed by Bitcoin Core
- update shasum hash
- remove CMake warning
2019-08-21 15:10:21 +02:00
MarcoFalke 6dfa9efa3f
Merge #16656: test: fix rpc_setban.py race
6011c9d72d QA: fix rpc_setban.py race (Jonas Schnelli)

Pull request description:

  The new `rpc_setban.py` test failes regularly on CIs due to a race between injecting the ban and testing the log "on the other side".

  The problem is, that the test immediately after the `addnode` command on node0 checks for the `dropped (banned)` entry on node1 (without giving some time).

  Adding a 2 seconds sleep seems to solve the race (I guess there is no better event-driven delay).

  Example of a failed test: https://bitcoinbuilds.org/index.php?ansilog=bf743910-103f-4b54-9a97-960c471061bd.log#l2906

Top commit has no ACKs.

Tree-SHA512: 680f8ea3e5ddb07e93f824f1aeff4a459e25e6c14715a39fc7670e50506d7cf25925348672c5c2d8ba3e1243ccf5effbc2456bcd094fb96868349f8d26e008f1
2019-08-21 08:22:25 -04:00
Jonas Schnelli 6011c9d72d
QA: fix rpc_setban.py race 2019-08-21 14:18:40 +02:00
fanquake 01ebaa05a4
Merge #16572: wallet: Fix Char as Bool in Wallet
2dbfb37b40 Fix Char as Bool in interfaces (Jeremy Rubin)

Pull request description:

  In a few places in src/wallet/wallet.h, we use a char when semantically we want a bool.

  This is kind of an issue because it means we can unserialize the same transaction with different fFromMe flags (as differing chars) and evaluate the following section in wallet/wallet.cpp
  ```c++
          if (wtxIn.fFromMe && wtxIn.fFromMe != wtx.fFromMe)
           {
               wtx.fFromMe = wtxIn.fFromMe;
               fUpdated = true;
           }
  ```
  incorrectly (triggering an fUpdated where both fFromMe values represent true, via different chars).

  I don't think this is a vulnerability, but it's just a little messy and unsemantic, and could lead to issues with stored wtxIns not being findable in a map by their hash.

  The serialize/unserialize code for bool internally uses a char, so it should be safe to make this substitution.

  NOTE: Technically, this is a behavior change -- I haven't checked too closely that nowhere is depending on storing information in this char. Theoretically, this could break something because after this change a tx unserialized with such a char would preserve it's value, but now it is converted to a ~true~ canonical bool.

ACKs for top commit:
  achow101:
    Code review ACK 2dbfb37b40
  meshcollider:
    Code review ACK 2dbfb37b40

Tree-SHA512: 8c0dc9cf672aa2276c694facbf50febe7456eaa8bf2bd2504f81a61052264b8b30cdb5326e1936893adc3d33504667aee3c7e207a194c71d87b3e7b5fe199c9d
2019-08-21 15:25:59 +08:00