Commit graph

18351 commits

Author SHA1 Message Date
John Newbery c9c32e6b84 [wallet] Kill accounts
This commit does the following changes:

- [wallet] Remove 'account' argument from GetLegacyBalance()
  - GetLegacyBalance() is never called with an account argument.
    Remove the argument and helper functions.
- [wallet] Remove CWallet::ListAccountCreditDebit()
  - Function no longer used.
- [wallet] Remove AccountMove()
  - Function no longer used.
- [wallet] Remove AddAccountingEntry()
  - Function no longer used.
- [wallet] Remove GetAccountCreditDebit()
  - Function no longer used.
- [wallet] Don't rewrite accounting entries when reordering wallet transactions.
 - Accounting entries are deprecated. Don't rewrite them to the wallet
   database when re-ordering transactions.
- [wallet] Remove WriteAccountingEntry()
  - Function no longer used.
- [wallet] Don't read acentry key-values from wallet on load.
- [wallet] Remove ListAccountCreditDebit()
  - Function no longer used.
- [wallet] Remove CAccountingEntry class
  - No longer used
- [wallet] Remove GetLabelDestination
  - Function no longer used.
- [wallet] Delete unused account functions
  - ReadAccount
  - WriteAccount
  - EraseAccount
  - DeleteLabel
- [wallet] Remove fromAccount argument from CommitTransaction()
- [wallet] Remove strFromAccount.
  - No longer used.
- [wallet] Remove strSentAccount from GetAmounts().
  - No longer used.
- [wallet] Update zapwallettxes comment to remove accounts.
- [wallet] Remove CAccount
  - No longer used
- [docs] fix typo in release notes for PR 14023
2018-08-30 16:08:42 +02:00
Wladimir J. van der Laan a66c0f78a9 util: Report parse errors in configuration file
Report errors while parsing the configuration file, instead of silently
ignoring them.

    $ src/bitcoind -regtest
    Error reading configuration file: parse error on line 22: nodebuglogfile, if you intended to specify a negated option, use nodebuglogfile=1 instead
    $ src/bitcoind -regtest
    Error reading configuration file: parse error on line 22: sdafsdfafs
    $ src/bitcoind -regtest
    Error reading configuration file: parse error on line 24: -nodebuglogfile=1, options in the configuration file must be specified without leading -
2018-08-30 14:41:33 +02:00
MarcoFalke 6c7cfc8da6
Merge #13126: util: Add Clang thread safety annotations for variables guarded by cs_args
1e29379d69 Fix potential deadlock (practicalswift)
d58dc9f943 Add lock annotations (cs_args) (practicalswift)
db5e9d3c88 Add missing locks (cs_args) (practicalswift)

Pull request description:

  * Add missing `cs_args` locks
  * Add Clang thread safety annotations for variables guarded by `cs_args`

Tree-SHA512: bc562dbddf24a287bcf9bf902bc930f942f260a94e5c8ec4d190f7f2ddac448ed3d52acadaf9fc1c81a5cbff2c171c52c18ba0804eeb03f699d70394e1c977c5
2018-08-30 07:52:55 -04:00
Wladimir J. van der Laan be301a5777
Merge #14103: docs: Fix broken Doxygen comments
0e534d4dca Fix incorrect Doxygen comments (practicalswift)

Pull request description:

  Fix broken Doxygen comments.

  This commit was taken from #13914 which now only covers `-Wdocumentation`.

Tree-SHA512: dddbca16bb792b8193e5f417151b5eace9acc942a321f1bc095b906e98889e3bd93509fe112ab6a24ee1f6a3a918db905bda7acefd53774fe3e6ebe669fb51ac
2018-08-30 12:00:28 +02:00
practicalswift 1e29379d69 Fix potential deadlock 2018-08-30 10:02:49 +02:00
practicalswift d58dc9f943 Add lock annotations (cs_args) 2018-08-29 22:33:33 +02:00
practicalswift db5e9d3c88 Add missing locks (cs_args) 2018-08-29 20:57:41 +02:00
MarcoFalke fa782a308d
qa: Use named args in some tests 2018-08-29 13:06:02 -04:00
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 f7e9e70468 [rpc] Remove deprecated sigrawtransaction rpc method. 2018-08-27 14:36:12 -04:00
John Newbery 90c834089a [RPC] Remove warning about wallet addresses in createmultisig()
createmultisig() was updated in V0.16 to not use the wallet. Warning
text was included to warn the user. Remove that now.
2018-08-27 14:36:12 -04:00
John Newbery df905e390e [rpc] Remove deprecated validateaddress usage. 2018-08-27 14:36:08 -04: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
Chris Stewart b2f49bd732 Integration of property based testing into Bitcoin Core
update copyright headers

attempt to fix linting errors

Fixing issue with make check classifying generator files as actual unit tests

Wrapping gen files in ENABLE_PROPERTY_TESTS macro

Make macro better
2018-08-27 08:51:51 -05:00