aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
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-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 #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-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-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.
2018-04-25Add purpose arg to Wallet::getAddressJames O'Beirne
Also make all arguments to getAddress required and document args at call sites.
2018-04-24[tests] Make rpcauth.py testable and add unit testsQasim Javed
refs #12995
2018-04-24Merge #13013: bench: Amend mempool_eviction test for witness txsMarcoFalke
fa3bb183ad bench: Amend mempool_eviction test for witness txs (MarcoFalke) 962d223e5c bench: Move constructors out of mempool_eviction hot loop (MarcoFalke) Pull request description: Tree-SHA512: 997a07e067623bc2c0904a21bd490d164045cf51393af260fc79882ed010636dce82c9ebe35aae8fa5db5e73c9f3ecb6232353a0939c295034f9be574f1fcff2
2018-04-24Merge #12909: wallet: Make fee settings to be non-static membersWladimir J. van der Laan
fac0db0 wallet: Make fee settings non-static members (MarcoFalke) Pull request description: The wallet header defined some globals (they were called "settings"), that should be class members instead. This commit is hopefully only refactoring, apart from a multiwallet bugfix: Calling the rpc `settxfee` for one wallet, would set (and change) the fee rate for all loaded wallets. (See added test case) Tree-SHA512: 4ab6ec2f5c714742396ded5e451ec3b1ceb771e3696492de29889d866de4365b3fbe4a2784d085c8b8bd11b1ebb8a1fec99ab2c62eee716791cfc67c0cf29e1b
2018-04-24Merge #12953: Deprecate accountsWladimir J. van der Laan
cead28b [docs] Add release notes for deprecated 'account' API (John Newbery) 72c9575 [wallet] [tests] Add tests for accounts/labels APIs (John Newbery) 109e05d [wallet] [rpc] Deprecate wallet 'account' API (John Newbery) 3576ab1 [wallet] [rpc] Deprecate account RPC methods (John Newbery) 3db1ba0 [tests] Set -deprecatedrpc=accounts in tests (John Newbery) 4e671f0 [tests] Rename rpc_listtransactions.py to wallet_listtransactions.py (John Newbery) a28b907 [wallet] [rpc] Remove duplicate entries in rpcwallet.cpp's CRPCCommand table (John Newbery) Pull request description: Deprecate all accounts functionality and make it only accessible by using `-deprecatedrpc=accounts`. Accounts specific RPCs, account arguments, and account related results all require the `-deprecatedrpc=accunts` startup option now in order to see account things. Several wallet functional tests use the accounts system. Those tests are unchanged, except to start the nodes with `-deprecatedrpc=accounts`. We can slowly migrate those tests to use the 'label' API instead of the 'account' API before accounts are fully removed. Tree-SHA512: 89f4ae2fe6de4a1422f1817b0997ae22d63ab5a1a558362ce923a3871f3e42963405d6573c69c27f1764679cdee5b51bf52202cc407f1361bfd8066d652f3f37
2018-04-24Merge #13061: Make tests pass after 2020Wladimir J. van der Laan
3ee4be1 Make tests pass after 2020 (Bernhard M. Wiedemann) Pull request description: Make tests pass after 2020 and also test that 64 bit integers are properly handled Without this patch, the failure was ``` unknown location(0): fatal error: in "rpc_tests/rpc_ban": std::runtime_error: JSON value is not an object as expected test/rpc_tests.cpp(260): last checkpoint ``` I found this when testing reproducible builds for openSUSE Linux packages, building 15 years from now (this is the expected lifespan of today's software) There is 1 other issue in ./src/qt/test/paymentservertests.cpp that fails to verify a cert that expires in 2022 after 10y. ``` QWARN : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active: QSslCertificate("3", "01", "Ipbt+DxK8RDQd25/5ueXqw==", (), ("Payment Request Test Merchant"), QMap(), QDateTime(2012-12-10 16:37:24.000 UTC Qt::TimeSpec(UTC)), QDateTime(2022-12-08 16:37:24.000 UTC Qt::TimeSpec(UTC))) FAIL! : PaymentServerTests::paymentServerTests() Compared values are not the same ``` Tree-SHA512: d6c49879b6abbddbecc1168ac24c2d4f4ee9949b615607b3e6ba350c415136017f32cd112708791b063a2f2dc1b12f295f4ee55a346bd2128aa6480088d8db48
2018-04-24Merge #13032: Output values for "min relay fee not met" errorWladimir J. van der Laan
1accfbc Output values for "min relay fee not met" error (Kristaps Kaupe) Pull request description: It is already done this way for "mempool min fee not met" error. Tree-SHA512: 829db78ecc066cf93b8e93ff1aeb4e7b98883cf45f341d5be6e6b4dff4135f3f54fa49b3a6f12eb43f676a9ba54f981143c9887f786881e584370434a9566cfd
2018-04-23Merge #13055: qt: Don't log to console by defaultMarcoFalke
aee80b0ef9 qt: Don't log to console by default (Wladimir J. van der Laan) Pull request description: Default `-printtoconsole` to false for the GUI. GUI programs should not print to the console unnecessarily. For example, when launched by the window manager, the output might end up in the X session log file, resulting in duplicate logging. On Windows, it is pointless as well because bitcoin-qt isn't a console application. This same mechanism is used to set `-server` to true by default for bitcoind: https://github.com/bitcoin/bitcoin/blob/master/src/bitcoind.cpp#L116 (fixes #13004) Tree-SHA512: 24ae460d9d97130a063f7bf7fa6da1e6cc46643a94ea0827aa64d0f4a80647e5e7394695b24ea0f49a147a1fa07329659d224f04511fc24b97a9869d1c29b890
2018-04-23Make tests pass after 2020Bernhard M. Wiedemann
also test that 64 bit integers are properly handled
2018-04-23Merge #12885: Reduce implementation code inside CScriptWladimir J. van der Laan
54a5a21 [MOVEONLY] Turn CScript::GetOp2 into a function and move to cpp (Pieter Wuille) 6a7456a [MOVEONLY] Move CSCript::FindAndDelete to interpreter (Pieter Wuille) 33a8ecf Delete unused non-const-iterator CSCript::GetOp overloads (Pieter Wuille) 2fb168b Make iterators in CScript::FindAndDelete const (Pieter Wuille) Pull request description: This PR moves `FindAndDelete` and `GetOp2` out of CScript (the first is only used inside the interpreter and moved there, the second does not actually depend on any script specifics and works on any vector). Furthermore, all non-const-iterator versions of GetOp are replaced by const ones, removing a number of methods in the process. The longer term goal here is making the script interpreter independent from the CScript representation. Note for reviewers: both `FindAndDelete` and `GetScriptOp` are consensus critical. Tree-SHA512: c4ccf91c0b33c37cff0d474aa8dd2dab25b5b7655e2ed69a9b15e29daf0a67b21d51c23e1defb3a72ec762bd6138de96f69c6db1fb9c1fe1e976e421261aedb7
2018-04-23Merge #12999: qt: Show the Window when double clicking the taskbar iconWladimir J. van der Laan
67bf2aa qt:Show the entire Window when double clicking on taskbar (Chun Kuan Lee) Pull request description: fix #12838 Tree-SHA512: 4498bc1fe52efeed3768d6bdd7941e4b036d52ae80d9c1b6679c6daa3a62aeda4cff0c91fe1c65afaea6049c59cb0296fdcbff63ecb342d518615a92361fda7f
2018-04-23Merge #13030: [bugfix] [wallet] Fix zapwallettxes/multiwallet interaction.Wladimir J. van der Laan
1f83839 [wallet] [tests] Test disallowed multiwallet params (John Newbery) 3476e3c [wallet] Fix zapwallettxes/multiwallet interaction. (John Newbery) Pull request description: `-zapwallettxes` should be disallowed when starting bitcoin in multiwallet mode. There's code in `WalletInit::ParameterInteraction()` to disallow `-zapwallettxes` when running in multiwallet mode. This code functioned as expected when passing the parameter `-zapwallettxes=1`, but not when passing the parameter `-zapwallettxes` (ie without the value specified). Fix that and add a test. The new test in the _[wallet] [tests] Test disallowed multiwallet params_ commit reproduces the bug and should fail against master. Fixes #12505 Tree-SHA512: 6cd921717e9c7d2773ca84c946c310c2adec8430e37cbecdb33a620f510db3058a72bd328411812ba415111bc52a3367b332c9d15a37a92ccfd7ae785d2f32ab
2018-04-23Merge #12448: Interrupt block generation on shutdown requestWladimir J. van der Laan
0851a75 rpc: Interrupt block generation on shutdown request (João Barbosa) Pull request description: With this simple change, after running `bitcoin-cli -regtest generate 100000`, it is possible to interrupt `bitcoind` cleanly without waiting for the generation to complete. Tree-SHA512: f0f7cdde242e595cfdaea31ae8bddbc25933621b63f639e813d272c2b00ce2ef52f0c14ae44954ba8c49f0fc846bcc3bfd5419e52b3347a68bb0341ce6b02d26
2018-04-23Merge #13012: [doc] Add comments for chainparams.h, validation.cppWladimir J. van der Laan
18326ae [doc] Add comments for chainparams.h, validation.cpp (James O'Beirne) Pull request description: Added a few comments during a leisurely read through some of the validation code. If this kind of thing seems useful, I can add similar documentation for most of the `CChainState` interface. Tree-SHA512: a4d9db60383a8ff02e74ac326ed88902eec1ee441e8cd4e1845bcf257072673c15974225288cebf0a633e76a3410f99e2206616b4694725a2a5b0d19c78327d6
2018-04-23wallet: Make fee settings non-static membersMarcoFalke
2018-04-23Merge #13052: trivial: Fix relevent typoMarcoFalke
6ad47b04b9 trivial: Fix relevent typo (practicalswift) Pull request description: Fix relevent typo. Tree-SHA512: 29247a780ab2caf0180c3558632a00068b02b4de4a56825f425c66a1e515542ab1e5268971ffa9a63e46840504101b5e6a5f8dcb6070522ac3f5ca90a28262b9
2018-04-23Merge #13020: Consistently log CValidationState on call failureWladimir J. van der Laan
e4d0b44 Consistently log CValidationState on failure (Ben Woosley) Pull request description: This replaces potential silent failures and partial logging with full logging. Seems providing at least minimal visibility to the failure is a good practice. E.g. `FlushStateToDisk` can return a rare but meaningful out of disk space error that would be better to note than leave out. Note many of these are related to `ActivateBestChain` or `FlushStateToDisk`. Only a few cases of ignored state remain, e.g. LoadExternalBlockFile and RelayWalletTransaction, where I expect logging would likely be spammy. Tree-SHA512: fb0e521039e5a5250cd9c82e7a8676423b5e3899d495649c0e71752059d1984e5175f556386ade048f51a7d59f5c8e467df7fe91d746076f97d24c000ccf7891
2018-04-23Merge #13039: Add logging and error handling for file syncingWladimir J. van der Laan
cf02779 Add logging and error handling for file syncing (Wladimir J. van der Laan) Pull request description: Add logging and error handling inside, and outside of FileCommit. Functions such as fsync, fdatasync will return error in case of hardware I/O errors, and ignoring this means it can silently continue through data corruption. (c.f. https://lwn.net/SubscriberLink/752063/12b232ab5039efbe/) EINVAL is handled specially to avoid crashing out on (network, fuse) filesystems that don't handle `f[data]sync`. I checked that the syncing inside leveldb is already generating an I/O error as appropriate. Tree-SHA512: 64cc9bbedca3ecc97ff4bac0a7b7ac6526a7ed763c66f6786d03ca4f2e9e366e42b152cb908299c060448d98ca39ff03395280bffaca51d592e728aa2516f5dd
2018-04-23Add logging and error handling for file syncingWladimir J. van der Laan
Add logging and error handling inside, and outside of FileCommit. Functions such as fsync, fdatasync will return error in case of hardware I/O errors, and ignoring this means it can silently continue through data corruption. (c.f. https://lwn.net/SubscriberLink/752063/12b232ab5039efbe/)
2018-04-23Merge #13016: scripted-diff: Rename CChainState::g_failed_blocks to ↵Wladimir J. van der Laan
m_failed_blocks 3cc9094 scripted-diff: Rename CChainState::g_failed_blocks to m_failed_blocks (Ben Woosley) Pull request description: To reflect its actual status as a member rather than a global value. g_failed_blocks was previously global: 2862aca40f24acc48d3052d5ba3f639e3fc0a621 Tree-SHA512: a0e679a151e0fb70d245a7a1821449d0a4738f5ba503abca9f19d9cfbcbb0e72a1598e3364e29775b0c203acd6d04d882d2788208f685edc57aaba5e946fde3b
2018-04-23qt: Don't log to console by defaultWladimir J. van der Laan
Default `-printtoconsole` to false for the GUI. GUI programs should not print to the console unnecessarily. For example, when launched by the window manager, the output might end up in the X session log file, resulting in duplicate logging. On Windows, it is pointless as well because bitcoin-qt isn't a console application.
2018-04-23Merge #13017: Add wallets management functionsWladimir J. van der Laan
3c058fd wallet: Add HasWallets (João Barbosa) 373aee2 wallet: Add AddWallet, RemoveWallet, GetWallet and GetWallets (João Barbosa) 6efd964 refactor: Drop CWalletRef typedef (João Barbosa) Pull request description: This is a small step towards dynamic wallet load/unload. The wallets *registry* `vpwallets` is used in several places. With these new functions all `vpwallets` usage are removed and `vpwallets` is now a static variable (no external linkage). The typedef `CWalletRef` is also removed as it is narrowly used. Tree-SHA512: 2ea19da2e17b521ad678bfe10f3257e497ccaf7ab9fd0b6647f9d829f1d6131cfa68db8e8492421711c6da399859432b963a568bdd4ca40a77dd95b597839423
2018-04-22trivial: Fix relevent typopracticalswift
2018-04-22Merge #12998: Default to defining endian-conversion DECLs in compat w/o configWladimir J. van der Laan
150b2f0 Default to defining endian-conversion DECLs in compat w/o config (Matt Corallo) Pull request description: While this isn't a supported build configuration, some build systems need to build without going through our autotools steps, so defaulting to something sane may make it easier to build. Specifically, this fixes the inability to build rust-bitcoinconsensus on some non-x86 platforms. It needs to build without our autotools/configure steps to ensure correct compile args are passed from the rust build system to gcc. Converting the args from the rust build system to gcc would be a lot of unmaintainable work. Tree-SHA512: 776fdb8c91b66f421fc751cb281c99c53c47e496f46b26c9f49bb6fdb6da3d2dda5dcc1c5bf413206bdd9ff3cbe5cef2823455900462519a4944631d9c48b54c
2018-04-19Merge #13021: MOVEONLY: Move logging code from util.{h,cpp} to new files.Pieter Wuille
b77b6e2345 MOVEONLY: Move logging code from util.{h,cpp} to new files. (Jim Posen) Pull request description: Split out first commit from #12954 to reduce amount of rebasing necessary. This introduces a cyclic dependency between `logging` and `util` that should be cleaned up in a future PR. Tree-SHA512: 695e512f9c2f7b4ca65e367fc924358e3cb2dc531bcbb7a6f62710b2a87280b35aba7793aa272e457fcd65448abe3feb1deb3b8064ed208917ca356b0f410813
2018-04-19Use anonymous namespace instead of static functionsPieter Wuille