Commit graph

12248 commits

Author SHA1 Message Date
Wladimir J. van der Laan 13c842e028
Merge #9332: Let wallet importmulti RPC accept labels for standard scriptPubKeys
98ea64cf23 Let wallet importmulti RPC accept labels for standard scriptPubKeys (Russell Yanofsky)

Pull request description:

  Allow importmulti RPC to apply address labels when importing standard scriptPubKeys. This makes the importmulti RPC less finnicky about import formats and also simpler internally.

Tree-SHA512: 102426b21239f1fa5f38162dc3f4145572caef76e63906afd786b7aff1670d6cd93456f8d85f737588eedc49c11bef2e1e8019b8b2cbf6097c77b3501b0cab1f
2018-09-10 19:02:44 +02:00
Wladimir J. van der Laan e0a4f9de7f
Merge #13793: tx pool: Use class methods to hide raw map iterator impl details
faa1a74942 tx pool: Use class methods to hide raw map iterator impl details (MarcoFalke)

Pull request description:

  ATMP et al would often use map iterator implementation details such as `end()` or `find()`, which is acceptable in current code.

  However, this not only makes it impossible to turn the maps into private members in the future but also makes it harder to replace the maps with different data structures.

  This is required for and split off of #13804

Tree-SHA512: 4f9017fd1d98d9df49d25bba92655a4a97755eea161fd1cbb565ceb81bbc2b4924129d214f8a29563a77e3d8eef85a67c81245ecdc9a9e5292d419922a93cb88
2018-09-10 18:32:00 +02:00
Wladimir J. van der Laan 838b85e120
Merge #14008: Preserve a format of RPC command definitions
d9d79576f4 Preserve a format of RPC command definitions (Kostiantyn Stepaniuk)

Pull request description:

  Currently, RPC commands are formatted in a way that it's easy to read
  and that `test/lint/check-rpc-mappings.py` can parse it.

  To void breaking `test/lint/check-rpc-mappings.py` script by running
  `clang-format`, RPC command definitions should be disabled for clang-format.

Tree-SHA512: e17d20ec0e6c4e19410198b55687ebbe6fa01654d214d4578cd16c00b872bf8b0b306594a45523685cd2e9d9280702e00471d9366e87954428e8bbeacd8cad60
2018-09-10 18:14:05 +02:00
Wladimir J. van der Laan 7c7bb6e772
Merge #14127: build: avoid getifaddrs when unavailable
9256f7d13f build: avoid getifaddrs when unavailable (Cory Fields)

Pull request description:

  These changes from @theuni help building when targeting platforms that don't always have getifaddrs available like Android < 24

Tree-SHA512: dbfeb83297bd6f00b7991f53eef8a04948d2d739bf47c0524d9ae5335b843b8a5c06ff98c109fe5e6192665e6d0cf58700b8aa7e2a0b410281d3c052881973ff
2018-09-10 18:08:05 +02:00
Wladimir J. van der Laan 6eeac2e628
Merge #14138: wallet: Set encrypted_batch to nullptr after delete. Avoid double free in the case of NDEBUG.
fa462b3657 wallet: Set encrypted_batch to nullptr after delete. Avoid double free in the case of NDEBUG. (practicalswift)

Pull request description:

  Set `encrypted_batch` to `nullptr` after delete. Avoid double free in the case of `NDEBUG`.

Tree-SHA512: 6f5ab40c82dd8c8713bbf1aacacdc837277c04769807f985248546be1c7ea269813c95379fbef982ac5683a45af0225613460a7446c39673b033f5f5edde2f5a
2018-09-10 17:59:15 +02:00
Wladimir J. van der Laan 321075609d
Merge #14054: p2p: Disable BIP 61 by default
faea5bfc5a doc: release notes for -enablebip61 default change (MarcoFalke)
fa14b54a87 p2p: Disable BIP 61 by default (MarcoFalke)

Pull request description:

  The live p2p network should not be used for debugging or as development aid when implementing the p2p protocol. Instead, applications should be tested locally (e.g. by inspecting the debug log of a validating node on the local network)

  Using the p2p network for this purpose seems wasteful and even dangerous, as peers can not be trusted to send the correct reject messages or a reject message at all.

Tree-SHA512: 9c91ad035b5110942172a3b4b8a332a84e0c0aa9ee80f8134aeab63e66ac604841e68b04038681c288b716e5e0cbe38065eb5c7eb63fa72c3bdb3255a4b2d99d
2018-09-10 17:57:47 +02:00
MarcoFalke 793d2b7430
Merge #14164: Update univalue subtree
dc287c98f8 Squashed 'src/univalue/' changes from 51d3ab34ba..7890db99d6 (MarcoFalke)

Pull request description:

  This removes the deprecated `std::pair` wrappers from univalue, so that they are not accidentally re-introduced in our code base.

Tree-SHA512: 46f6f7c7c7942a9e131d971c425cbde4159abcc1214235b61139ce97b174024e47b9c52e832cde89fbab9879f43d12c26b64d6def9907bd47883f1e574cf2e2e
2018-09-10 11:00:46 -04:00
Wladimir J. van der Laan fbfa2e46ff
Merge #14057: [Logging] Only log "Using config file PATH_TO_bitcoin.conf" message on startup if conf file exists
946107a68f Only log "Using PATH_TO_bitcoin.conf" message on startup if conf file exists. (Alexander Leishman)

Pull request description:

  Currently we log a message indicating that a bitcoin.conf file is being used even if one does not exist. This PR changes the logic to:

  **If config file does not exist and no -conf flag passed, log:**
  `Config file: FILE_PATH (not found, skipping)`. Where `FILE_PATH` is the default or the path passed in with the `-conf` flag.

  **If config file does not exist and -conf flag passed with incorrect path, log warning:**
  `Warning: The specified config file FILE_PATH does not exist`

  **If config file exists, log**:
  `Config file: FILE_PATH`

  Note: This is a (modified) subset of changes introduced in https://github.com/bitcoin/bitcoin/pull/13761 which creates a default example config file. I think it makes sense to extract this small bit out into a separate PR.

Tree-SHA512: be0f0ae6a0c9041e2d6acb54d2563bbcc79786fb2f8bf9a963fe01bc54cd4e388b89079fde1eb79f7f17099776428e5e984bf7107590a3d1ecfc0562dbc6e3f5
2018-09-10 15:39:05 +02:00
Michael Polzer bc8aa2ba78
don't translate command line options 2018-09-10 13:08:25 +02:00
Wladimir J. van der Laan eea87ef537
Merge #12775: Integration of property based testing into Bitcoin Core
b2f49bd732 Integration of property based testing into Bitcoin Core (Chris Stewart)

Pull request description:

  This PR is a subset of the changes in #8469. It's meant to be easier to review. This PR contains all of the build instructions needed for travis to pass. It includes one property call `key_properties.cpp` along with a generator file called `crypto_gen.{h,cpp}`.

Tree-SHA512: 895c9d9273dcd29f696b1de8dfe1ee843095831bf1f68472844181278850bec36b20f0ba7e51e796112c5cc75cd24759f9f1771906503bbf3af16f627e18c6c9
2018-09-08 05:33:16 +02:00
MarcoFalke fb06eb4ef7
Merge #13662: Explain when reindex-chainstate can be used instead of reindex
65a449f8e3 Explain when reindex-chainstate can be used instead of reindex (Sjors Provoost)

Pull request description:

  Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711

Tree-SHA512: 3128565d037c77265a2ecf3bce137b8d27740f513802a4e683be06f21a75b82ee6cc22eb903181c4f438a2990cb682ce1d076f4d3af33d5aaa79b783a9f664b1
2018-09-07 14:21:38 -04:00
MarcoFalke faa1a74942
tx pool: Use class methods to hide raw map iterator impl details 2018-09-07 13:04:02 -04:00
MarcoFalke faad55a9a2
Update univalue subtree 2018-09-07 08:21:14 -04:00
MarcoFalke fa14b54a87
p2p: Disable BIP 61 by default 2018-09-07 08:11:27 -04:00
MarcoFalke 4799b0932a
Merge #12490: [Wallet] [RPC] Remove deprecated wallet rpc features from bitcoin_server
f7e9e70468 [rpc] Remove deprecated sigrawtransaction rpc method. (John Newbery)
90c834089a [RPC] Remove warning about wallet addresses in createmultisig() (John Newbery)
df905e390e [rpc] Remove deprecated validateaddress usage. (John Newbery)

Pull request description:

  The following rpc features were deprecated in V0.17:

  - `validateaddress` returning wallet information about an address
  - `signrawtransaction`

  This PR fully removes those features. It can be merged once V0.17 has been branched from master.

Tree-SHA512: 28293d218cf7e348632081e362f8775f243d091f49aed54c354f017d4a12ae92b87b99f81ee592a1bbf4aebd5d8cd5119278141edde7a0399ff82917ed68b9f6
2018-09-06 23:01:50 -04:00
Wladimir J. van der Laan 2f7ae35ce8
Merge #14149: doc: Remove misleading checkpoints comment in CMainParams
fab5267514 doxygen: Remove misleading checkpoints comment in CMainParams (MarcoFalke)

Pull request description:

  This removes the checkpoints comment because it is misleading for two reasons:

  * It shows up in the doxygen documentation of `CMainParams` https://dev.visucore.com/bitcoin/doxygen/class_c_main_params.html
  * The comment refers to "strange transactions" in a block, which are not specified further. Transactions in blocks are always consensus-valid or rejected as consensus-invalid.

  Also sort the includes with `clang-format`, as the file is touched anyway.

Tree-SHA512: b75f38dd0422b9310218307cbaa4dd5afa7579612d7dcdf781b8f25626f79c11e090dbcc83a05571f4418220c1a005f6254a9c461534d517ccecf7f1920be6be
2018-09-06 15:55:13 +02:00
Wladimir J. van der Laan 35d7d9471f
Merge #14096: Add reference documentation for descriptors language
2b5d6f8df2 Replace duplcate reference with reference to reference doc (Pieter Wuille)
89709db7a2 Adjust TODO link (Pieter Wuille)
9254ffcf2d Add descriptor reference documentation (Pieter Wuille)

Pull request description:

Tree-SHA512: 1ca0d537f9bcbb23266e9a4a02a60013ef8309958fb701f638283887585b5ddea6bc9dab859454ec3a373b1a12a4fd69836e7030417bb2ca43fef26b104c0d65
2018-09-06 14:51:07 +02:00
Wladimir J. van der Laan a6aca8dc2f
Merge #14105: util: Report parse errors in configuration file
ed2332aeff test: Add test for config file parsing errors (MarcoFalke)
a66c0f78a9 util: Report parse errors in configuration file (Wladimir J. van der Laan)

Pull request description:

  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 -

  (inspired by https://github.com/bitcoin/bitcoin/pull/14100#issuecomment-417264823)

Tree-SHA512: d516342b65db2969edf200390994bbbda23654c648f85dcc99f9f2d217d3d59a72e0f58227be7b4746529dcfa54ba26d8188ba9f14a57c9ab00015d7283fade2
2018-09-06 12:56:10 +02:00
MarcoFalke adf27b531a
Merge #13954: Warn (don't fail!) on spelling errors. Fix typos reported by codespell.
f8a81f73ac lint: Add spell check linter (codespell) (practicalswift)
ada356208e Fix typos reported by codespell (practicalswift)

Pull request description:

  * Check for common misspellings using `codespell`.
  * Fix recently introduced typos reported by `codespell`.

Tree-SHA512: 9974c0e640b411c7d0ebc5b45de253c19bac7fe3002cd98601ff8da8db584224c2fd7d331aee3df612c9f2cfef540d647a9b4c5a1a73fd208dc93ce4bf9e5e3e
2018-09-05 18:13:05 -04:00
Pieter Wuille 2b5d6f8df2 Replace duplcate reference with reference to reference doc 2018-09-05 11:27:43 -07:00
Pieter Wuille 89709db7a2 Adjust TODO link 2018-09-05 11:26:16 -07:00
Wladimir J. van der Laan e9a78e9b3b doc: Change documentation for =0 for non-boolean options
PR #12713 changed the interpretation for negation of non-boolean options
(e.g. -noconnect) to no longer set the option to 0, but to remove it
from the options.

I think this is better because it gets rid of the special meaning of
'0'.

However it needs to be documented. I attempt to do so in this PR.
Addreses #14064.
2018-09-05 14:18:23 +02:00
MarcoFalke fab5267514
doxygen: Remove misleading checkpoints comment in CMainParams 2018-09-04 13:42:42 -04:00
Wladimir J. van der Laan 5c24d3b98c
Merge #13249: Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations.
f34c8c466a Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations. (practicalswift)

Pull request description:

  Make objects in range declarations immutable by default.

  Rationale:
  * Immutable objects are easier to reason about.
  * Prevents accidental or hard-to-notice change of value.

Tree-SHA512: cad69d35f0cf8a938b848e65dd537c621d96fe3369be306b65ef0cd1baf6cc0a9f28bc230e1e383d810c555a6743d08cb6b2b0bd51856d4611f537a12e5abb8b
2018-09-04 15:50:08 +02:00
Wladimir J. van der Laan bdfeb5dfa8
Merge #14133: gui: Favor macOS show / hide action in dock menu
ee3a494f37 gui: Favor macOS show / hide action in dock menu (João Barbosa)

Pull request description:

  Before:

  <img width="188" alt="screen shot 2018-09-02 at 19 10 02" src="https://user-images.githubusercontent.com/3534524/44959393-5a44c400-aee5-11e8-90f4-9a30f67f7ee2.png">

  After:

  <img width="200" alt="screen shot 2018-09-02 at 19 19 01" src="https://user-images.githubusercontent.com/3534524/44959395-60d33b80-aee5-11e8-9773-1d04d3482115.png">

  Note that macOS toggles between `Hide` and `Show`.

Tree-SHA512: e616fabc5a4689355d924cb99ce33c0d4c6618e858002cef7521dc4783346ff882341cf8d7f667d7fb920a8337373eff37169cddc2da93e48f7710e5c41d0b93
2018-09-04 14:07:45 +02:00
practicalswift ada356208e Fix typos reported by codespell 2018-09-04 13:11:26 +02:00
Wladimir J. van der Laan 0f34dac67b
Merge #14013: [doc] Add new regtest ports in man following #10825 ports reattributions
e8c4a1e369 Add new regtest ports in doc following #10825 ports reattributions (Antoine Riard)

Pull request description:

  Following #10825, regtest ports for p2p connections and JSON-RPC connections have been remapped from 18333 and 18332 to 18444 and 18443. This change is not documented in the wiki or nowhere else and it's puzzling to guess why your regtest JSON-rpc connections all failed even if you're following the docs.

Tree-SHA512: e2a1b9b4059060d9ed0900c1554e124ed69ae3e4648474880795128e77c7324d68aba52e4acda2f47390a9c3d36629b777e3b8c0eb10f0e08a2b120c4119dff3
2018-09-04 12:51:06 +02:00
Wladimir J. van der Laan 564385f4bf
Merge #14094: refactoring: Remove unreferenced local variables
8ecaee13f7 Increase signal to noise in appveyor build output by reducing the MSVC warning count from 12 to 4 (12 is assuming the changes in #14086 are also implemented). (practicalswift)

Pull request description:

  Remove unreferenced local variables:

  Increase signal to noise in appveyor build output by reducing the MSVC warning count from 12 to 4. 12 is the number of MSVC warnings under our current appveyor setup assuming the changes in #14086 are also implemented.

  This makes it easier to spot errors or more important warnings in the verbose appveyor output. MSVC warnings are good, so having access to them in a noise free way (read: without trivial warnings) via appveyor without having to use Windows is really valuable.

  See https://github.com/bitcoin/bitcoin/pull/14086#issuecomment-416610313 plus discussion for context.

  Before:

  ```
  c:\projects\bitcoin\src\script\script.cpp(272): warning C4018: '>': signed/unsigned mismatch [C:\projects\bitcoin\build_msvc\libbitcoinconsensus\libbitcoinconsensus.vcxproj]
  c:\projects\bitcoin\src\rest.cpp(467): warning C4101: 'e': unreferenced local variable [C:\projects\bitcoin\build_msvc\libbitcoin_server\libbitcoin_server.vcxproj]
  c:\projects\bitcoin\src\test\allocator_tests.cpp(147): warning C4312: 'reinterpret_cast': conversion from 'int' to 'void *' of greater size [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  c:\projects\bitcoin\src\test\coins_tests.cpp(511): warning C4101: 'e': unreferenced local variable [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  c:\projects\bitcoin\src\test\coins_tests.cpp(524): warning C4101: 'e': unreferenced local variable [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  c:\projects\bitcoin\src\test\coins_tests.cpp(722): warning C4101: 'e': unreferenced local variable [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  c:\projects\bitcoin\src\test\coins_tests.cpp(783): warning C4101: 'e': unreferenced local variable [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  c:\projects\bitcoin\src\test\crypto_tests.cpp(535): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  c:\projects\bitcoin\src\test\dbwrapper_tests.cpp(265): warning C4101: 'e': unreferenced local variable [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  c:\projects\bitcoin\src\test\net_tests.cpp(118): warning C4101: 'e': unreferenced local variable [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  c:\projects\bitcoin\src\test\net_tests.cpp(151): warning C4101: 'e': unreferenced local variable [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  c:\projects\bitcoin\src\test\scheduler_tests.cpp(57): warning C4305: 'argument': truncation from 'int' to 'bool' [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  ```

  After:

  ```
  c:\projects\bitcoin\src\script\script.cpp(272): warning C4018: '>': signed/unsigned mismatch [C:\projects\bitcoin\build_msvc\libbitcoinconsensus\libbitcoinconsensus.vcxproj]
  c:\projects\bitcoin\src\test\allocator_tests.cpp(147): warning C4312: 'reinterpret_cast': conversion from 'int' to 'void *' of greater size [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  c:\projects\bitcoin\src\test\crypto_tests.cpp(535): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  c:\projects\bitcoin\src\test\scheduler_tests.cpp(57): warning C4305: 'argument': truncation from 'int' to 'bool' [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  ```

Tree-SHA512: 5051134126c570b8421d57c710f1f1b977600398d2b5e69f8a8bd766b3696f992bf4e3459643b99a6b7e08dee1adc92985ee4d0d52b20755954415cb6f23f2fb
2018-09-04 12:44:49 +02:00
Wladimir J. van der Laan 281feee7cc
Merge #14129: Trivial: update clang thread-safety docs url
c7f7fa467e Trivial: update clang thread-safety docs url (Ben Woosley)

Pull request description:

  From the defunct http://clang.llvm.org/docs/LanguageExtensions.html#threadsafety to https://clang.llvm.org/docs/ThreadSafetyAnalysis.html

Tree-SHA512: 5113c3933fccee7b45cace5d8dffa38b46ed9ad1422795d57843a20b276ed0e513bbf8d3d2bd28f55a46baf14a349871d7a635485785b93cb21baf8b8720c15a
2018-09-04 12:30:33 +02:00
Wladimir J. van der Laan 788b8a290c
Merge #14135: doc: correct GetDifficulty doc after #13288
68bfc0bce3 doc: correct GetDifficulty doc after #13288 (fanquake)

Pull request description:

  `chain` is no longer passed to GetDifficulty, and we just return `1.0` if no `blockindex`.

Tree-SHA512: 701375d732f343200c4abfaf9039d5c12b10abff97b022e84564f81b26b5ba552f1eb0c0d0fd5370b29b53319eafcf39773a36e1c2dd04ee77e61c18c7b183fa
2018-09-04 12:28:50 +02:00
practicalswift 8ecaee13f7 Increase signal to noise in appveyor build output by reducing the MSVC warning count from 12 to 4 (12 is assuming the changes in #14086 are also implemented).
This makes it easier to spot errors or more important warnings in the verbose appveyor output.

See https://github.com/bitcoin/bitcoin/pull/14086#issuecomment-416610313 plus discussion for context.
2018-09-03 19:53:56 +02:00
practicalswift fa462b3657 wallet: Set encrypted_batch to nullptr after delete. Avoid double free in the case of NDEBUG. 2018-09-03 15:41:02 +02:00
fanquake 68bfc0bce3
doc: correct GetDifficulty doc after #13288 2018-09-03 09:35:41 +08:00
João Barbosa ee3a494f37 gui: Favor macOS show / hide action in dock menu 2018-09-02 19:09:36 +01:00
Ben Woosley c7f7fa467e
Trivial: update clang thread-safety docs url 2018-09-02 02:49:30 -04:00
Cory Fields 9256f7d13f
build: avoid getifaddrs when unavailable 2018-09-01 15:25:03 +02:00
Patrick Strateman 83d53058ae Switch nPrevNodeCount to vNodesSize.
These both have the same value, but the variable naming is confusing.
2018-08-31 18:32:11 -04:00
Russell Yanofsky 190bf62be1 scripted-diff: Small locking rename
Call sync.h primitives "locks" and "mutexes" instead of "blocks" and "waitable
critical sections" to match current coding conventions and c++11 standard
names.

This PR does not rename the "CCriticalSection" class (though this could be done
as a followup) because it is used everywhere and would swamp the other changes
in this PR. Plain mutexes should mostly be preferred instead of recursive
mutexes in new code anyway.

-BEGIN VERIFY SCRIPT-
set -x
set -e
ren() { git grep -l $1 | xargs sed -i s/$1/$2/; }
ren CCriticalBlock           UniqueLock
ren CWaitableCriticalSection Mutex
ren CConditionVariable       std::condition_variable
ren cs_GenesisWait           g_genesis_wait_mutex
ren condvar_GenesisWait      g_genesis_wait_cv
perl -0777 -pi -e 's/.*typedef.*condition_variable.*\n\n?//g' src/sync.h
-END VERIFY SCRIPT-
2018-08-31 10:00:38 -04:00
Wladimir J. van der Laan 385ad11040
Merge #11640: Make LOCK, LOCK2, TRY_LOCK work with CWaitableCriticalSection
9c4dc597dd Use LOCK macros for non-recursive locks (Russell Yanofsky)
1382913e61 Make LOCK, LOCK2, TRY_LOCK work with CWaitableCriticalSection (Russell Yanofsky)
ba1f095aad MOVEONLY Move AnnotatedMixin declaration (Russell Yanofsky)
41b88e9337 Add unit test for DEBUG_LOCKORDER code (Russell Yanofsky)

Pull request description:

  Make LOCK macros work with non-recursive mutexes, and use wherever possible for better deadlock detection.

  Also add unit test for DEBUG_LOCKORDER code.

Tree-SHA512: 64ef209307f28ecd0813a283f15c6406138c6ffe7f6cbbd084161044db60e2c099a7d0d2edcd1c5e7770a115e9b931b486e86c9a777bdc96d2e8a9f4dc192942
2018-08-31 16:00:38 +02:00
MarcoFalke b012bbe358
Merge #10605: Add AssertLockHeld assertions in CWallet::ListCoins
62b6f0f21e Add EXCLUSIVE_LOCKS_REQUIRED to CWallet::ListCoins (Russell Yanofsky)
545e85eccc Add AssertLockHeld assertions in CWallet::ListCoins (Russell Yanofsky)

Pull request description:

  Fixes TODO from #10295

Tree-SHA512: 2dd03a8217e5e1313aa2119cb530e0c0daf3ae3a751b6fdec611df57b8090201a90b52ff05f8f696e978a1344aaf21989d67a03beb5ef6ef79b77be38d04b451
2018-08-31 09:03:05 -04:00
Wladimir J. van der Laan 709a15b0a6
Merge #14088: tests: Don't assert(...) with side effects
ca1a093127 Add regression test: Don't assert(...) with side effects (practicalswift)
4c3c9c3869 Don't assert(...) with side effects (practicalswift)

Pull request description:

  Don't `assert(...)` with side effects.

  From the developer notes:

  > **Assertions should not have side-effects**
  >
  > Rationale: Even though the source code is set to refuse to compile with assertions disabled, having side-effects in assertions is unexpected and makes the code harder to understand

  These assertions were introduced quite recently (in #14069 which was merged two days ago) and since this is a recurring thing (see #13534 – "Don't assert(foo()) where foo() has side effects" from May) I added a simple regression test for the most obvious common side effect.

Tree-SHA512: be65db9d8d5d0f5752152ba73fe3fbb0531880f156d3cd7dfdf1752709979b63214e46ae64b1adbe1e09fa121278f4087f4ae49bff16cf8f5aec16ea6bde3650
2018-08-31 15:00:15 +02:00
MarcoFalke bdbd654df8
Merge #14108: tests: Add missing locking annotations and locks (g_cs_orphans)
b602c9b3af tests: Add missing locking annotations and locks (practicalswift)

Pull request description:

  Add missing locking annotations and locks.

  `mapOrphanTransactions` is guarded by `g_cs_orphans`.

Tree-SHA512: f95104fbef23bd385e754c6bea3c3bdddd8a9c6a68e719d761227c9be1e46ff1316ec050a15a1243218dbab4e8584da6674f4a72f949f54b0a758392f19c83f8
2018-08-31 08:32:31 -04:00
Russell Yanofsky 62b6f0f21e Add EXCLUSIVE_LOCKS_REQUIRED to CWallet::ListCoins
Suggested by MarcoFalke <falke.marco@gmail.com> in
https://github.com/bitcoin/bitcoin/pull/10605#issuecomment-417643535
2018-08-31 08:11:01 -04:00
Wladimir J. van der Laan 3f96908448
Merge #14073: blockfilter: Avoid out-of-bounds script access.
f05599557a blockfilter: Omit empty scripts from filter contents. (Jim Posen)

Pull request description:

  Caught during review of #12254 by @TheBlueMatt. https://github.com/bitcoin/bitcoin/pull/12254#discussion_r212830981

Tree-SHA512: cfc9e3eeaba12a14fd3d2e1ccce1a1f89e8cf44cc340ceec05d2d5fa61d27ff64e355603f4ad2184ff73c0ed23dfdab6e2103bddc48f3b76cb13b88d428770ac
2018-08-31 13:35:31 +02:00
Wladimir J. van der Laan bb0277819a
Merge #13159: Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP)
75ea00f391 Remove unused fsbridge::freopen (practicalswift)
cceedbc4bf Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP) (practicalswift)

Pull request description:

  Don't close old debug log file handle prematurely when trying to re-open (on `SIGHUP`).

  Context: https://github.com/bitcoin/bitcoin/pull/13148#issuecomment-386288606

  Thanks @ajtowns!

Tree-SHA512: c436b4286f00fc428b60269b6d6321f435c72c7ccec3c15b2194aac71196529b30f32c2384b418ffe3ed67ba7ee8ec51f4c9c5748e65945697c0437eafcdacd1
2018-08-31 13:19:12 +02:00
Alexander Leishman 946107a68f Only log "Using PATH_TO_bitcoin.conf" message on startup if conf file exists.
Currently we log a message indicating that a bitcoin.conf file is being used
even if one does not exists. This commit changes the logic to only display
this message if a config file exists and logs a separate message
if no config file exists. Additionally, a warning is now logged if the file
path passed in the -conf flag does not exist.
2018-08-30 11:24:03 -07:00
practicalswift b602c9b3af tests: Add missing locking annotations and locks 2018-08-30 16:36:26 +02:00
Wladimir J. van der Laan 07033a8f91
Merge #13825: [wallet] Kill accounts
c9c32e6b84 [wallet] Kill accounts (John Newbery)

Tree-SHA512: 783272e7df9042fb0a01826fa37a02b97218496459015d7457e56223da8690bdad930c223dd4a903a1d4df57f3f2f4a097d392d272a72419ea9a882b11e599f7
2018-08-30 16:18:36 +02:00
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