Commit Graph

898 Commits

Author SHA1 Message Date
Alfredo Garcia 3b9bd2da2f fix sort of options 2020-05-28 10:58:04 -03:00
Wladimir J. van der Laan 540cdb34e2 Add `-debuglogfile` option
This patch adds an option to configure the name and/or directory of the
debug log.

The user can specify either a relative path, in which case the path
is relative to the data directory. They can also specify an absolute
path to put the log anywhere else in the file system.
2020-05-28 10:53:58 -03:00
Homu 4fad49d802 Auto merge of #4416 - daira:sa_restart, r=daira
Use SA_RESTART in sa_flags when setting up signal handlers

Explanation: if a signal interrupts certain syscalls such as `open`, `read`, or `write`,
then the library function will by default fail with `errno` `EINTR`. But we [almost](https://github.com/zcash/zcash/search?q=WSAEINTR) [never](https://github.com/zcash/zcash/search?q=EINTR)
check for `EINTR`, so this is likely to cause spurious errors. We want to restart the syscall
instead, which is what `SA_RESTART` is intended to do. Since our signal handlers (defined
in init.cpp) only set a flag, restarting the syscall is safe and is always the Right Thing.

See <https://www.gnu.org/software/libc/manual/html_node/Flags-for-Sigaction.html> and
<https://www.gnu.org/software/libc/manual/html_node/Interrupted-Primitives.html> for
further information.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-04-15 19:23:14 +00:00
Homu 3033b8a0ec Auto merge of #4402 - oxarbitrage:issue4326, r=str4d
Add -lightwalletd experimental option

Similar to `-insightexplorer` but loading less indexes.

After testing and code review this should be able to close https://github.com/zcash/zcash/issues/4326
2020-04-10 03:42:54 +00:00
Alfredo Garcia a43f5daff8 add -lightwalletd experimental option 2020-04-09 11:05:21 -03:00
Alfredo Garcia 6039242829
multiple debug categories documentation 2020-04-06 09:09:43 -03:00
Daira Hopwood dd215e8994 Use `SA_RESTART` in `sa_flags` when setting up signal handlers.
Explanation: if a signal interrupts certain syscalls such as `open`, `read`, or `write`,
then the library function will by default fail with `errno` `EINTR`. But we almost never
check for `EINTR`, so this is likely to cause spurious errors. We want to restart the syscall
instead, which is what `SA_RESTART` is intended to do. Since our signal handlers (defined
in init.cpp) only set a flag, restarting the syscall is safe and is always the Right Thing.

See <https://www.gnu.org/software/libc/manual/html_node/Flags-for-Sigaction.html> and
<https://www.gnu.org/software/libc/manual/html_node/Interrupted-Primitives.html> for
further information.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-03-28 19:14:48 +00:00
Homu fc9d0fa72f Auto merge of #4404 - daira:fix-reindex-divby0, r=ebfull
Avoid a theoretical possibility of division-by-zero introduced in #4368

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-03-16 17:13:39 +00:00
Homu 5a626317c7 Auto merge of #4390 - daira:fix-chaintip-race-condition, r=ebfull
Fix race conditions during init

Fix race conditions due to accessing `chainActive.Tip()` during init, and other minor cleanups.
Includes backport of https://github.com/bitcoin/bitcoin/pull/8063 .
2020-03-16 15:11:43 +00:00
Daira Hopwood b49cdee878 Avoid a theoretical possibility of division-by-zero introduced in #4368.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-03-16 14:56:38 +00:00
Homu c0802cccac Auto merge of #4368 - gladcow:issue3813_reindex_in_metrics, r=str4d
Shows reindex progress in metrics screen

Resolves issue #3813.

The "Downloading blocks" message is changed to "Reindexing blocks" during reindex, after reindex is completed the text is reverted back to the first variant.

Reindex progress is shown as a sum of processed file size (we can't use reindexed block number as a progress because we can't predict how many blocks to process at all, we don't know the size of the block before we process it), the result looks like
```
Reindexing blocks | 22.64 MiB / 336.00 MiB (6%, 13583 blocks)
```
2020-03-12 09:28:35 +00:00
Homu ac4e91c6f4 Auto merge of #4343 - oxarbitrage:issue3083, r=str4d
Add expired transaction notifications

Closes https://github.com/zcash/zcash/issues/3083
2020-03-12 06:35:04 +00:00
Homu fa67c4e148 Auto merge of #4293 - oxarbitrage:issue2671, r=str4d
Refactor experimental feature handling

Adds new rpc call `getexperimentalfeatures` and also adds experimental features to `getblockchaininfo` output.

Closes #2671.
2020-03-12 02:09:12 +00:00
Daira Hopwood 0de0105c80 Exit init early if we request shutdown before having loaded the genesis block.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-03-10 17:57:52 +00:00
Daira Hopwood 99dc6de485 Setting a std::atomic variable in a signal handler only has defined behaviour if it is lock-free.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-03-10 17:57:52 +00:00
Daira Hopwood 74467f8f02 Resolve a race condition on `chainActive.Tip()` in initialization (introduced in #4379).
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-03-10 17:57:52 +00:00
Patrick Strateman 82e641f3cc Acquire lock to check for genesis block. 2020-03-10 17:57:52 +00:00
gladcow e72885b690 Use processed file size as progress in metrics during reindex 2020-03-10 09:33:35 +03:00
Homu ca668cf666 Auto merge of #4374 - daira:rewrite-addtimedata, r=daira
Remove time adjustment; instead warn if peer clocks are too different

The policy is: warn if we have seen at least 8 (TIMEDATA_WARNING_SAMPLES) peer times, in the version messages of the first 20 (TIMEDATA_MAX_SAMPLES) unique (by IP address) peers that connect, that are more than 10 minutes (TIMEDATA_WARNING_THRESHOLD seconds) but less than 10 days (TIMEDATA_IGNORE_THRESHOLD seconds) away from local time.

fixes #4338
2020-03-09 21:15:34 +00:00
MeshCollider cb8de0395f Fix race for mapBlockIndex in AppInitMain 2020-03-07 10:21:59 +03:00
Alfredo Garcia 04012a62c1 refactor experimental features 2020-03-06 07:48:33 -03:00
Homu 35bff6ac7c Auto merge of #4256 - str4d:zip-213-shielded-coinbase, r=daira
[NU3 Heartwood] Shielded Coinbase

Implements [ZIP 213](https://github.com/zcash/zips/pull/217).
2020-03-06 10:19:13 +00:00
Jack Grigg d8f0bc9e21 init: Inform on error that -mineraddress must be Sapling or transparent 2020-03-06 13:18:04 +13:00
Jack Grigg 3b3382bb48 Adjust comments on ZIP 213 logic 2020-03-06 11:50:15 +13:00
Jack Grigg 9ea5f6907f Add regtest-only -nurejectoldversions option
This enables us to write RPC tests for network upgrades before they have
been activated on testnet.
2020-02-28 13:59:53 +13:00
Jack Grigg 99ec1ff971 Add support for Sapling addresses in -mineraddress 2020-02-28 13:59:53 +13:00
Sean Bowe e597ad842a
Clarify comment 2020-02-27 17:57:59 -07:00
Sean Bowe faca79eb2f
Initialize ThreadNotifyWallets before additional blocks are imported.
Co-authored-by: Daira Hopwood <daira@electriccoin.co>
2020-02-26 11:20:12 -07:00
Daira Hopwood 7fa7225509 Update GetAdjustedTime() to GetTime().
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-02-25 16:57:22 +00:00
Daira Hopwood ddc2bbf742 Revert "Add -maxtimeadjustment with default of 0 instead of the 4200 seconds used in Bitcoin Core."
This reverts commit eb5e328073.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-02-24 16:27:07 +00:00
Gregory Maxwell 9f4ad7e1c6 Move GetWarnings() into its own file.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-02-21 01:31:16 +00:00
Alfredo Garcia e992825e0a add txexpirynotify 2020-02-13 21:42:25 -03:00
Homu a2d719b9ff Auto merge of #4324 - zancas:4323_replace_boost_fn_w_std_fn, r=str4d
Replace boost::function with std::function

Fixes: #4323

This logic is cherry-picked from the relevant commit, as referenced here:

https://github.com/bitcoin/bitcoin/pull/10395
2020-02-07 20:49:18 +00:00
Daira Hopwood eb5e328073 Add -maxtimeadjustment with default of 0 instead of the 4200 seconds used in Bitcoin Core.
Based on 40061b05dc

Co-authored-by: mruddy <mruddy@users.noreply.github.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-02-05 17:00:09 +00:00
practicalswift b841318ce8
Replace boost::function with std::function (C++11) 2020-02-04 19:54:25 -07:00
Homu fa341bcff0 Auto merge of #4270 - str4d:2074-wallet-2, r=str4d
Bitcoin wallet PRs 2

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7576
- bitcoin/bitcoin#7577
- bitcoin/bitcoin#7608
- bitcoin/bitcoin#7691
- bitcoin/bitcoin#7905
2019-12-18 23:53:21 +00:00
Jonas Schnelli 6c1b6c8ccc
[Wallet] refactor wallet/init interaction 2019-12-18 16:50:29 -06:00
Jonas Schnelli 5b376b5125
[Wallet] optimize return value of InitLoadWallet() 2019-12-18 16:50:29 -06:00
Jonas Schnelli c3ca0163a8
[Wallet] move "load wallet phase" to CWallet
Zcash: Modified to move our modifications to "load wallet phase".
2019-12-18 16:50:29 -06:00
Jonas Schnelli 8dacb764bc
[Wallet] move wallet help string creation to CWallet 2019-12-18 16:50:29 -06:00
Homu 0a31c163c6 Auto merge of #4252 - str4d:wallet-interface-refactor, r=str4d
Wallet interface refactor

This refactors the logic introduced in #4144 to improve the separation between the node and wallet. The notifier thread now lives next in `src/validationinterface.cpp` directly next to the existing `CMainSignals` node-wallet interface.

Part of #3877.
2019-12-18 22:48:26 +00:00
Jack Grigg 2c8dff00cc
ThreadNotifyRecentlyAdded -> ThreadNotifyWallets 2019-12-18 15:06:54 -06:00
Luke Dashjr 996d6c3f54
Common argument defaults for NODE_BLOOM stuff and -wallet 2019-12-17 12:18:50 -06:00
MarcoFalke 386245e164
mempool: Replace maxFeeRate of 10000*minRelayTxFee with maxTxFee 2019-12-17 12:18:50 -06:00
MarcoFalke 2187f93703
HelpMessage: Don't hide -mintxfee behind showDebug 2019-12-17 12:18:50 -06:00
MarcoFalke 4db07b29c8
[trivial] init: Use defaults MIN_RELAY_TX_FEE & TRANSACTION_MAXFEE 2019-12-17 12:18:50 -06:00
MarcoFalke f4b9c3283d
translations: Don't translate markdown or force English grammar 2019-12-17 12:18:50 -06:00
MarcoFalke ab77f894b7
Clarify what minrelaytxfee does 2019-12-17 12:18:50 -06:00
MarcoFalke e3bdf82dc2
Init: Use DEFAULT_TRANSACTION_MINFEE in help message 2019-12-17 12:18:50 -06:00
MarcoFalke 3de455e138
[trivial] init cleanup 2019-12-17 12:18:50 -06:00