Commit graph

18226 commits

Author SHA1 Message Date
MarcoFalke
b4d3309673 scripted-diff: Use named arguments in feature_block
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e "s/sync_blocks\((.*?), (True|False), (1.?), /sync_blocks(\1, success=\2, reject_code=\3, reject_reason=/g" ./test/functional/feature_block.py
-END VERIFY SCRIPT-
2018-08-29 12:52:25 -04:00
MarcoFalke
749ba35e7c scripted-diff: Pass node into p2p_segwit acceptance tests
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/(test_witness_block|test_transaction_acceptance)\((self\.nodes\[.\])\.rpc/\1(\2/g' test/functional/p2p_segwit.py
-END VERIFY SCRIPT-
2018-08-29 12:52:25 -04:00
Wladimir J. van der Laan
4e9a6f87b7
Merge #14097: validation: Log FormatStateMessage on ConnectBlock error in ConnectTip
fa309dc305 validation: Log FormatStateMessage on ConnectBlock error in ConnectTip (MarcoFalke)

Pull request description:

  This change additionally logs the validation state on error, which is not logged at all on current master.

  Before:
  ```
  ERROR: ConnectTip(): ConnectBlock ffffff.... failed
  ```

  After:
  ```
  ERROR: ConnectTip: ConnectBlock ffffff.... failed, bad-cb-amount (code 16)
  ```

Tree-SHA512: e69ee0266772b3f77c0193c4a959c2444bf1a51259bd29d790cf665582b037997e520c8567f70b36362c071dcfe1a8ebd7c0f2286cf1b842df5731960e7e1ba0
2018-08-29 17:14:50 +02:00
Wladimir J. van der Laan
888acefa5e
Merge #13792: tx pool: Avoid passing redundant hash into addUnchecked (scripted-diff)
fa587773e5 scripted-diff: Remove unused first argument to addUnchecked (MarcoFalke)
fe5c49766c tx pool: Use the entry's hash instead of the one passed to addUnchecked (MarcoFalke)
ddd395f968 Mark CTxMemPoolEntry members that should not be modified const (MarcoFalke)

Pull request description:

  Several years ago the transaction hash was not cached. For optimization the hash was instead passed into `addUnchecked` to avoid re-calculating it. See f77654a0e9

  Passing in the hash is now redundant and the argument can safely be removed.

Tree-SHA512: 0206b65c7a014295f67574120e8c5397bf1b1bd70c918ae1360ab093676f7f89a6f084fd2c7000a141baebfe63fe6f515559e38c4ac71810ba64f949f9c0467f
2018-08-29 16:30:58 +02:00
practicalswift
75ea00f391 Remove unused fsbridge::freopen 2018-08-29 16:05:51 +02:00
practicalswift
cceedbc4bf Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) 2018-08-29 16:05:00 +02:00
MarcoFalke
1361f8babc
Merge #14020: Add tests for RPC help
6af6d9b23d test: Add tests for RPC help (João Barbosa)

Pull request description:

  At the moment the new test checks for:
   - invalid usages
   - expected output for unknown command
   - current RPC command titles (derived from command categories) — this prevents adding wrong RPC categories and new categories must be added to the test

Tree-SHA512: f987535d001b1cd300656588602b1634099ea68a1dd2282180c30fa56caf7f990be9e2dc86c7431dfcf7fd686d0299a8d4935df178a2c9f0fb6fbebcba748eb5
2018-08-29 09:33:17 -04:00
Wladimir J. van der Laan
b0eb8f7ed4
Merge #14028: Explicitly initialize prevector _union
1d9aa008d6 Explicitly initialize prevector _union (Ben Woosley)

Pull request description:

Tree-SHA512: 3037a5d63b840a4cb0c3c26593ce1b7e1a6ba273a4ee5072563b20169be9783dbdfe3a38c9651d73b2d18ed9668deaf65f994eca7f225c70f875716f05eda3a6
2018-08-29 15:13:45 +02:00
Wladimir J. van der Laan
5924dadc2f
Merge #13671: Remove the boost/algorithm/string/case_conv.hpp dependency
b193d5a443 Removes the Boost case_conv.hpp dependency. (251)
7a208d9fad Implements custom tolower and toupper functions. (251)
e2ba043b8d Implements ParseNetwork unit test. (251)

Pull request description:

  This pull request removes the `boost/algorithm/string/case_conv.hpp` dependency from the project.

  `boost/algorithm/string/case_conv.hpp` is included for the `boost::to_lower` and `boost::to_upper` template functions.

  We can replace the calls to these functions with straightforward alternative implementations that use the C++ Standard Library, because the functions are called with `std::string` objects that use standard 7-bit ASCII characters as argument.

  The refactored implementation should work without the explicit `static_cast<unsigned char>` cast and `unsigned char` lambda return type. Both have been added defensively and to be explicit. Especially in case of the former, behaviour is undefined (potentially result in a crash) if the `std::toupper` argument is not an `unsigned char`.

  A potential alternative, maybe even preferred, implementation to address the `boost::to_lower` function call in `ParseNetwork(std::string)` could have been:

  ```c++
  if (net == "ipv4" || net == "IPv4") return NET_IPV4;
  if (net == "ipv6" || net == "IPv6") return NET_IPV6;
  ```
  This alternative implementation would however change the external behaviour of `ParseNetwork(std::string)`.

  This pull requests includes a unit test to validate the implementation of `ParseNetwork(std::string)`  prior and after the removal of the `case_conv.hpp` dependency.

  `boost/algorithm/string/case_conv.hpp` has been removed from the `EXPECTED_BOOST_INCLUDES` in `test/lint/lint-includes.sh` because it is no longer required.

Tree-SHA512: d803ae709f2368a3efb223097384a722436955bce0c44a1a5cffd0abb3164be0cce85ba0e9ebd9408166df3f1a95ea0c0d29e3a2534af2fae206c0419d67fde9
2018-08-29 14:59:49 +02:00
Wladimir J. van der Laan
2ddce35abc
Merge #13862: utils: drop boost::interprocess::file_lock
1661a472b8 add unicode compatible file_lock for Windows (Chun Kuan Lee)

Pull request description:

  boost::interprocess::file_lock cannot open the files that contain characters which cannot be parsed by the user's code page on Windows.

  This PR is seperated from #13426 for easier review.

Tree-SHA512: e240479cda65958bf6e1319840b83928b2b50da81d99f4f002fb3b62621370bcd4bcfacd2b8c0678c443a650d6ba53d9d12618b591e5bfd67ac14388a18fd822
2018-08-29 14:16:13 +02:00
MarcoFalke
13887f41f2
Merge #14093: tests: Fix accidental trunction from int to bool
1cc58978b7 tests: Fix accidental trunction from int to bool (practicalswift)

Pull request description:

  Fix accidental trunction from `int` to `bool`.

  Context: https://github.com/bitcoin/bitcoin/pull/14086#issuecomment-416610313

Tree-SHA512: 72d209f892e580afa9c295174c206ea5ba764ff9e03613cd9bc57fd0d7118e895ee44d96db90930a29c0b4de7f51dc00101a1b32ba6b46576d34e089ff5482ba
2018-08-28 22:15:49 -04:00
MarcoFalke
fa309dc305
validation: Log FormatStateMessage on ConnectBlock error in ConnectTip 2018-08-28 21:49:23 -04:00
Wladimir J. van der Laan
5de338ec72
Merge #14055: fix walletcreatefundedpsbt deriv paths, add test
61fe653bd9 fix walletcreatefundedpsbt deriv paths, add test (Gregory Sanders)

Pull request description:

  Added the regression in #13968

Tree-SHA512: a31290b57ed80a8486925e562ca5412500d4215a238de7e448f48edfa671c87aebd79ee179a8340b289d9811ae6fa30ef75eefd5f5890fb6285174c5db72ff65
2018-08-28 23:11:15 +02:00
Jim Posen
f05599557a blockfilter: Omit empty scripts from filter contents.
Code change also avoids out-of-bounds script access bug.
2018-08-28 12:12:32 -07:00
MarcoFalke
8e9f851415
Merge #14052: qa: Add some actual witness in rpc_rawtransaction
fae040010d qa: Add some actual witness in rpc_rawtransaction (MarcoFalke)

Pull request description:

  The transaction was serialized with the witness flag but didn't include any witness, so add some dummy witness...

Tree-SHA512: fe71167c16e9b0053110be7c544e1ea08868f04ffee8d4c74887c9bcdcd5b59d5e8dd53c67e104a1bdbbf606202bc3fbef6017f402f2c75bdb2ebd9f7aabb2b1
2018-08-28 14:33:28 -04:00
251
b193d5a443 Removes the Boost case_conv.hpp dependency.
This commit removes the `boost/algorithm/string/case_conv.hpp` dependency from the project. It replaces the `boost::to_lower` and `boost::to_upper` functions with custom functions that are locale independent and ASCII deterministic.
2018-08-28 18:42:53 +02:00
251
7a208d9fad Implements custom tolower and toupper functions.
This commit implements custom equivalents for the C and C++ `tolower` and `toupper` Standard Library functions.
In addition it implements a utility function to capitalize the first letter of a string.
2018-08-28 18:42:27 +02:00
251
e2ba043b8d Implements ParseNetwork unit test.
This commit implements a unit test that validates the `ParseNetwork(std::string)` implementation in `netbase.cpp`.
2018-08-28 18:37:34 +02:00
practicalswift
1cc58978b7 tests: Fix accidental trunction from int to bool 2018-08-28 17:42:55 +02:00
Wladimir J. van der Laan
aa39ca7645
Merge #13723: PSBT key path cleanups
917353c8b0 Make SignPSBTInput operate on a private SignatureData object (Pieter Wuille)
cad5dd2368 Pass HD path data through SignatureData (Pieter Wuille)
03a99586a3 Implement key origin lookup in CWallet (Pieter Wuille)
3b01efa0d1 [MOVEONLY] Move ParseHDKeypath to utilstrencodings (Pieter Wuille)
81e1dd5ce1 Generalize PublicOnlySigningProvider into HidingSigningProvider (Pieter Wuille)
84f1f1bfdf Make SigningProvider expose key origin information (Pieter Wuille)
611ab307fb Introduce KeyOriginInfo for fingerprint + path (Pieter Wuille)

Pull request description:

  This PR adds "key origin" (master fingeprint + key path) information to what is exposed from `SigningProvider`s, allowing this information to be used by the generic PSBT code instead of having the RPC pull it directly from the wallet.

  This is also a preparation to having PSBT interact with output descriptors, which can then directly expose key origin information for the scripts they generate.

Tree-SHA512: c718382ba8ba2d6fc9a32c062bd4cff08b6f39b133838aa03115c39aeca0f654c7cc3ec72d87005bf8306e550824cd8eb9d60f0bd41784a3e22e17b2afcfe833
2018-08-28 16:25:04 +02:00
practicalswift
ca1a093127 Add regression test: Don't assert(...) with side effects 2018-08-28 14:28:14 +02:00
Wladimir J. van der Laan
ee9e6e7c5f
Merge #14051: [Tests] Make combine_logs.py handle multi-line logs
16e288acdd test padding non micro timestamps (John Newbery)
995dd89d88 [Tests] Make combine_logs.py handle multi-line logs (John Newbery)

Pull request description:

  combine_logs.py currently inserts additional newlines into multi-line
  log messages, and doesn't color them properly. Fix both of those.

Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
2018-08-28 10:45:31 +02:00
practicalswift
4c3c9c3869 Don't assert(...) with side effects 2018-08-28 10:22:28 +02:00
Hennadii Stepanov
8550f1fb28
Add README.md to linux release tarballs
fix #8160
2018-08-28 00:33:37 +03:00
John Newbery
16e288acdd test padding non micro timestamps 2018-08-27 14:31:44 -04:00
MarcoFalke
0df9b0aed2
Merge #14042: travis: add CXXFLAGS=-Wno-psabi at ARM job
4c530e0102 travis: add  CXXFLAGS=-Wnopsabi at ARM job (Chun Kuan Lee)

Pull request description:

  Disable annoying ABI warnings

Tree-SHA512: 2f98c67c2a1a67f7e05c81ce82783b44083876709209f569d0b1162355b9bb0bd354769c36289bea7f707b002b42d71274f7d9f3c18401b67b404eb7b76c6eea
2018-08-27 14:00:40 -04:00
MarcoFalke
fea4e9eca5
Merge #13767: Remove redundant assignments (dead stores)
dd777f3e12 Remove unused variable (practicalswift)
cdf4089457 Remove redundant assignments (dead stores) (practicalswift)

Pull request description:

  Remove redundant assignments (dead stores).

Tree-SHA512: e852059b22a161c34a0f18a6a6ed798e2b35e6d2b9f23c526af0ec33e01f6a5bb1fa5ada6671ba183d7b02393ff0d397be5aa4b4e2edbd5e604c9a76ac48d249
2018-08-27 13:39:46 -04:00
MarcoFalke
dd34204611
Merge #13769: Mark single-argument constructors "explicit"
1ac3c983bf Mark single-argument constructors "explicit" (practicalswift)

Pull request description:

  Mark single-argument constructors `explicit`.

  Rationale:
  * Avoid unexpected implicit promotions.

  From the developer notes:

  > **By default, declare single-argument constructors explicit.**
  > Rationale: This is a precaution to avoid unintended conversions that might arise when single-argument constructors are used as implicit conversion functions.

Tree-SHA512: 7901ed5be808c9d0ecb5ca501e1bc0395987fe1b7941b8548cebac2ff08a14f7dab61fab374a69b9ba29a9295a04245c814325c7f95b97ae558af0780f111dfa
2018-08-27 13:33:04 -04:00
Chun Kuan Lee
4c530e0102 travis: add CXXFLAGS=-Wnopsabi at ARM job 2018-08-28 01:15:30 +08:00
Chun Kuan Lee
1661a472b8 add unicode compatible file_lock for Windows
boost::interprocess::file_lock cannot open the files that contain characters which cannot be parsed by the user's code page on Windows.
This commit add a new class to handle those specific file for Windows.
2018-08-28 00:55:13 +08:00
Ben Woosley
1d9aa008d6
Explicitly initialize prevector _union 2018-08-27 09:50:13 -07:00
practicalswift
f34c8c466a Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations. 2018-08-27 18:19:33 +02:00
Wladimir J. van der Laan
f180e81d57
Merge #14023: Remove accounts rpcs
bb08423d5c [doc] Add release notes for 'account' API removal (John Newbery)
1f4b865e57 [wallet] Re-sort wallet RPC commands (John Newbery)
f0dc850bf6 [wallet] Remove wallet account RPCs (John Newbery)
c410f41575 [tests] Remove wallet accounts test (John Newbery)

Pull request description:

  This is the first part of #13825. It simply removes the RPC methods and tests.

  #13825 touches lots of files and will require frequent rebasing.

  Breaking it down for easier reviewing and fewer rebases.

Tree-SHA512: d29af8e7a035e4484e6b9bb56cb86592be0ec112d8ba4ce19c15d15366ff3086e89e99fca26b90c9d66f6d3e06894486d0f29948df0bb7dcb1e2c49c6887a85a
2018-08-27 17:54:09 +02:00
John Newbery
bb08423d5c [doc] Add release notes for 'account' API removal 2018-08-27 10:45:03 -04:00
John Newbery
1f4b865e57 [wallet] Re-sort wallet RPC commands
This wasn't done in previous commit to make diff more reviewable.
2018-08-27 10:45:03 -04:00
John Newbery
f0dc850bf6 [wallet] Remove wallet account RPCs
Also remove the RPC deprecation tests for accounts, and make one small
change to another wallet test that relies on account behaviour.
2018-08-27 10:45:01 -04:00
MarcoFalke
794e55be10
Merge #14081: travis: fix missing differentiation between UNIT and FUNCTIONAL tests
c55c5f2b17 fix missing differentiation between UNIT and FUNCTIONAL tests in travis build (Julian Fleischer)

Pull request description:

  @MarcoFalke follow up to https://github.com/bitcoin/bitcoin/pull/13863

  I must have missed the separation of `RUN_FUNCTIONAL_TESTS` and `RUN_UNIT_TESTS` when doing the rebase. Fixed the two places you mentioned accordingly.

Tree-SHA512: 43d14cb16fe72f77c5a142509fb59849e32b58a12565a752e8b4e36282eb74f796b97140d9a64e1ba0d0409d07107f77fd84aaddf87617470f19ff0dd332dd58
2018-08-27 10:23:51 -04:00
Julian Fleischer
c55c5f2b17 fix missing differentiation between UNIT and FUNCTIONAL tests in travis build 2018-08-27 16:14:42 +02:00
MarcoFalke
ca4510c15d
Merge #13863: travis: move script sections to files in .travis/ subject to shellcheck
414326952c use export LC_ALL=C.UTF-8 (Julian Fleischer)
728c82d029 make script exit if a command fails (Julian Fleischer)
506890b24d move remaining travis build steps into individual files (Julian Fleischer)
272306ea57 number .travis/ script according to build lifecycle and add README to explain (Julian Fleischer)
519e2739cf move lint stage up to resemble travis build ui (Julian Fleischer)
86d34f0e65 abort script in END_FOLD on non-zero exit code (Julian Fleischer)
4f2f88c7b0 move script sections info individual files and comply with shellcheck (Julian Fleischer)

Pull request description:

  This PR is extracted from https://github.com/bitcoin/bitcoin/pull/13816 to make that one easier to review. It follows on https://github.com/bitcoin/bitcoin/pull/13849 and https://github.com/bitcoin/bitcoin/pull/13851

  In here the shell script parts from `travis.yml` are extracted into `.travis/before_install.sh`, `.travis/install.sh`, `.travis/before_script.sh`, `.travis/script.sh`, and `.travis/lint.sh`.

  This has the benefit that `test/lint/lint-shell.sh` will also shellcheck these parts. Also it makes the individual script parts more readable.

Tree-SHA512: c497e1687ceb1c1d795de177d3fc35af908bc8e3f781a871afabdecf031e581d4db229290627249e35ef7c09952bc34884e4734ea91d40f57b4a9efb85bba2e3
2018-08-27 09:34:20 -04:00
John Newbery
c410f41575 [tests] Remove wallet accounts test
The accounts API will be removed in the next commit. Remove all
functional tests for the accounts API.
2018-08-27 09:34:01 -04:00
MarcoFalke
51a73c9862
Merge #13935: contrib: Adjust output to current test format
a9910d82c3 contrib: Adjust output to current test format (Akio Nakamura)

Pull request description:

  This PR makes  the output of ```gen_base58_test_vectors.py``` to fit to current test format.
  The test has already been changed(separated) from ```base58_test``` to ```key_io_test```, so change the file name of this script as well.

  (This will solve #13553 )

Tree-SHA512: 2986009acd734edd5b6ee0a5efed9e8d156c99b1919a0e9f6ffdd4c863f52f4d1c6bfdaca359937ea380e311dda559d96449fc6a7224092c1fb2517ee5b83369
2018-08-27 07:36:14 -04:00
MarcoFalke
6667490466
Merge #13987: Report minfeefilter value in getpeerinfo rpc
5778bf95d9 Report minfeefilter value in getpeerinfo rpc (Anthony Towns)

Pull request description:

  Lowering the minimum relay fee is only useful when many nodes in the p2p network also lower the fee, so to make it easier to understand progress on that front, this includes the value of the minfeefilter in getpeerinfo, so you at least have visibility to what fees your neighbours are currently accepting.

Tree-SHA512: 059f01bf2a32c98fce1648a13b7898701203b354d0209ee34e6683994b720eb594cf24968e66b699caae5e17e53d351e73281f042dd094decde14d3a318e9fb3
2018-08-27 07:28:38 -04:00
Akio Nakamura
a9910d82c3 contrib: Adjust output to current test format
Ajust the outputs of gen_base58_test_vectors.py to current test format.

1. Add bech32 vector generation.
2. Add Script-fragments to hexrepr in the format expected by the test.
3. Modify the metadata.
  1) Change 'isTestnet' to 'chain' (main/test/regtest)
  2) Remove 'addrType'
  3) Add 'tryCaseFlip' (True/False on bech32)
2018-08-27 20:14:47 +09:00
Anthony Towns
5778bf95d9 Report minfeefilter value in getpeerinfo rpc
Lowering the minimum relay fee is only useful when many nodes in the
p2p network also lower the fee, so to make it easier to understand
progress on that front, this includes the value of the minfeefilter in
getpeerinfo, so you at least have visibility to what fees your neighbours
are currently accepting.
2018-08-27 21:13:15 +10:00
Wladimir J. van der Laan
e13a820f99
Merge #13861: test: Add testing of value_ret for SelectCoinsBnB
384273260a test: Add testing of value_ret for SelectCoinsBnB (Ben Woosley)

Pull request description:

  Fix that the early bailout optimization tests did not test the intended
  selection because their utxo pool was polluted by the make_hard_case test
  preceding. Note the code was tested, just not with the constructed case.

Tree-SHA512: 95f665525f5922f70f4c17708c0c09900f38d7a652b5bdd817e017ba7ff2865a6234edbd340064ffccc20d34048c45df86a4ac5f46dd8f4aab98834e71dc9d3c
2018-08-27 12:47:20 +02:00
Wladimir J. van der Laan
4a1a2148f6
Merge #14030: Remove ambiguity in construction of prevector
497e90c02b Remove default argument to prevector constructor to remove ambiguity (Ben Woosley)

Pull request description:

  The call with this default argument is redundant with `prevector(size_type)` on line 251.

Tree-SHA512: 4d22e6f4cd56e4b700596d7f5afc945ec6684636a94690fa16a1bbb34e4f53b6340f53a6c314fea213359426474125228ba7193388789f8a13308506358e92db
2018-08-27 12:23:48 +02:00
Julian Fleischer
414326952c use export LC_ALL=C.UTF-8 2018-08-27 12:23:25 +02:00
Julian Fleischer
728c82d029 make script exit if a command fails 2018-08-27 12:23:25 +02:00
Julian Fleischer
506890b24d move remaining travis build steps into individual files 2018-08-27 12:23:25 +02:00
Julian Fleischer
272306ea57 number .travis/ script according to build lifecycle and add README to explain 2018-08-27 12:23:25 +02:00