aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-04-30Merge #13028: Make vpwallets usage thread safeWladimir J. van der Laan
e2f58f4 wallet: Make vpwallets usage thread safe (João Barbosa) Pull request description: This PR turns the functions introduced in #13017 thread safe. This is required to correctly support dynamically loading wallets, which is implemented in #10740. Tree-SHA512: efaa09e501636cf957aa33de83719ce09dc0c2a19daff741a94ef10d6b7ba5dee538355b80c96ead995140f99f5df0c92fb0e22ae1adb8f397eb478280c8d8c7
2018-04-30Merge #13105: [qa] Add --failfast option to functional test runnerWladimir J. van der Laan
58f9a0a Use --failfast when running functional tests on Travis (James O'Beirne) bf720c1 Add --failfast option to functional test runner (James O'Beirne) Pull request description: Add the option (`--failfast`) to stop the functional test runner's execution when it encounters the first failure. Also cleans up run_test's arguments list ([no more mutable default for `args`](http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments)) and call site. Tree-SHA512: e854b1b1634bf613ae8ae88e715df1460982fa68db9d785aafeb5eccf5bf324c7f20dded2ca6840ebf18a28347ecac2138d6c7592507b34939b02609ef55e1b3
2018-04-30Merge #13124: [doc] nit: descendent should be spelled descendant even in the ↵Wladimir J. van der Laan
release-notes 9b78ef3 nit: descendent should be spelled descendant even in the release-notes (mryandao) Pull request description: Tree-SHA512: 842b675dd648461c03f1bf4081856baae75d663d37609e24ee5100361672c500a94302cfa1f7505993c56194f8184e0658d5174c7994cfb3fabe6003a9514610
2018-04-30nit: descendent should be spelled descendant even in the release-notesmryandao
2018-04-30Merge #13109: [rpc] nit: fix typo for entry description stringWladimir J. van der Laan
f7c414d nit: fix typo for entry description string (mryandao) Pull request description: #12240 Tree-SHA512: 2940c383069912b04d6fdbc1f0834970cae8ed725beb606916ee27501d8f6e1b3938647babb26137440166de3a9ac745048e306696d13817775eb406adb31f4a
2018-04-30Merge #13119: Remove script to clean up datadirsJonas Schnelli
fa85de9ff Remove script to clean up datadirs (MarcoFalke) Pull request description: This reverts commit 33c055c4f1eca07bd914a5b40a21f92ad82dde9f. (#2295) Tree-SHA512: 0f0dceaf7912cbfa6e64ac55177592e39b99d2aa59d47609c853093ea2e93f5d80d0390f65f26535d5a94e576c55737fdb8c9e463679e9c790656b95b1b58b36
2018-04-30nit: fix typo for entry description stringmryandao
2018-04-29Remove script to clean up datadirsMarcoFalke
This reverts commit 33c055c4f1eca07bd914a5b40a21f92ad82dde9f. (#2295)
2018-04-29util: Store debug log file path in BCLog::Logger member.Jim Posen
This breaks the cyclic between logging and util.
2018-04-29scripted-diff: Rename BCLog::Logger member variables.Jim Posen
-BEGIN VERIFY SCRIPT- sed -i "s/fileout/m_fileout/" src/logging.h src/logging.cpp sed -i "s/mutexDebugLog/m_file_mutex/" src/logging.h src/logging.cpp sed -i "s/vMsgsBeforeOpenLog/m_msgs_before_open/" src/logging.h src/logging.cpp sed -i "s/logCategories/m_categories/" src/logging.h src/logging.cpp sed -i "s/fPrintToConsole/m_print_to_console/" src/logging.h src/logging.cpp src/init.cpp sed -i "s/fPrintToDebugLog/m_print_to_file/" src/logging.h src/logging.cpp src/init.cpp src/test/test_bitcoin.cpp src/bench/bench_bitcoin.cpp sed -i "s/fLogTimestamps/m_log_timestamps/" src/logging.h src/logging.cpp src/init.cpp sed -i "s/fLogTimeMicros/m_log_time_micros/" src/logging.h src/logging.cpp src/init.cpp sed -i "s/fReopenDebugLog/m_reopen_file/" src/logging.h src/logging.cpp src/init.cpp sed -i "s/fStartedNewLine/m_started_new_line/" src/logging.h src/logging.cpp -END VERIFY SCRIPT-
2018-04-29util: Refactor GetLogCategory.Jim Posen
Changing parameter types from pointers to references and uint32_t to BCLog::LogFlags simplies calling code.
2018-04-27Merge #13077: Add compile time checking for all cs_KeyStore runtime locking ↵MarcoFalke
assertions 66dc662c8a Add compile time checking for all cs_KeyStore runtime locking assertions (practicalswift) Pull request description: Add compile time checking for all `cs_KeyStore` runtime locking assertions. This PR is a subset of #12665. The PR was broken up to make reviewing easier. The intention is that literally all `EXCLUSIVE_LOCKS_REQUIRED`/`LOCKS_EXCLUDED`:s added in this PR should follow either directly or indirectly from `AssertLockHeld(…)`/`AssertLockNotHeld(…)`:s already existing in the repo. Consider the case where function `A(…)` contains `AssertLockHeld(cs_foo)` (without first locking `cs_foo` in `A`), and that `B(…)` calls `A(…)` (without first locking `cs_main`): * It _directly_ follows that: `A(…)` should have an `EXCLUSIVE_LOCKS_REQUIRED(cs_foo)` annotation. * It _indirectly_ follows that: `B(…)` should have an `EXCLUSIVE_LOCKS_REQUIRED(cs_foo)` annotation. Tree-SHA512: 84ee5459e7f75f9affaa4275cb760576ab0e26da8a48b9a4a59b51a25418fe4b862ba832cb01312479a8c9b0e38ee8b6c4076bcbbd73213346d09ec2057fc9f1
2018-04-27util: Encapsulate logCategories within BCLog::Logger.Jim Posen
2018-04-27util: Move debug file management functions into Logger.Jim Posen
2018-04-27util: Establish global logger object.Jim Posen
The object encapsulates logging configuration, and in a later commit, set up routines will also be moved into the class.
2018-04-27Use --failfast when running functional tests on TravisJames O'Beirne
2018-04-27Add --failfast option to functional test runnerJames O'Beirne
Also cleans up run_test's arguments list (no more mutable default for `args`) and call site.
2018-04-27Simplify semantics of ChainStateFlushed callbackMatt Corallo
Previously, ChainStateFlushed would fire either if a full flush completed (which can happen due to memory limits, forced flush, or on its own DATABASE_WRITE_INTERVAL timer) *or* on a ChainStateFlushed-specific DATABASE_WRITE_INTERVAL timer. This is both less clear for clients (as there are no guarantees about a flush having actually happened prior to the call), and reults in extra flushes not clearly intended by the code. We drop the second case, providing a strong guarantee without removing the periodit timer-based flushing.
2018-04-27scripted-diff: Rename SetBestChain callback ChainStateFlushedMatt Corallo
This much more accurately captures the meaning of the callback. -BEGIN VERIFY SCRIPT- sed -i 's/SetBestChain/ChainStateFlushed/g' src/validationinterface.h src/validationinterface.cpp src/wallet/wallet.h src/wallet/wallet.cpp src/validation.cpp src/index/txindex.h src/index/txindex.cpp -END VERIFY SCRIPT-
2018-04-27Merge #13090: Remove Safe mode (achow101)Wladimir J. van der Laan
d8e9a2a Remove "rpc" category from GetWarnings (Wladimir J. van der Laan) 7da3b0a rpc: Move RPC_FORBIDDEN_BY_SAFE_MODE code to reserved section (Wladimir J. van der Laan) 2ae705d Remove Safe mode (Andrew Chow) Pull request description: Rebase of #10563. Safe mode was [disabled by default and deprecated in 0.16](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.16.0.md#safe-mode-disabled-by-default), so probably should be removed for 0.17. > Rationale: > > Safe mode is useless. It only disables some RPC commands when large work forks are detected. Nothing else is affected by safe mode. It seems that very few people would be affected by safe mode. The people who use Core as a wallet are primarily using it through the GUI, which safe mode does not effect. In the GUI, transactions will still be made as normal; only a warning is displayed. > > I also don't think that we should be disabling RPC commands or any functionality in general. If we do, it should be done consistently, which safe mode is not. If we want to keep the idea of a safe mode around, I think that the current system needs to go first before a new system can be implemented. Tree-SHA512: 067938f47ca6e879fb6c3c4e21f9946fd7c5da3cde67ef436f1666798c78d049225b9111dc97064f42b3bc549d3915229fa19ad5a634588f381e34fc65d64044
2018-04-27Remove "rpc" category from GetWarningsWladimir J. van der Laan
No longer used after removing safe mode. This function can likely be simplified more, but I'll leave that for later to make this easy to review.
2018-04-27rpc: Move RPC_FORBIDDEN_BY_SAFE_MODE code to reserved sectionWladimir J. van der Laan
Although this code is no longer ever sent back after removing safe mode, it would be unwise to remove it from the header. For one, it would be bad to accidentally re-use the number. Also some API documentation / bindings are directly generated from the .h file - this is why the "Aliases for backward compatibility" are there. We don't want to break code that relies on this error code existing, even if it's never generated. So keep it around but move it to a reserved section.
2018-04-26Merge #13002: Do not treat bare multisig outputs as IsMine unless watchedWladimir J. van der Laan
7d0f80b Use anonymous namespace instead of static functions (Pieter Wuille) b61fb71 Mention removal of bare multisig IsMine in release notes (Pieter Wuille) 9c2a8b8 Do not treat bare multisig as IsMine (Pieter Wuille) 08f3228 Optimization: only test for witness scripts at top level (Pieter Wuille) 3619735 Track difference between scriptPubKey and P2SH execution in IsMine (Pieter Wuille) ac6ec62 Switch to a private version of SigVersion inside IsMine (Pieter Wuille) 19fc973 Do not expose SigVersion argument to IsMine (Pieter Wuille) fb1dfbb Remove unused IsMine overload (Pieter Wuille) 952d821 Make CScript -> CScriptID conversion explicit (Pieter Wuille) Pull request description: Currently our wallet code will treat bare multisig outputs (meaning scriptPubKeys with multiple public keys + `OP_CHECKMULTISIG` operator in it) as ours without the user asking for it, as long as all private keys in it are in our wallet. This is a pointless feature. As it only works when all private keys are in one place, it's useless compared to single key outputs (P2PK, P2PKH, P2WPKH, P2SH-P2WPKH), and worse in terms of space, cost, UTXO size, and ability to test (due to lack of address format for them). Furthermore, they are problematic in that producing a list of all `scriptPubKeys` we accept is not tractable (it involves all combinations of all public keys that are ours). In further wallet changes I'd like to move to a model where all scriptPubKeys that are treated as ours are explicit, rather than defined by whatever keys we have. The current behavior of the wallet is very hard to model in such a design, so I'd like to get rid of it. I think there are two options: * Remove it entirely (do not ever accept bare multisig outputs as ours, unless watched) * Only accept bare multisig outputs in situations where the P2SH version of that output would also be acceptable This PR implements the first option. The second option was explored in #12874. Tree-SHA512: 917ed45b3cac864cee53e27f9a3e900390c576277fbd6751b1250becea04d692b3b426fa09065a3399931013bd579c4f3dbeeb29d51d19ed0c64da75d430ad9a
2018-04-26Merge #13003: qa: Add test for orphan handlingWladimir J. van der Laan
fa02c5b qa: Clarify documentation for send_txs_and_test (MarcoFalke) fadfbd3 qa: Add test for orphan handling (MarcoFalke) Pull request description: Tree-SHA512: e0932d6bd03c73e3113f5457a3ffa3bbfc7b6075dfca8de95224d9df875e60ca6eb15cd8baa226f13de965483006559556191630a83c3bb431e79c53a85ef73f
2018-04-27tests: Add test for 64-bit PE, modify 32-bit test resultsChun Kuan Lee
9a75d29b6f0d6c4834e451b0fae2200786655a35 change the error result from `PIE` to `DYNAMIC_BASE`. And there are no test for 64-bit, so I made one
2018-04-26Merge #13031: Fix for utiltime to compile with msvc.Wladimir J. van der Laan
abd58a2 Fix for utiltime to compile with msvc. (Aaron Clauson) Pull request description: This PR allows utiltime.cpp to compile with msvc after the changes introduced in #12973. Tree-SHA512: 7233b1c23400bf19aef2fcb6168009ef58b9e7f8e49c46d8cf9d04394091f370e39496d24ca00b294c4164bcfc04514e329bf6bb05169406c34ce7cd8c382565
2018-04-26Remove Safe modeAndrew Chow
2018-04-26Merge #12321: p2wsh and p2sh-p2wsh address in decodescriptWladimir J. van der Laan
41ff967 list the types of scripts we should consider for a witness program (fivepiece) 4f933b3 p2wpkh, p2wsh and p2sh-nested scripts in decodescript (fivepiece) Pull request description: Attempts to address #12244 . `p2wsh` addresses are returned only for scripts that are neither `p2sh` nor any witness program. Tree-SHA512: eb47f094c1a4c2ad2bcf27a8032307e43cf787d50bf739281aeb4101d97316a2f307b05118bf138298c937fa34e15f91436443a9b313f809fad2c43e94cd1831
2018-04-26Merge #12240: [rpc] Introduced a new `fees` structure that aggregates all ↵Wladimir J. van der Laan
sub-field fee types denominated in BTC 7de1de7 Add new fee structure with all sub-fields denominated in BTC (mryandao) Pull request description: the denomination for `fee` is current in btc while the other such as `decendentFee` and `ancestorFee` are in satoshis. Tree-SHA512: e428f6dca1d339f89ab73e38ce5903f5465c46b159069d9bcc3f8b1140fe6657fa49a11abe0088e9f7ba9999f64af72a349a4735bf5eaa61b8e4a185b23543f3
2018-04-26Merge #12997: [doc] build-windows: Switch to Artful, since Zesty is EOLWladimir J. van der Laan
fad2958 [doc] build-windows: Switch to Artful, since Zesty is EOL (MarcoFalke) Pull request description: According to https://wiki.ubuntu.com/Releases#End_of_Life, Zesty is EOL, so bump to Artful for now. Note that Artful is going to be EOL soon as well, so I am not sure how to proceed after that. Tree-SHA512: 8efc1ade429cf053f4c69e764175aad8790ded71f04bb9963202be171f1cfa1a3de55a207c0b19271d2f536feafa754ed71a6fafc597e3023bdf0e02fa5cd5e5
2018-04-25Merge #13033: Build txindex in parallel with validationPieter Wuille
9b2704777c [doc] Include txindex changes in the release notes. (Jim Posen) ed77dd6b30 [test] Simple unit test for TxIndex. (Jim Posen) 6d772a3d44 [rpc] Public interfaces to GetTransaction block until synced. (Jim Posen) a03f804f2a [index] Move disk IO logic from GetTransaction to TxIndex::FindTx. (Jim Posen) e0a3b80033 [validation] Replace tx index code in validation code with TxIndex. (Jim Posen) 8181db88f6 [init] Initialize and start TxIndex in init code. (Jim Posen) f90c3a62f5 [index] TxIndex method to wait until caught up. (Jim Posen) 70d510d93c [index] Allow TxIndex sync thread to be interrupted. (Jim Posen) 94b4f8bbb9 [index] TxIndex initial sync thread. (Jim Posen) 34d68bf3a3 [index] Create new TxIndex class. (Jim Posen) c88bcec93f [db] Migration for txindex data to new, separate database. (Jim Posen) 0cb8303241 [db] Create separate database for txindex. (Jim Posen) Pull request description: I'm re-opening #11857 as a new pull request because the last one stopped loading for people ------------------------------- This refactors the tx index code to be in it's own class and get built concurrently with validation code. The main benefit is decoupling and moving the txindex into a separate DB. The primary motivation is to lay the groundwork for other indexers that might be desired (such as the [compact filters](https://github.com/bitcoin/bips/pull/636)). The basic idea is that the TxIndex spins up its own thread, which first syncs the txindex to the current block index, then once in sync the BlockConnected ValidationInterface hook writes new blocks. ### DB changes At the suggestion of some other developers, the txindex has been split out into a separate database. A data migration runs at startup on any nodes with a legacy txindex. Currently the migration blocks node initialization until complete. ### Open questions - Should the migration of txindex data from the old DB to the new DB block in init or should it happen in a background thread? The downside to backgrounding it is that `getrawtransaction` would return an error message saying the txindex is syncing while the migration is running. ### Impact In a sample size n=1 test where I synced nodes from scratch, the average time [Index writing](https://github.com/bitcoin/bitcoin/blob/master/src/validation.cpp#L1903) was 3.36ms in master and 1.72ms in this branch. The average time between `UpdateTip` log lines for sequential blocks between 400,000 and IBD end on mainnet was 0.297204s in master and 0.286134s in this branch. Most likely this is just variance in IBD times, but I can try with some more trials if people want. Tree-SHA512: 451fd7d95df89dfafceaa723cdf0f7b137615b531cf5c5035cfb54e9ccc2026cec5ac85edbcf71b7f4e2f102e36e9202b8b3a667e1504a9e1a9976ab1f0079c4
2018-04-25Merge #13082: Tests: don't test against min relay fee information in ↵MarcoFalke
mining_prioritisetransaction.py bd9d67b752 Don't test against min relay fee information in mining_prioritisetransaction.py (Kristaps Kaupe) Pull request description: Follow-up on #13032. As advised by @MarcoFalke. Tree-SHA512: a690ff2e6499b0b4ee6a952c849e363738b9a5ae553266e1780fc7910a6b01e240d71b434fe87da53dc43f6e26cec23a900ec16aab64bb8f6765c26d7aa37c56
2018-04-26Don't test against min relay fee information in mining_prioritisetransaction.pyKristaps Kaupe
Same reasoning as in 55f89da1a5048cf275c37bceef664e7c04831a35
2018-04-25Add compile time checking for all cs_KeyStore runtime locking assertionspracticalswift
2018-04-25[doc] Include txindex changes in the release notes.Jim Posen
2018-04-25[test] Simple unit test for TxIndex.Jim Posen
2018-04-25[rpc] Public interfaces to GetTransaction block until synced.Jim Posen
Now that the transaction index is updated asynchronously, in order to preserve the current behavior of public interfaces, the code blocks until the transaction index is caught up with the current state of the blockchain.
2018-04-25[index] Move disk IO logic from GetTransaction to TxIndex::FindTx.Jim Posen
2018-04-25[validation] Replace tx index code in validation code with TxIndex.Jim Posen
2018-04-25[init] Initialize and start TxIndex in init code.Jim Posen
2018-04-25[index] TxIndex method to wait until caught up.Jim Posen
In order to preserve getrawtransaction RPC behavior, there needs to be a way for a thread to ensure the transaction index is in sync with the current state of the blockchain.
2018-04-25[index] Allow TxIndex sync thread to be interrupted.Jim Posen
2018-04-25[index] TxIndex initial sync thread.Jim Posen
TxIndex starts up a background thread to get in sync with the block index before blocks are processed through the ValidationInterface.
2018-04-25[index] Create new TxIndex class.Jim Posen
The TxIndex will be responsible for building the transaction index concurrently with the main validation thread by implementing ValidationInterface. This does not process blocks concurrently yet.
2018-04-25[db] Migration for txindex data to new, separate database.Jim Posen
2018-04-25[db] Create separate database for txindex.Jim Posen
The new TxIndexDB class will be used by a future commit in this change set.
2018-04-25Merge #12830: [qt] [tests] Clarify address book error messages, add testsWladimir J. van der Laan
5109fc4 [tests] [qt] Add tests for address book manipulation via EditAddressDialog (James O'Beirne) 9c01be1 [tests] [qt] Introduce qt/test/util with a generalized ConfirmMessage (James O'Beirne) 8cdcaee [qt] Display more helpful message when adding a send address has failed (James O'Beirne) c5b2770 Add purpose arg to Wallet::getAddress (James O'Beirne) Pull request description: Addresses https://github.com/bitcoin/bitcoin/issues/12796. When a user attempts to add to the address book a sending address which is already present as a receiving address, they're presented with a confusing error indicating the address is already present in the book, despite the fact that this row is currently invisible. ![selection_011](https://user-images.githubusercontent.com/73197/38096704-8a2948d2-3341-11e8-9632-7d563201f28c.jpg) This change adds a more specific error message indicating its existence as a receiving address (as discussed in the linked issue). ![selection_016](https://user-images.githubusercontent.com/73197/38198467-fa26164e-365a-11e8-8fc5-ddab9caf2fbd.jpg) This change also adds some tests exercising use of the address book via QT. Adding so much test code for such a trivial change may seem weird, but it's my hope that this will make further test-writing for address book usage (and other QT features) more approachable. Tree-SHA512: fbdd5564f7a9a2380bbe437f3378e8d4d5fd9201efff4879b72bc23f2cc1c2eecaf2b811994c25070ee052422e48e47901787c2e62cc584774a997fe6a2a327a
2018-04-25[tests] [qt] Add tests for address book manipulation via EditAddressDialogJames O'Beirne
Also modifies corresponding QT code to allow for use within test cases.
2018-04-25[tests] [qt] Introduce qt/test/util with a generalized ConfirmMessageJames O'Beirne
ConfirmMessage is reused in future tests apart from its single usage here.
2018-04-25[qt] Display more helpful message when adding a send address has failedJames O'Beirne
Addresses #12796. When we're unable to add a sending address to the address book because it already exists as a receiving address, display a message indicating as much. This should help avoid confusion about an address supposedly already in the book but which isn't currently visible in the interface.