Commit graph

20992 commits

Author SHA1 Message Date
MarcoFalke
e06067387e
Merge #16250: signrawtransactionwithkey: report error when missing redeemScript/witnessScript
01174596e6 signrawtransactionwithkey: report error when missing redeemScript/witnessScript param (Anthony Towns)

Pull request description:

  Adding support for "witnessScript" as an alternative to "redeemScript" when using "signrawtransactionwithkey" meant that the `RPCTypeCheckObj()` call in `SignTransaction` can't error out just because either parameter is missing -- it's only a problem if both are missing, which isn't a state `RPCTypeCheckObj()` tests for. This results in the regression described in #16249. This patch adds some code to test for this case and give a similar error, namely:

      error code: -8
      error message:
      Missing redeemScript/witnessScript

  Fixes: #16249

ACKs for top commit:
  meshcollider:
    utACK 01174596e6
  promag:
    ACK 01174596e. Could also write test without `dict`/`del`:

Tree-SHA512: cf51346b7dea551b7f18f2a93c2a336a293b2535c62c03a5263cd2be8c58cf0cc302891da659c167e88ad1a68a756472c3c07e99f71627c61d32886fc5a3a353
2019-07-02 17:21:02 -04:00
MarcoFalke
faf8318c55
test: Split fundrawtx test into subtests 2019-07-02 17:19:18 -04:00
MarcoFalke
fa6fba3bc8
test: Make local symbols in run_test members 2019-07-02 17:17:43 -04:00
MarcoFalke
faf6caf4da
test: Add tests for getblockchaininfo.softforks 2019-07-02 15:25:13 -04:00
João Barbosa
3d60a03a7c bench: Move generated data to a dedicated translation unit 2019-07-02 18:11:15 +01:00
Wladimir J. van der Laan
4db2f8cf0f
Merge #16153: Qt: Add antialiasing to traffic graph widget
db26e8e228 Add antialiasing to traffic graph widget (Josu Goñi)

Pull request description:

  Before:

  ![image](https://user-images.githubusercontent.com/25986871/58974389-92559c00-87c2-11e9-9673-0c47ac71de2e.png)

  After:

  ![image](https://user-images.githubusercontent.com/25986871/58974280-56223b80-87c2-11e9-8fcc-1e5d299dd1e2.png)

ACKs for top commit:
  laanwj:
    ACK db26e8e228

Tree-SHA512: d795809458522a1ec19e236de30c2c5070960544162323324f0d4e2f49c3590fe7756e924f1021056106b4c52dcb564e690c15f85a15ea35342badf72653d534
2019-07-02 19:00:35 +02:00
MarcoFalke
fab0c820fa
rpc: Clarify that block count means height excl genesis 2019-07-02 12:28:21 -04:00
MarcoFalke
177550101b wallet: Remove unreachable code in CreateTransaction 2019-07-02 11:50:13 -04:00
MarcoFalke
c84349a148
Merge #16314: scripts and tools: Update copyright_header.py script
ca11606858 Fix: "Bitcoin Core" -> "The Bitcoin Core" (Hennadii Stepanov)
621463d7df Drop no-longer-relevant copyright holder name (Hennadii Stepanov)
01fafe55a1 Include Objective-C source files (Hennadii Stepanov)

Pull request description:

  Now the `copyright_header.py` script handles Objective-C source files `*.mm`:
  ```
  src/qt/macdockiconhandler.mm
  src/qt/macnotificationhandler.mm
  src/qt/macos_appnap.mm
  ```

  Also the only occurrence of `Bitcoin Core Developers` replaced with ubiquitous `The Bitcoin Core developers`.

  EDITED:
  The reason to remove "Sam Rushing" is (on master):
  ```
  $ git grep "Sam Rushing"
  contrib/devtools/copyright_header.py:    "Sam Rushing\n",
  ```

ACKs for top commit:
  laanwj:
    code review ACK ca11606858

Tree-SHA512: 446c8fc569f732a6758e765f64110d9faeeffabb69088dd081d7bb730255c87196da96cea51081f4bd49280049fa4ed2ae22091059cb0f89bdc4ef8dd5e63cf0
2019-07-02 11:37:05 -04:00
João Barbosa
5c1b9714cb wallet: Fix -maxtxfee check by moving it to CWallet::CreateTransaction 2019-07-02 16:13:39 +01:00
Wladimir J. van der Laan
2f717fb5cd
Merge #15427: Add support for descriptors to utxoupdatepsbt
26fe9b9909 Add support for descriptors to utxoupdatepsbt (Pieter Wuille)
3135c1a2d2 Abstract out UpdatePSBTOutput from FillPSBT (Pieter Wuille)
fb90ec3c33 Abstract out EvalDescriptorStringOrObject from scantxoutset (Pieter Wuille)
eaf4f88734 Abstract out IsSegWitOutput from utxoupdatepsbt (Pieter Wuille)

Pull request description:

  This adds a descriptors argument to the `utxoupdatepsbt` RPC. This means:
  * Input and output scripts and keys will be filled in when known.
  * P2SH-witness inputs will be filled in from the UTXO set when a descriptor is provided that shows they're spending segwit outputs.

  This also moves some (newly) shared code to separate functions: `UpdatePSBTOutput` (an analogue to `SignPSBTInput`), `IsSegWitOutput`, and `EvalDescriptorStringOrObject` (implementing the string or object notation parsing used in `scantxoutset`).

ACKs for top commit:
  jnewbery:
    utACK 26fe9b9909
  laanwj:
    utACK 26fe9b9909 (will hold merging until response to promag's comments)
  promag:
    ACK 26fe9b9, checked refactors and tests look comprehensive. Still missing a release note but can be added later.

Tree-SHA512: 1d833b7351b59d6c5ded6da399ff371a8a2a6ad04c0a8f90e6e46105dc737fa6f2740b1e5340280d59e01f42896c40b720c042f44417e38dfbee6477b894b245
2019-07-02 16:53:22 +02:00
Wladimir J. van der Laan
c6e42f1ca9
Merge #14193: validation: Add missing mempool locks
fa2b083c3f [test] Add test to check mempool consistency in case of reorgs (MarcoFalke)
fabeb1f613 validation: Add missing mempool locks (MarcoFalke)
fa0c9dbf91 txpool: Make nTransactionsUpdated atomic (MarcoFalke)

Pull request description:

  Take the mempool read lock during reorgs, so that we don't accidentally read an inconsistent mempool.

ACKs for top commit:
  laanwj:
    code review ACK fa2b083c3f
  ryanofsky:
    utACK fa2b083c3f [EDIT: was ~e284e422e75189794e24fe482819d8b1407857c3~, from bad copy and paste]. Changes since last review: rebase after #15976, adding vTxHashes lock annotation, adding new commit dropping mempool lock for nTransactionsUpdated and making it atomic to avoid deadlock between mempool lock and g_best_block_mutex

Tree-SHA512: cfe7777993589087753e000e3736d79d320dca412383fb77b56bef8946a04049722bf888c11b6f722adf677165185c7e58b4a269f7c5fa25e84dda375f6c8a7d
2019-07-02 16:29:08 +02:00
Wladimir J. van der Laan
6c21a801f3
Merge #15538: wallet_bumpfee.py: Make sure coin selection produces change
276972cb95 wallet_bumpfee.py: Make sure coin selection produces change (Gregory Sanders)

Pull request description:

  I was hitting the case where change-less transactions were being made.

ACKs for top commit:
  ryanofsky:
    utACK 276972cb95

Tree-SHA512: e2b7a50363daddd3ee749cacfc9d3d685a6c0c7e3e48118bb60131d205bf83ea06cdd66b69dfa3bd4dbb3bbf2b5b673d7225171486ae72fc762e5dabe2c01ef5
2019-07-02 14:49:26 +02:00
Wladimir J. van der Laan
3ccab6470a
Merge #16212: addrdb: Avoid eating inodes - remove temporary files created by SerializeFileDB in case of errors
d9753383b9 addrdb: Remove temporary files created in SerializeFileDB. Fixes non-determinism in unit tests. (practicalswift)

Pull request description:

  Remove temporary files created in `SerializeFileDB` in case of errors.

  _Edit: Previously this was hit non-deterministically from the tests: that is no longer the case but the cleanup issue remains :-)_

ACKs for top commit:
  laanwj:
    code-review ACK d9753383b9

Tree-SHA512: e72b74b8de411f433bd8bb354cacae07ab75a240db6232bc6a37802ccd8086bff5275ce3d196ddde033d8ab9e2794bb8f60eb83554af7ec2e9f91d6186cb4647
2019-07-02 13:55:27 +02:00
Josu Goñi
db26e8e228 Add antialiasing to traffic graph widget 2019-07-02 07:26:40 +02:00
Steven Roose
8f250ab788
TEST: Replace hard-coded hex tx with classes 2019-07-01 18:06:01 +01:00
Wladimir J. van der Laan
1212808762
Merge #16257: [wallet] abort when attempting to fund a transaction above -maxtxfee
806b0052c3 [wallet] abort when attempting to fund a transaction above maxtxfee (Sjors Provoost)

Pull request description:

  `FundTransaction` calls `GetMinimumFee` which, when the fee rate is absurdly high, quietly reduces the fee to `-maxtxfee`.

  Becaue an absurdly high fee rate is usually the result of a fat finger, aborting seems safer behavior.

  Before:
  ```
  bitcoin-cli walletcreatefundedpsbt '[]' '[{"tb1q...": 0.01}]' 0 '{"feeRate": 10}' true
  {
    "psbt": "cHNidP8...gAA=",
    "fee": 0.10000000,
    "changepos": 1
  }

  ```

  After:
  ```
  bitcoin-cli walletcreatefundedpsbt '[]' '[{"tb1q...": 0.01}]' 0 '{"feeRate": 10}' true
  error code: -25
  error message:
  Fee exceeds maximum configured by -maxtxfee
  ```

  QT still checks the max fee rate as expected:
  <img width="566" alt="Schermafbeelding 2019-06-20 om 19 52 00" src="https://user-images.githubusercontent.com/10217/59888424-a2aa7100-9395-11e9-8ae6-8a3c1f7de585.png">

ACKs for top commit:
  laanwj:
    Code review ACK 806b0052c3

Tree-SHA512: bee95811711cdab100b614d2347921407af3b400aea613ca156953ed3f60b924ad29a1d335bd0e240c0b7c0fbb360226bab03294d226a5560cdf2a3f21e6d406
2019-07-01 16:03:37 +02:00
Tim Ruffing
f53a70ce95
Improve documentation of memory_cleanse()
So far, the documentation of memory_cleanse() is a verbatim copy of
the commit message in BoringSSL, where this code was originally
written. However, our code evolved since then, and the commit message
is not particularly helpful in the code but is rather of historical
interested in BoringSSL only.

This commit improves improves the comments around memory_cleanse()
and gives a better rationale for the method that we use. This commit
touches only comments.
2019-07-01 12:59:44 +02:00
nicolas.dorier
08c721dab2
[MSVC] Copy build output to src/ automatically after build 2019-07-01 19:16:19 +09:00
fanquake
b3edacb529
Merge #16309: [MSVC] allow user level project customization
c83f0ac9b2 [MSVC] allow user level project customization (nicolas.dorier)

Pull request description:

  This PR allow the user to customize the build process.

  For example with the following `common.init.vcxproj.user` file
  ```xml
  <?xml version="1.0" encoding="utf-8"?>
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
      <CLToolExe>clcache.exe</CLToolExe>
      <CLToolPath>C:\ProgramData\chocolatey\bin\</CLToolPath>
      <TrackFileAccess>false</TrackFileAccess>
    </PropertyGroup>
  </Project>
  ```
  I can use `clcache` while developing in visual studio.

ACKs for top commit:
  sipsorcery:
    tACK c83f0ac9b2.
  fanquake:
    ACK c83f0ac9b2. I did not test the customization.

Tree-SHA512: beef4ac97ed4e1ef46c358629101a008b7df81ca96f3ef7e0947788a6c295c1dddd00a93a09c1aa9daa68a6da0c4ab271aa5dd23df35f3fc8f453ee929e047f8
2019-07-01 16:32:52 +08:00
MarcoFalke
6e9eda5567
Merge #16271: build: remove -Wall from rapidcheck build flags
63d0a079e0 build: dont compile rapidcheck with -Wall (fanquake)

Pull request description:

  Fixes #16062.

  Remove `-Wall` from the rapidcheck build flags pre compilation.

  Discussed briefly with theuni.

ACKs for top commit:
  MarcoFalke:
    ACK 63d0a079e0 (checked that `RAPIDCHECK=1 make rapidcheck` fails without this)

Tree-SHA512: 6cb3653221c1eadbc8da54812298a061130b4377da6f63dcc2dfb97379d303b4db538e67f4fe3c96a03ee6a1e65840f0def0ac4e862553480c7ac4bdcc77e113
2019-06-30 12:11:09 -04:00
MarcoFalke
e7f3450b7d
Merge #16302: test: Add missing syncwithvalidationinterfacequeue to wallet_balance test
fa815255c7 test: Add missing sync_all to wallet_balance test (MarcoFalke)

Pull request description:

  A `syncwithvalidationinterfacequeue` should be sufficient.

  Fixes  #16020

ACKs for top commit:
  promag:
    ACK fa81525. This can be tested by adding sleep in `CWallet::BlockConnected` just before `LOCK(cs_wallet)` - master will always fail while this PR will succeed.

Tree-SHA512: 07e067c698627f90f0b9848f921b7067adc70c27105db3258e056384197e50dbee055c87839d238cc11bde11179d3f5879b39e1c8e15465f8f07558c694b677d
2019-06-30 11:24:55 -04:00
fanquake
fd925e9b1c
Merge #16313: doc: Fix broken link in doc/build-osx.md
90b5c4eefb doc: Fix broken link in doc/build-osx.md (Jon Atack)

Pull request description:

  This fixes the regression in PR #15964 as noted here:

  https://github.com/bitcoin/bitcoin/pull/15964/files#r298798933

ACKs for top commit:
  hebasto:
    ACK 90b5c4eefb. Provided link verified.
  fanquake:
    ACK 90b5c4eefb. Thanks.

Tree-SHA512: 2197809d37c357d36097839941ba3cee32e4d6ba2e4d609d99fb04286330d9dbcb89d6331fe1aa798fdb5964e522970f57b8ce0c2cb034b0f48b77b1d60e33e1
2019-06-30 08:58:22 +08:00
Hennadii Stepanov
ca11606858
Fix: "Bitcoin Core" -> "The Bitcoin Core" 2019-06-29 18:58:52 +03:00
Hennadii Stepanov
621463d7df
Drop no-longer-relevant copyright holder name 2019-06-29 18:50:39 +03:00
Hennadii Stepanov
01fafe55a1
Include Objective-C source files
The copyright_header.py script will process Objective-C source files 
(*.mm) as other ones.
2019-06-29 18:35:45 +03:00
Jon Atack
90b5c4eefb
doc: Fix broken link in doc/build-osx.md
This fixes the regression in PR #15964 as noted here:

https://github.com/bitcoin/bitcoin/pull/15964/files#r298798933
2019-06-29 16:32:36 +02:00
nicolas.dorier
c83f0ac9b2
[MSVC] allow user level project customization 2019-06-29 16:25:40 +09:00
fanquake
04710b6d8c
Merge #15964: Docs: Improve build-osx document formatting
dbd137a4ea Improve build-osx formatting (Giulio Lombardo)

Pull request description:

  This `PR` will improve `build-osx.md` formatting by:

  1. Updating Markdown syntax to the latest one
  2. Adding syntax highlighting to all code blocks
  3. Aligning the text up to `80` column guideline (before it was following different guidelines, sometime `80`, sometime `90`, etc.)
  4. Small grammar improvements here and there

ACKs for top commit:
  fanquake:
    ACK dbd137a4ea - Document reads and renders essentially the same as the current `build-osx.md`, with minor formatting / grammatical  changes.

Tree-SHA512: 47747991b5fddf0725c82f17f153e83150e51f698787544b4c51b32479989e4b550e2b3aec92979d2b0c76edfdcbbe7c4d9d0115df12e2bfde0cfcb277e9b984
2019-06-29 15:04:23 +08:00
fanquake
0f309541aa
Merge #16258: [MSVC]: Create the config.ini as part of bitcoind build
819c5ddad3 [MSVC] Enable Fuzz for functional tests (nicolas.dorier)
e47e79377f [MSVC]: Create the config.ini as part of bitcoind build (nicolas.dorier)

Pull request description:

  This remove the patchwork of powershell done in AppVeyor to the `AfterBuild` target of `bitcoind` so that windows developers do not have to figure out how to manually edit the config.ini before running the functional tests.

  You can easily test with `msbuild /t:AfterBuild` in bitcoind folder.

ACKs for top commit:
  sipsorcery:
    tACK 819c5dd.
  fanquake:
    ACK 819c5ddad3

Tree-SHA512: 657a3019532c6a3729310e52bfc2183cc805a406aab84cd83b0219e3ef8a6f208a3b1760317b41978d9dabb90fae0350e8cb00cf7e219b3bab04010ef1267a4b
2019-06-29 12:39:00 +08:00
Sjors Provoost
806b0052c3
[wallet] abort when attempting to fund a transaction above maxtxfee
FundTransaction calls GetMinimumFee which, when the fee rate is absurdly high, quietly reduced the fee to -maxtxfee. Becaue an absurdly high fee rate is usually the result of a fat finger, aborting seems safer behavior.
2019-06-28 22:44:38 -04:00
MarcoFalke
fa815255c7
test: Add missing sync_all to wallet_balance test 2019-06-28 11:19:37 -04:00
Wladimir J. van der Laan
935cd6b1ec
Merge #16300: util: Explain why the path is cached
fa69c3e6ca util: Explain why the path is cached (MarcoFalke)

Pull request description:

  The rationale for caching the datadir is given as

  ```
      // This can be called during exceptions by LogPrintf(), so we cache the
      // value so we don't have to do memory allocations after that.
  ```

  Since 8c2d695c4a, the debug log location is actually cached itself in `m_file_path`.

  So explain that the caching is now only used to guard against disk access on each call. (See also #16255)

ACKs for top commit:
  promag:
    ACK fa69c3e6ca.
  laanwj:
    ACK fa69c3e6ca
  ryanofsky:
    utACK fa69c3e6ca. Good cleanup. Previous comment was confusing, and definitely not helpful if outdated.

Tree-SHA512: 02108c90026d6d7c02843aaf59a06b4e1fa63d5d4378bb7760f50767efc340dc94c259bf7afb32fa4d47952b48a4e91798d1e0ddc1b051d770405e078636793a
2019-06-28 13:41:28 +02:00
nicolas.dorier
819c5ddad3
[MSVC] Enable Fuzz for functional tests 2019-06-28 16:43:56 +09:00
MarcoFalke
faa1e0fb17
qt: test: Create at most one testing setup 2019-06-27 16:47:23 -04:00
MarcoFalke
fa64b947bb
util: No translation of Bitcoin Core in the copyright 2019-06-27 15:06:46 -04:00
MarcoFalke
fa69c3e6ca
util: Explain why the path is cached 2019-06-27 14:42:06 -04:00
MarcoFalke
7400135b79
Merge #16278: tests: Remove unused includes
9a841696c1 tests: Reduce compilation time and unneccessary recompiles by removing unused includes in tests (practicalswift)

Pull request description:

  Reduce compilation time and unneccessary recompiles by removing unused includes in tests.

  A subset of #16273 ("refactor: Reduce total compilation time by 2% and avoid unnecessary recompiles by removing unused includes") as requested by MarcoFalke in https://github.com/bitcoin/bitcoin/pull/16273#issuecomment-505022643.

ACKs for top commit:
  Sjors:
    ACK 9a84169 on macOS 10.14.5 (I rebased on #16289)

Tree-SHA512: bcb6ecffef689a9839bee1a5cb93abe83db1f30819a54226c5630fee456b5a5d187507d06861454adfda939c3556a975113f97662e415cb47fa0327ea4fd09fb
2019-06-27 10:24:18 -04:00
MarcoFalke
3077f11dad
Merge #16289: test: Add missing ECC_Stop() in GUI rpcnestedtests.cpp
f466c4ce84 Add missing ECC_Stop(); in GUI rpcnestedtests.cpp (Jonas Schnelli)

Pull request description:

  Fixes #16288

  Was probably missing in #7783

ACKs for top commit:
  Sjors:
    ACK f466c4c. Tested by comparing `make check` on master and this PR with macOS 10.14.5. I also tried with and without `--enable-debug` / `--without-gui`.
  fanquake:
    ACK f466c4ce84. Tested running `make check` on macOS.

Tree-SHA512: 648e10c2e35bd01fb92e63709169a6c185ac4b62c69af0109d2cd2d7db47e56ae804c788f9a1a1845746f818764799732f9e58e9dbfca3bffeea8f14683c8c7f
2019-06-26 18:29:38 -04:00
practicalswift
0c78e49be3 tests: Switch one of the Travis jobs to an unsigned char environment (-funsigned-char) 2019-06-26 21:16:15 +02:00
practicalswift
9a841696c1 tests: Reduce compilation time and unneccessary recompiles by removing unused includes in tests 2019-06-26 20:37:48 +02:00
MarcoFalke
fab85208f6
qt: Run «make translate» in ./src/ 2019-06-26 11:02:04 -04:00
MarcoFalke
fabe87d2c9
scripted-diff: Avoid passing PACKAGE_NAME for translation
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/\<\w+(::\w+)?\(PACKAGE_NAME\)/PACKAGE_NAME/g' $(git grep -l --extended-regexp '\<\w+(::\w+)?\(PACKAGE_NAME\)' src)
-END VERIFY SCRIPT-
2019-06-26 11:01:57 -04:00
MarcoFalke
fa5e9f157e
build: Stop translating PACKAGE_NAME 2019-06-26 11:01:37 -04:00
practicalswift
c4606b8432 Add Travis check for single parameter constructors not marked "explicit" 2019-06-26 16:57:14 +02:00
MarcoFalke
1b28bca04c
Merge #16287: refactor: remove extra CBlockIndex declaration
9824a0d6e9 Remove extra CBlockIndex declaration (RJ Rybarczyk)

Pull request description:

  Remove duplicate `class CBlockIndex;` declaration.

ACKs for top commit:
  promag:
    ACK 9824a0d. Is this a random finding or you have searched for more similar cases?
  practicalswift:
    utACK 9824a0d6e9
  fanquake:
    ACK 9824a0d6e9

Tree-SHA512: aaf88450f53cb8859778102fe971b1121808819c04e64802e5a5cf47bf1403b42531361c52b097b41b905f9fa1bb7acc82b446cfa659c6ac41d00fab29e114e4
2019-06-26 09:15:57 -04:00
Jonas Schnelli
f466c4ce84
Add missing ECC_Stop(); in GUI rpcnestedtests.cpp 2019-06-26 11:28:07 +02:00
fanquake
ca80fec973
Merge #16286: refactoring: wallet: Fix GCC 7.4.0 warning
d8bd97d5ee Fix GCC 7.4.0 warning (Hennadii Stepanov)

Pull request description:

  Having #13756 and #16239 merged cause GCC warning:
  ```
  $ gcc --version
  gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
  ...
  $ make -j 4 > /dev/null
  wallet/wallet.cpp: In member function ‘CWallet::Balance CWallet::GetBalance(int, bool) const’:
  wallet/wallet.cpp:2269:45: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
       isminefilter reuse_filter = avoid_reuse ? 0 : ISMINE_USED;
                                   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  ```

  Fixed with this PR.

ACKs for top commit:
  practicalswift:
    utACK d8bd97d5ee
  promag:
    ACK d8bd97d.
  kallewoof:
    utACK d8bd97d5ee
  meshcollider:
    Trivial utACK d8bd97d5ee

Tree-SHA512: 2fb315ac82f290c8b9f4e48d1b4526b9babe0717c68593c7bc55cd6c289e64b6322aba72984f39291a9254b57d3f6ba8dbfe03799f510c0c1dc108b21b286732
2019-06-26 10:53:33 +08:00
RJ Rybarczyk
9824a0d6e9
Remove extra CBlockIndex declaration 2019-06-25 15:02:34 -04:00
Hennadii Stepanov
d8bd97d5ee
Fix GCC 7.4.0 warning
Warning: enumeral and non-enumeral type in conditional expression.
2019-06-25 20:18:12 +03:00