Commit graph

21395 commits

Author SHA1 Message Date
fanquake 495db72ee7
Merge #16767: test: Check for codespell in lint-spelling.sh
8340763dc3 Check for codespell in lint-spelling.sh (Kristaps Kaupe)

Pull request description:

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

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

Tree-SHA512: f590fc4eae391c5246e86cb70cf79431bd3763ac872f82d3b2222c3a095235ca046a7072c5e61bbaeb3ed6ecd5ff85979769ee8b585de4fb97ac8cfbbf73b956
2019-08-31 14:30:20 +08:00
fanquake e9ef1b2c2e
Merge #16716: wallet: Use wallet name instead of pointer on unload/release
d9d8984270 wallet: Use wallet name instead of pointer on unload/release (João Barbosa)

Pull request description:

  Fixes #16668. Wallet name is unique so it can be used instead of pointer.

ACKs for top commit:
  meshcollider:
    utACK d9d8984270
  instagibbs:
    utACK d9d8984270
  ryanofsky:
    utACK d9d8984270. Alternately I think it might be possible to use an intptr_t set instead of a string set to get around the undefined behavior described in the issue.

Tree-SHA512: eccd4d260cd4c02b52c30deeb32dbfd190a1151a5340eb3aa4ece0dc6ae3b3ed746ce5617336461f6f27c437c435629cd07d20beb1c5450f23b75edde6728598
2019-08-31 09:17:41 +08:00
fanquake de048a59ad
Merge #16760: qt: Change uninstall icon on Windows
635e9154da [qt] Change uninstall icon on Windows (GChuf)

Pull request description:

  Change uninstall icon in Windows by changing a registry value.
  Original uninstall.exe icon remains the same
  Reason: almost no other modern program uses that uninstall icon in Windows.

  before:
  ![before](https://user-images.githubusercontent.com/42591821/63967490-13a09000-ca8d-11e9-8f49-3884d33302ce.png)
  after:
  ![after](https://user-images.githubusercontent.com/42591821/63967491-13a09000-ca8d-11e9-82f0-5adb74246a1e.png)

ACKs for top commit:
  promag:
    ACK 635e9154da.
  l2a5b1:
    ACK 635e915
  practicalswift:
    ACK 635e9154da
  jonasschnelli:
    utACK 635e9154da
  fanquake:
    ACK 635e9154da - Tested building and installing using WSL on Windows 10.

Tree-SHA512: a0f435c79e726896cc93db058f1712dcf37daefbcacbf213b340ef2d5f4ff387148b8d659302f3e84be8a9f3df23e72b0ca5937f5d77499b808081bd40bfbbac
2019-08-31 08:43:16 +08:00
Kristaps Kaupe 8340763dc3
Check for codespell in lint-spelling.sh
Similar check for spellcheck already exists in lint-shell.sh
2019-08-31 00:00:11 +03:00
GChuf f091dc8180 GUI: Remove unused menu items for Windows and Linux 2019-08-30 17:54:45 +02:00
darosior 9965940e35
doc: Add release note for the new gettransaction argument 2019-08-30 11:40:40 +02:00
darosior b8b3f0435a
tests: Add a new functional test for gettransaction 2019-08-30 11:40:39 +02:00
darosior 7f3bb247a8
gettransaction: add an argument to decode the transaction
This adds a new boolean parameter 'decode' to the gettransaction call, which, if set to true, add a 'decoded' field to the result containing the decoded transaction
2019-08-30 11:38:49 +02:00
nicolas.dorier 6d803494b5
Don't show addresses or P2PK in decoderawtransaction 2019-08-30 11:29:21 +09:00
fanquake f5db3f2128
Merge #16758: qt: Replace QFontMetrics::width() with TextWidth()
8b6f5aabb9 qt: Replace QFontMetrics::width() with TextWidth() (Hennadii Stepanov)

Pull request description:

  Compiling master (d8fc997913) on macOS Catalina (with a patch from #16720) reveals one more instance of `QFontMetrics::width()` which is supposed to be replaced with `TextWidth()` in the merged #16701.

  Sorry for incomplete solution provided in #16701. It’s especially sad that the line I missed lies in only 7 lines from the code touched in #16701.

ACKs for top commit:
  fanquake:
    ACK 8b6f5aabb9

Tree-SHA512: 65cd8bea550150e5ee47c1e906d8c2393547cf4feba3701a933a4f24fad5ecdb552ac2de4e1200ed14efaa0df0480150dd58fccbddc3b902f6c2141603874902
2019-08-30 10:27:28 +08:00
fanquake a8ecd0dada
Merge #16753: wallet: extract PubKey from P2PK script with Solver
798a589aff wallet: extract PubKey from P2PK script with Solver (Sebastian Falbesoner)

Pull request description:

  The function `ExtractPubKey()` checks if a given script matches the P2PK pattern
  (`<PubKey> OP_CHECKSIG`), extracts the PubKey and additionally checks if it is
  cryptographically valid (full validation with ECC library via `CPubKey::IsFullyValid()`).

  Currently this is done manually in the following order:
  1. check if first script OP is data push with valid PubKey length (first part of pattern match), extract PubKey
  2. create `CPubKey` object with extracted PubKey
  3. fully validate public key
  4. check if last script OP is `OP_CHECKSIG` (second part of pattern match)

  Using Solver, the pattern matching and PubKey extraction can be done via a
  single step, leading to the following simplified order with shorter code:
  1. check if given script matches P2PK pattern with Solver (also contains valid PubKey length check), extracts Pubkey
  2. create `CPubKey` object with extracted Pubkey
  3. fully validate public key

ACKs for top commit:
  instagibbs:
    utACK 798a589aff
  theStack:
    > utACK [798a589](798a589aff)
  sipa:
    ACK 798a589aff
  achow101:
    Code Review ACK 798a589aff

Tree-SHA512: 350358a89afed8c2a7967c50e9714a2d4a909259b50e694ce68dde3e7d0fa0bf3238d33642e73f2bdb53860f6d3f7327ca3eb6426b74eaffacfbca0a384d68cd
2019-08-30 09:22:31 +08:00
fanquake 74da99e010
Merge #14862: doc: Declare BLOCK_VALID_HEADER reserved
fa0b910486 [doc] chain: Declare BLOCK_VALID_HEADER reserved (MarcoFalke)

Pull request description:

  `BLOCK_VALID_HEADER` was never used and the comment is confusing to me in several ways:

  * It claims "version ok". However, without the previous header, it is not possible to check the validity of the version since the height needs to be known (c.f. BIP 90)
  * It claims "hash satisfies claimed PoW". While it is possible to check against the claimed PoW, it is not possible without the previous header to check that the claimed PoW is itself valid.
  * It claims "1 <= vtx count <= max". However, with the header alone and current consensus rules, the number of transactions is unknown.

ACKs for top commit:
  sipa:
    ACK fa0b910486
  ryanofsky:
    ACK fa0b910486

Tree-SHA512: 3972995a0a2f83aa55767bf8982af1fcb9493483f62aee6df27e58be9181a48d5968ae718b390cecc8be3ed4f26495683b1cffde8ef272dea0bd610ec169ef8b
2019-08-30 08:47:03 +08:00
GChuf 635e9154da [qt] Change uninstall icon on Windows 2019-08-29 21:37:57 +02:00
Jonas Schnelli bcf7004a89
Merge #16707: qt: Remove obsolete QModelIndex::child()
c53667764e qt: Remove obsolete QModelIndex::child() (Hennadii Stepanov)

Pull request description:

  The `QModelIndex::child()` member function is [obsolete](https://doc.qt.io/qt-5.12/qmodelindex-obsolete.html) since Qt 5.12.

  This PR removes it, does not change behavior and keeps compatibility with [Qt 5.5.1](https://github.com/bitcoin/bitcoin/pull/15393).

  Here is an excerpt from the master build log:
  ```
  qt/receivecoinsdialog.cpp: In member function ‘void ReceiveCoinsDialog::copyColumnToClipboard(int)’:
  qt/receivecoinsdialog.cpp:264:111: warning: ‘QModelIndex QModelIndex::child(int, int) const’ is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations]
       GUIUtil::setClipboard(model->getRecentRequestsTableModel()->data(firstIndex.child(firstIndex.row(), column), Qt::EditRole).toString());
                                                                                                                 ^
  In file included from /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/qabstractitemview.h:45:0,
                   from /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/qheaderview.h:44,
                   from /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/QHeaderView:1,
                   from ./qt/guiutil.h:12,
                   from ./qt/receivecoinsdialog.h:8,
                   from qt/receivecoinsdialog.cpp:7:
  /home/hebasto/Qt/5.13.0/gcc_64/include/QtCore/qabstractitemmodel.h:457:20: note: declared here
   inline QModelIndex QModelIndex::child(int arow, int acolumn) const
                      ^~~~~~~~~~~
  ```

ACKs for top commit:
  laanwj:
    Code review ACK c53667764e
  promag:
    ACK c53667764e, just read the change.
  jonasschnelli:
    utACK c53667764e

Tree-SHA512: 99fcb6ff60a6d47b925bda9f14006269eaad09ba4f7a41ac4975c6cf04bd906b58aed721cbfa0be7da8e6613d92e30d4be18b7e4d3960f026c7226558a4c3196
2019-08-29 18:36:13 +02:00
Hennadii Stepanov 8b6f5aabb9
qt: Replace QFontMetrics::width() with TextWidth() 2019-08-29 19:13:19 +03:00
Antoine Riard 442a87cc0a Add a test wallet_reorgsrestore
Test we change tx status at loading in case of reorgs while wallet
was shutdown.
2019-08-29 12:01:51 -04:00
Antoine Riard 40ede992d9 Modify wallet tx status if has been reorged out
Add a LockChain method to CWallet to know if we can lock or query
chain state safely.

At tx loading, we rely on chain to know if hashBlock of tx is still
in main chain. If not, we set its status to unconfirmed and reset
its hashBlock/nIndex.

If wallet loaded is the wallet-tool one, all wallet txn will
show up with a height of zero. It doesn't matter as status is not
used by wallet-tool.

We take lock prematurely in CWallet::LoadWallet and CWallet::Verify
to ensure that lock order is respected between cs_main an cs_wallet.
2019-08-29 11:17:51 -04:00
Wladimir J. van der Laan d8fc997913
Merge #16695: rpc: Add window final block height to getchaintxstats
d48c1e837a Add window final block height to getchaintxstats (Jonathan "Duke" Leto)

Pull request description:

  This patch is motivated by the desire to make the output of `getchaintxstats` more useful and optimized for applications to consume and render the data.

  Firstly, this data is already available to the RPC, no additional work is done. Currently additional RPC calls will be needed to look up the height of the final block in the window or the block height that began the window.

  By adding the block height of the final block in the window, the JSON is "self-contained" and applications can calculate the exact block height range of the window with no additional RPC requests.
  For example, a web application which wants to render historical information for `getchaintxstats` RPC on various window sizes might call the RPC with various window lengths, once per day, and store the JSON results somewhere. Because the final block height of each dataset is included, it's no extra work to determine the exact block window range of each JSON response.

ACKs for top commit:
  promag:
    ACK d48c1e837a.

Tree-SHA512: fd4952c125f81a4ad18f7c78498c6b3e265b93cb574832166ac25596321ce84957f971f3f78f37d7e42638dc65f2a5d4d760f289873c9c2f2a82eb00a0f87c3f
2019-08-29 16:41:46 +02:00
Wladimir J. van der Laan 75142ece6b
Merge #16706: qt: Replace deprecated QSignalMapper by lambda expressions
0912134039 qt: Remove QSignalMapper from TransactionView (Hennadii Stepanov)
9e0c1d676c qt: Remove QSignalMapper from RPCConsole (Hennadii Stepanov)

Pull request description:

  The [`QSignalMapper`](https://doc.qt.io/qt-5/qsignalmapper.html) class has been [deprecated](https://doc-snapshots.qt.io/qt5-5.10/obsoleteclasses.html) since Qt 5.10.

  This PR replaces it by lambdas and does not change behavior.

ACKs for top commit:
  jonasschnelli:
    utACK 0912134039

Tree-SHA512: 0c102d5cab4adc8b6252f72e07123ac87c65434c88cada3e72816ecea8fc4803f15b9c050fb5e1c7e8a96f709265521fd6813ab1890dbf5634032f7ee0d50675
2019-08-29 15:59:29 +02:00
Wladimir J. van der Laan 1f8378508a
Merge #15615: Add log output during initial header sync
d75e704ac0 Add log output during initial header sync (Jonas Schnelli)

Pull request description:

  The non debug log output is completely quiet during the header sync. I see two main reasons to add infos about the state of the initial header sync...
  * users may think the node did fail to start sync
  * it's a little complicate to check if your getting throttled during header sync (repeatedly calling `getchaintips` or similar)

ACKs for top commit:
  fanquake:
    Concept ACK d75e704ac0
  practicalswift:
    utACK d75e704ac0
  laanwj:
    Tested ACK d75e704ac0

Tree-SHA512: 2e738571b703d7251290864603c3a829729645962c2fa3187250bab0585e66a5f01fce892e9b5b98da451fab2b40a2e4784f9b2e5a9cad75ff62c535affe7430
2019-08-29 15:47:26 +02:00
Jonathan "Duke" Leto d48c1e837a Add window final block height to getchaintxstats
The getchaintxstats RPC now returns the additional key of window_final_block_height
2019-08-29 06:24:44 -07:00
Wladimir J. van der Laan d20d171f26
Merge #16701: qt: Replace functions deprecated in Qt 5.13
c6dd32da69 qt: Replace obsolete functions of QDesktopWidget (Hennadii Stepanov)
1260ecd812 qt: Add TextWidth() wrapper (Hennadii Stepanov)

Pull request description:

  The following functions are obsolete in Qt 5.13:
  - [`QFontMetrics::width()`](https://doc.qt.io/qt-5/qfontmetrics-obsolete.html#width)
  - [`QDesktopWidget::availableGeometry()`](https://doc.qt.io/qt-5/qdesktopwidget-obsolete.html#availableGeometry)
  - [`QDesktopWidget::screenGeometry()`](https://doc.qt.io/qt-5/qdesktopwidget-obsolete.html#screenGeometry)

  This PR replaces them and does not change behavior.

  Here are some excerpts from the master build log:
  ```
  qt/bitcoingui.cpp: In constructor ‘BitcoinGUI::BitcoinGUI(interfaces::Node&, const PlatformStyle*, const NetworkStyle*, QWidget*)’:
  qt/bitcoingui.cpp:84:57: warning: ‘const QRect QDesktopWidget::availableGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations]
           move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center());
                                                           ^
  In file included from /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/QDesktopWidget:1:0,
                   from qt/bitcoingui.cpp:43:
  /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/qdesktopwidget.h:88:67: note: declared here
       QT_DEPRECATED_X("Use QGuiApplication::screens()") const QRect availableGeometry(int screen = -1) const;
                                                                     ^~~~~~~~~~~~~~~~~
  ```
  ```
  qt/bitcoingui.cpp:1410:74: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
           max_width = qMax(max_width, fm.width(BitcoinUnits::longName(unit)));
                                                                            ^
  In file included from /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/qwidget.h:50:0,
                   from /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/qdialog.h:44,
                   from /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/QDialog:1,
                   from ./qt/optionsdialog.h:8,
                   from ./qt/bitcoingui.h:12,
                   from qt/bitcoingui.cpp:5:
  /home/hebasto/Qt/5.13.0/gcc_64/include/QtGui/qfontmetrics.h:108:9: note: declared here
       int width(const QString &, int len = -1) const;
           ^~~~~
  ```
  ```
  qt/splashscreen.cpp: In constructor ‘SplashScreen::SplashScreen(interfaces::Node&, Qt::WindowFlags, const NetworkStyle*)’:
  qt/splashscreen.cpp:127:50: warning: ‘const QRect QDesktopWidget::screenGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations]
       move(QApplication::desktop()->screenGeometry().center() - r.center());
                                                    ^
  In file included from /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/QDesktopWidget:1:0,
                   from qt/splashscreen.cpp:24:
  /home/hebasto/Qt/5.13.0/gcc_64/include/QtWidgets/qdesktopwidget.h:79:67: note: declared here
       QT_DEPRECATED_X("Use QGuiApplication::screens()") const QRect screenGeometry(int screen = -1) const;
                                                                      ^~~~~~~~~~~~~~
  ```

ACKs for top commit:
  jonasschnelli:
    utACK c6dd32da69

Tree-SHA512: deb7bcbf86e1dcc6508bd91288772c2fe8811db79fa2011de37d0469cdd094fbf7fd8c4512c607bed0bd08dc2968e893c0bbc190732c43c69ed1085259df766c
2019-08-29 14:57:06 +02:00
Sebastian Falbesoner 798a589aff wallet: extract PubKey from P2PK script with Solver
The function ExtractPubKey() checks if a given script matches the P2PK pattern
(<PubKey> OP_CHECKSIG), extracts the PubKey and additionally checks if it is
cryptographically valid (full validation with ECC library via .IsFullyValid()).

Currently this is done manually in the following order:
    1) check if first script OP is data push with valid PubKey length
       (first part of pattern match), extract PubKey
    2) create CPubKey object with extracted PubKey
    3) fully validate public key
    4) check if last script OP is OP_CHECKSIG
       (second part of pattern match)

Using Solver, the pattern matching and PubKey extraction can be done via a
single step, leading to the following simplified order with shorter code:
    1) check if given script matches P2PK pattern with Solver
       (also contains valid PubKey length check), extracts Pubkey
    2) create CPubKey object with extracted Pubkey
    3) fully validate public key
2019-08-29 13:34:20 +02:00
fanquake dcfd85acb4
Merge #16750: msbuild: adds bench_bitcoin to auto generated project files
d53d591230 Added the bench_bitcoin project to the list automatically produced by the msvc-autogen python script. (Aaron Clauson)

Pull request description:

  As discussed in #16747.

  The msbuild bench_bitcoin project is currently missing a number of classes. Rather than add them manually this PR adds bench_bitcoin to the list of project files that are auto generated from the main make files.

ACKs for top commit:
  practicalswift:
    ACK d53d591230
  fanquake:
    ACK d53d591230 - Thanks for following up quickly.

Tree-SHA512: dd767f3d8b1641a736a868b0ab5173369ab68dc42b5ac60f26e1d435a1813caad494aee175fc54b457a82e2faf36b9676ea35414c7d93c240d2e069434714f03
2019-08-29 19:33:24 +08:00
fanquake b7ff38972c
Merge #16752: doc: Delete stale URL in test README
41d484d5c8 doc: Delete stale URL in test README (Michael Folkson)

Pull request description:

  The resource on the Boost unit test framework previously linked to in src/test/README.md was a stale URL.

  Instead of deleting it, I've replaced it with an alternative resource on the framework on [boost.org](https://www.boost.org/doc/libs/1_45_0/libs/test/doc/html/utf/tutorials.html).

ACKs for top commit:
  promag:
    ACK 41d484d5c8.
  hebasto:
    ACK 41d484d5c8, the removed link is really obsolete.
  fanquake:
    ACK 41d484d5c8 - Thanks.

Tree-SHA512: 764f12548441bde615f77b7a2ca7c5188b4ab936972d16b84960fbd8604d4cbd224415bc59ce839e7e63293aa84fd97f31a69e38734e531231cdb0e148d2e1bd
2019-08-29 19:18:23 +08:00
Wladimir J. van der Laan aca76b9ee8
Merge #16708: qt: Replace obsolete functions of QSslSocket
2e1455c4a1 Replace obsolete functions of QSslSocket (Hennadii Stepanov)

Pull request description:

  The [`QSslSocket::setDefaultCaCertificates()`](https://doc.qt.io/qt-5/qsslsocket-obsolete.html#setDefaultCaCertificates) and [`QSslSocket::systemCaCertificates()`](https://doc.qt.io/qt-5/qsslsocket-obsolete.html#systemCaCertificates) member functions are [obsolete](https://doc.qt.io/qt-5.12/qsslsocket-obsolete.html) since Qt 5.12.

  This PR replaces them, does not change behavior and keeps compatibility with [Qt 5.5.1](https://github.com/bitcoin/bitcoin/pull/15393).

ACKs for top commit:
  laanwj:
    ACK 2e1455c4a1
  promag:
    ACK 2e1455c4a1.

Tree-SHA512: 4182cd22a3e7a998d62a0fe84e748803a6962a65920b74da9fcf5666a700507468bb6e428054ccb70c2fbb7969a56933f450bc405c7a32ecbc1f8af4c1f983a3
2019-08-29 13:09:51 +02:00
Michael Folkson 41d484d5c8 doc: Delete stale URL in test README 2019-08-29 13:58:00 +03:00
Wladimir J. van der Laan 1f77c5c3e7
Merge #16739: ci: Pass down $MAKEJOBS to test_runner.py, other improvements
fa27372e65 ci: Move CCACHE_DIR and test_runner tmp dir into ./ci/scratch/ (MarcoFalke)
fa60583d23 ci: Pass down $MAKEJOBS to test_runner.py (MarcoFalke)

Pull request description:

  Some changes to the ci system:

  * Pass down MAKEJOBS to the test_runner, instead of falling back to the default of 4. Passing it down avoids OOM on weak machines and allows better use of resources on beefy machines.
  * Move CCACHE_DIR to ./ci/scratch/ subfolder: `ccache` is executed with root permissions inside the docker, so the cache files are created with root as owner. So it might be wise to not put them in the $HOME of the host
  * Use the scratch dir as prefix for the test runner, as opposed to `/tmp/`, which is often a ramdisk and thus leads to OOM on the host when either a lot of tests are run in parallel or when a lot of tests fail and the datadirs are not cleaned.

ACKs for top commit:
  fanquake:
    ACK fa27372e65
  laanwj:
    ACK fa27372e65

Tree-SHA512: 67834fbab282051ec81c319d460528b32870507e53df2b8a1ce9a1f3f6a685aaf8eb8ba03f5406918ca4a33adf736e6a4adad7134c54cf3a9e47a26c64a13442
2019-08-29 12:52:41 +02:00
Aaron Clauson d53d591230
Added the bench_bitcoin project to the list automatically produced by the msvc-autogen python script. 2019-08-29 06:22:06 +02:00
fanquake fc5b756bae
Merge #16556: Fix systemd service file configuration directory setup
f3b57f4a1c Unrecommend making config file owned by bitcoin (setpill)
870d4152df Set ProtectHome in systemd service file (setpill)
639a416e37 Chgrp config dir to bitcoin in systemd service (setpill)
aded0528f0 Improve clarity of systemd service file comments (setpill)

Pull request description:

  Rationale: ran into a bug with the systemd service file, fixed it locally and figured I might as well contribute my fix.

  Also fixed some unrelated confusing phrasing in the comments of the same file, after discussion in IRC.

ACKs for top commit:
  sipsorcery:
    tACK f3b57f4a1c (nothing changed since previous tACK).
  ryanofsky:
    utACK f3b57f4a1c. Only change since last review is removing ConfigurationDirectoryMode churn in early commits

Tree-SHA512: 2188345878925b9e8a5c2c3df8dfba443720e2252a164db54a8e1d8007846721497b2d98c56f1d9b60a9a9ed4fdb1156c7b02c699616b220a9b614671617d32a
2019-08-29 11:55:03 +08:00
fanquake 9546a78595
Merge #16621: doc: add default bitcoin.conf locations
1373fa7e3d doc: add default bitcoin.conf locations (Chuf)

Pull request description:

  Added default bitcoin.conf data directories and paths

ACKs for top commit:
  practicalswift:
    ACK 1373fa7e3d
  ryanofsky:
    ACK 1373fa7e3d
  fanquake:
    ACK 1373fa7e3d - Already three ACKs and lots of discussion here, so I'm going to merge, and the other comment

Tree-SHA512: 8bb1ed9868c5d171b6791bd6dc9598eddfdf64977d327ff4f333323cef8e3e76b1a67da21e4199f008a12f5610ac6dc6f34f4a13235e8846754eb6d6e5075da4
2019-08-29 11:37:08 +08:00
fanquake 085fe76299
Merge #16461: doc: Tidy up shadowing section
9452802480 doc: Tidy up shadowing section (João Barbosa)

Pull request description:

  Removes the example because it violates the code format.

ACKs for top commit:
  MarcoFalke:
    unsigned ACK 9452802480
  ryanofsky:
    ACK 9452802480
  fanquake:
    ACK 9452802480 - Thanks for following up.

Tree-SHA512: 1fc31355d368225713298da7803e39e99014fbfcd229f2d3b56c082de95ab2965e51c80b172a5abce4646c53f845fa62a6d94d5df714e7835cac07a8ec7d5da7
2019-08-29 08:16:31 +08:00
fanquake 7fbbd6fbd2
Merge #16746: msbuild: Ignore linker warning
aff1c9c884 Adds an option to msbuild common configuration to ignore linker warning 4221. This warning is for object files that do not include any symbols. The warning is harmless and occurs due to some classes that are *nix only having no source to compile for an msvc build. (Aaron Clauson)

Pull request description:

  Adds an option to msbuild common configuration to ignore linker warning 4221. This warning is for object files that do not include any symbols. The warning is harmless and occurs due to some classes that are *nix only having no source to compile for an msvc build.

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

Tree-SHA512: fda3721462d927d8734e16fc0250c7c76b197a085219a9e5267cdd14e19f23f50807d6b5516dee8402b60f3fdf188677e3d618fe6acbdbb5ac3bb635aeb7b297
2019-08-29 08:10:21 +08:00
MarcoFalke 93305e6d46
Merge #14879: qt: Add warning messages to the debug window
593ba696fb Add warning messages to the debug window (Hennadii Stepanov)

Pull request description:

  Fix: #11016

  This PR adds warning messages to the debug window in `-disablewallet` mode.

  ![screenshot from 2018-12-06 01-01-27](https://user-images.githubusercontent.com/32963518/49550070-413c1c80-f8f3-11e8-9865-efb49ea8da45.png)

ACKs for top commit:
  jonasschnelli:
    utACK 593ba696fb
  promag:
    ACK 593ba696fb, agree with @Sjors https://github.com/bitcoin/bitcoin/pull/14879#pullrequestreview-196433092 above.
  ryanofsky:
    utACK 593ba696fb

Tree-SHA512: a8ca78529bb16813ba7bfaf5ccd4349189979f08e78ea857746a6fb00fd9d7ed98d8f06f384830acba21dac57070060af23f6be8249398feb32a6efff1333de8
2019-08-28 16:03:09 -04:00
MarcoFalke fa61365a13
wallet: Translate all initErrors in CreateWalletFromFile
Every warning or error in this method is translated, except for those
two. Translate them as well for consistency.
2019-08-28 15:52:31 -04:00
MarcoFalke fa70d199d0
util: Make util/error bilingual_str (refactor)
Translated strings should not end up in the debug log, stderr, or
returned by an RPC.

Changing the util methods in util/error to return a bilingual_str paves
the way to achieve this goal in the long term.
2019-08-28 15:52:26 -04:00
João Barbosa 9452802480 doc: Tidy up shadowing section 2019-08-28 18:52:53 +01:00
Suhas Daftuar c4aa2ba822 [refactor] Change tx_relay structure to be unique_ptr 2019-08-28 13:41:58 -04:00
Suhas Daftuar 4de0dbac9b [refactor] Move tx relay state to separate structure 2019-08-28 13:41:58 -04:00
MarcoFalke cc40b55da7
Merge #16726: tests: Avoid common Python default parameter gotcha when mutable dict/list:s are used as default parameter values
e4f4ea47eb lint: Catch use of [] or {} as default parameter values in Python functions (practicalswift)
25dd867150 Avoid using mutable default parameter values (practicalswift)

Pull request description:

  Avoid common Python default parameter gotcha when mutable `dict`/`list`:s are used as default parameter values.

  Examples of this gotcha caught during review:
  * https://github.com/bitcoin/bitcoin/pull/16673#discussion_r317415261
  * https://github.com/bitcoin/bitcoin/pull/14565#discussion_r241942304

  Perhaps surprisingly this is how mutable list and dictionary default parameter values behave in Python:

  ```
  >>> def f(i, j=[], k={}):
  ...     j.append(i)
  ...     k[i] = True
  ...     return j, k
  ...
  >>> f(1)
  ([1], {1: True})
  >>> f(1)
  ([1, 1], {1: True})
  >>> f(2)
  ([1, 1, 2], {1: True, 2: True})
  ```

  In contrast to:

  ```
  >>> def f(i, j=None, k=None):
  ...     if j is None:
  ...         j = []
  ...     if k is None:
  ...         k = {}
  ...     j.append(i)
  ...     k[i] = True
  ...     return j, k
  ...
  >>> f(1)
  ([1], {1: True})
  >>> f(1)
  ([1], {1: True})
  >>> f(2)
  ([2], {2: True})
  ```

  The latter is typically the intended behaviour.

  This PR fixes two instances of this and adds a check guarding against this gotcha going forward :-)

ACKs for top commit:
  Sjors:
    Oh Python... ACK e4f4ea47eb. Testing tip: swap the two commits.

Tree-SHA512: 56e14d24fc866211a20185c9fdb274ed046c3aed2dc0e07699e58b6f9fa3b79f6d0c880fb02d72b7fe5cc5eb7c0ff6da0ead33123344e1a872209370c2e49e3f
2019-08-28 13:34:31 -04:00
MarcoFalke 119e97ae2d
Merge #16740: qa: Relax so that the subscriber is ready before publishing zmq messages
403e372407 qa: Relax so that the subscriber is ready before publishing zmq messages (João Barbosa)

Pull request description:

  Prevents the syndrome "slow joiner" - see http://zguide.zeromq.org/py:all#sockets-and-patterns - by relaxing before publishing messages.

ACKs for top commit:
  MarcoFalke:
    unsigned ACK 403e372407

Tree-SHA512: 0e856accbc450a9b09160bdce5112b2103dc9436cc317d31fb1c9634ebd76823a300a2e727818057fb4d0a615271772ff23e80553a13e9aa1935500de5eeec5f
2019-08-28 13:30:59 -04:00
MarcoFalke 2d38950e5d
Merge #16742: test: add executable flag for wallet_watchonly.py
71e08ab22d test: add executable flag for wallet_watchonly.py (Sebastian Falbesoner)

Pull request description:

ACKs for top commit:
  promag:
    ACK 71e08ab22d.

Tree-SHA512: a187d2f7590ad2450b8e8fa3d038c80a04fc3d903618c24222d7e3172250ce51badea35860c86101f2ba266eb4354e6efb8d7d508b353f29276e4665a1efdf74
2019-08-28 13:24:46 -04:00
Sebastian Falbesoner 71e08ab22d test: add executable flag for wallet_watchonly.py 2019-08-28 18:25:00 +02:00
Aaron Clauson aff1c9c884
Adds an option to msbuild common configuration to ignore linker warning 4221. This warning is for object files that do not include any symbols. The warning is harmless and occurs due to some classes that are *nix only having no source to compile for an msvc build. 2019-08-28 15:03:23 +02:00
João Barbosa 403e372407 qa: Relax so that the subscriber is ready before publishing zmq messages 2019-08-28 00:42:29 +01:00
MarcoFalke fa27372e65
ci: Move CCACHE_DIR and test_runner tmp dir into ./ci/scratch/ 2019-08-27 15:58:50 -04:00
MarcoFalke fa60583d23
ci: Pass down $MAKEJOBS to test_runner.py 2019-08-27 15:58:49 -04:00
MarcoFalke fae961de6b
test: Establish only one connection between nodes in rpc_invalidateblock 2019-08-27 15:22:40 -04:00
MarcoFalke a7be1cc92b
Merge #16728: move-only: move coins statistics utils out of RPC
8a3b2eb175 move-only: move coins statistics utils out of RPC (James O'Beirne)

Pull request description:

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

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

  ---

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

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

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

Tree-SHA512: a187d2f7590ad2450b8e8fa3d038c80a04fc3d903618c24222d7e3172250ce51badea35860c86101f2ba266eb4354e6efb8d7d508b353f29276e4665a1efdf74
2019-08-27 13:10:45 -04:00
James O'Beirne 8a3b2eb175 move-only: move coins statistics utils out of RPC
These procedures will later be used in the ChainstateManager to compute
statistics (particularly a content hash) for UTXO sets coming in from
snapshots.
2019-08-27 11:51:56 -04:00