Commit Graph

8621 Commits

Author SHA1 Message Date
Jack Grigg a71a7341b9
Merge tree and boolean fields in ChainTip API
The trees were being unnecessarily fetched during DisconnectTip.
2019-12-18 15:06:54 -06:00
Jack Grigg a28916d273
Move mempool tx notifying logic out of CTxMemPool
ThreadNotifyWallets now collects all notification-related state at once,
and then executes wallet logic based on the collected state after
dropping any locks it is holding.
2019-12-18 15:06:54 -06:00
Jack Grigg 2c8dff00cc
ThreadNotifyRecentlyAdded -> ThreadNotifyWallets 2019-12-18 15:06:54 -06:00
Homu 63c3d1ec94 Auto merge of #4227 - str4d:2074-scripts-1, r=str4d
Bitcoin script PRs 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6335
- bitcoin/bitcoin#6424
- bitcoin/bitcoin#11058
- bitcoin/bitcoin#12460
- bitcoin/bitcoin#13194

Part of #2074.
2019-12-17 17:05:58 +00:00
str4d 31e1ea63e1
Apply suggestions from code review
Co-Authored-By: Daira Hopwood <daira@jacaranda.org>
2019-12-17 11:05:28 -06:00
Homu 5db5bd749c Auto merge of #4245 - oxarbitrage:issue4012, r=daira
Remove dead code

Closes https://github.com/zcash/zcash/issues/4012

Equivalent to bitcoin/bitcoin/pull/9822
2019-12-10 22:10:10 +00:00
Alfredo Garcia c0d5b87277 readd create_directories 2019-12-09 18:04:06 -03:00
Homu 34d428aa43 Auto merge of #4176 - oxarbitrage:issue3161, r=str4d
avoid blockchain progress greater than 1.0

Closes #3161
2019-12-09 16:02:14 +00:00
Homu 98354db098 Auto merge of #4246 - rex4539:fix-comment, r=daira
Remove stale comment

Closes https://github.com/zcash/zcash/issues/2962
2019-12-06 17:32:12 +00:00
Homu 126a3b96ae Auto merge of #4247 - rex4539:protect-to-shield, r=daira
Change "protect" terminology to "shield"

Closes https://github.com/zcash/zcash/issues/2149

Note: Renamed `wallet_protectcoinbase.py` to `wallet_shieldingcoinbase.py` because there was an existing file also named `wallet_shieldcoinbase.py`.
2019-12-06 16:29:29 +00:00
Homu f9602d407b Auto merge of #4240 - str4d:heartwood-activation-logic, r=str4d
Add Heartwood to upgrade list
2019-12-05 17:40:29 +00:00
Dimitris Apostolou f0003239f8
Change "protect" terminology to "shield" 2019-12-04 23:17:06 +02:00
Pieter Wuille 2cb14d79b1
Remove template matching and pseudo opcodes
The current code contains a rather complex script template matching engine,
which is only used for 3 particular script types (P2PK, P2PKH, multisig).
The first two of these are trivial to match for otherwise, and a specialized
matcher for multisig is both more compact and more efficient than a generic
one.

The goal is being more flexible, so that for example larger standard multisigs
inside SegWit outputs are more easy to implement.

As a side-effect, it also gets rid of the pseudo opcodes hack.
2019-12-04 20:36:46 +00:00
Ben Woosley 82beb18901
Assert CPubKey::ValidLength to the pubkey's header-relevent size
Previously this was an inline test where the specificity was probably judged
overly specific. As a class method it makes sense to maintain consistency.

And replace some magic values with their constant equivalents.

Zcash: Excludes changes to the following functions we don't have:

- ExtractPubKey (bitcoin/bitcoin#6415)
- IsCompressedPubKey (bitcoin/bitcoin#8499)
2019-12-04 20:36:45 +00:00
Jim Posen 3c8c8009db
Comments: More comments on functions/globals in standard.h.
Zcash: Excludes comments for variables and functions we don't have:

- GetScriptForRawPubKey (bitcoin/bitcoin#6415)
- GetScriptForWitness (bitcoin/bitcoin#8149)
2019-12-04 20:36:33 +00:00
Peter Todd 602960e5b5
Accept any sequence of PUSHDATAs in OP_RETURN outputs
Previously only one PUSHDATA was allowed, needlessly limiting
applications such as matching OP_RETURN contents with bloom filters that
operate on a per-PUSHDATA level. Now any combination that passes
IsPushOnly() is allowed, so long as the total size of the scriptPubKey
is less than 42 bytes. (unchanged modulo non-minimal PUSHDATA encodings)

Also, this fixes the odd bug where previously the PUSHDATA could be
replaced by any single opcode, even sigops consuming opcodes such as
CHECKMULTISIG. (20 sigops!)
2019-12-04 20:35:01 +00:00
Peter Todd 6962f1d2f0
Add IsPushOnly(const_iterator pc)
Allows IsPushOnly() to be applied to just part of the script for
OP_RETURN outputs.
2019-12-04 20:34:16 +00:00
Peter Todd cf6cf56a68
Make TX_SCRIPTHASH clear vSolutionsRet first
Previously unlike other transaction types the TX_SCRIPTHASH would not
clear vSolutionsRet, which means that unlike other transaction types if
it was called twice in a row you would get the result of the previous
invocation as well.
2019-12-04 20:34:15 +00:00
Luke Dashjr 4884e75c8c
Policy: MOVEONLY: 3 functions to policy.o:
- [script/standard.o] IsStandard
- [main.o] IsStandardTx
- [main.o] AreInputsStandard

Also, don't use namespace std in policy.cpp
2019-12-04 20:34:14 +00:00
Jorge Timón dd0c036538
Policy: MOVEONLY: Create policy/policy.h with some constants
Zcash: Adjusted to be move-only after our changes to the constants.
2019-12-04 20:34:11 +00:00
Homu 868c63f92d Auto merge of #2390 - str4d:2132-mapargs-prep, r=str4d
Misc upstream PRs

Cherry-picked from the following upstream PRs:

- https://github.com/bitcoin/bitcoin/pull/6077
  - Second commit only (first was already applied to 0.11.X and then reverted)
- https://github.com/bitcoin/bitcoin/pull/6284
- https://github.com/bitcoin/bitcoin/pull/6489
- https://github.com/bitcoin/bitcoin/pull/6235
- https://github.com/bitcoin/bitcoin/pull/6905
- https://github.com/bitcoin/bitcoin/pull/6780
  - Excluding second commit (QT) and third commit (requires https://github.com/bitcoin/bitcoin/pull/6993)
- https://github.com/bitcoin/bitcoin/pull/6961
  - Excluding QT parts, and a small `src/policy/policy.cpp` change which depends on a bunch of other PRs, which we'll have to remember to come back to.
- https://github.com/bitcoin/bitcoin/pull/7044
- https://github.com/bitcoin/bitcoin/pull/8856
- https://github.com/bitcoin/bitcoin/pull/9002

Part of #2074 and #2132.
2019-12-04 19:20:44 +00:00
Jack Grigg 6278085c23
Match alerts both with and without comments
We always locally check alerts against our subversion string without comments.
This change ensures that we will also propagate alerts to peers based on their
subversion strings without comments. Note that if an alert specifically targets
a commented subversion string, we will only relay it to peers with the exact
same comments.
2019-12-04 17:21:56 +00:00
Jack Grigg 5fd97dcdf9
Wrap long line 2019-12-04 17:21:55 +00:00
Jack Grigg 784a481070
cleanup: Comments 2019-12-04 17:21:54 +00:00
Jack Grigg dfeb5bfc6c
Parameterize zcash.conf in init error message 2019-12-04 17:21:53 +00:00
Jack Grigg 00d1efde32
Add tests covering the current interaction of alerts with subver comments 2019-12-04 17:21:52 +00:00
Jack Grigg c1ed8080f2
Handle Equihash and optional miner code in TestChain100Setup 2019-12-04 17:21:51 +00:00
Jack Grigg 26a84cc1f9
Fix benchmarks after removal of SelectParamsFromCommandLine() 2019-12-04 17:18:46 +00:00
Gregory Maxwell 9fee2baebf
Make connect=0 disable automatic outbound connections.
Otherwise it just responds to this obvious bit of configuration by
 trying to connect to "0" in a loop.
2019-12-04 17:18:45 +00:00
Jorge Timón 71068892d2
Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgs 2019-12-04 17:18:44 +00:00
Gregory Sanders f4d9e06a90
Added additional config option for multiple RPC users. 2019-12-04 17:18:43 +00:00
MarcoFalke e763ce7b20
[qt] Move GUI related HelpMessage() part downstream
Zcash: Non-QT parts only
2019-12-04 17:18:42 +00:00
MarcoFalke e11e1ea58e
[trivial] Reuse translation and cleanup DEFAULT_* values
* DEFAULT_DISABLE_SAFEMODE = false
* Use DEFAULT_* constants for extern bools
2019-12-04 17:18:41 +00:00
Luke Dashjr 9bc915b02a
Bugfix: Omit wallet-related options from -help when wallet is not supported 2019-12-04 17:18:40 +00:00
Luke Dashjr 2e02bb21f7
Constrain constant values to a single location in code 2019-12-04 17:18:39 +00:00
Jack Grigg 363c945325
Initialize experimental mode in a separate function 2019-12-04 17:18:38 +00:00
Jonas Schnelli a425ac9706
Initialize logging before we do parameter interaction 2019-12-04 17:18:37 +00:00
Jonas Schnelli ef6b9b0fb2
Refactor parameter interaction, call it before AppInit2() 2019-12-04 17:18:36 +00:00
Luke Dashjr 5bedad9580
Bugfix: Omit wallet-related options from -help when wallet is disabled 2019-12-04 17:18:35 +00:00
Luke Dashjr a624c49219
Bugfix: If genproclimit is omitted to RPC setgenerate, don't change it; also show correct default in getmininginfo 2019-12-04 17:18:34 +00:00
Luke Dashjr 3779bea091
Bugfix: Describe dblogsize option correctly (it refers to the wallet database, not memory pool) 2019-12-04 17:18:33 +00:00
Luke Dashjr b90ea483dd
Bugfix: RPC: blockchain: Display correct defaults in help for verifychain method 2019-12-04 17:18:32 +00:00
Jorge Timón bd87de60ed
Chainparams: Translations: DRY: options and error strings
Also remove SelectBaseParamsFromCommandLine and SelectParamsFromCommandLine
2019-12-04 17:18:31 +00:00
Jorge Timón af9b9652fa
Chainparams: Replace CBaseChainParams::Network enum with string constants (suggested by Wladimir) 2019-12-04 17:18:30 +00:00
Casey Rodarmor aa1d014b40
Give a better error message if system clock is bad
Fixes #2007

This checks to see if the system clock appears to be bad and gives a
helpful error message. If the user's clock is set incorrectly, hopefully
they'll abort, fix it, and then save themselves a fruitless resync.
2019-12-04 17:18:29 +00:00
Wladimir J. van der Laan 5514316892
Fix argument parsing oddity with -noX
`bitcoind -X -noX` ends up, unintuitively, with `X` set.
(for all boolean options X)

This result is due to the odd two-pass processing of arguments. This
patch fixes this oddity and simplifies the code at the same time.
2019-12-04 17:18:27 +00:00
Gavin Andresen b346588c13
Unit test doublespends in new blocks
As suggested by Greg Maxwell-- unit test to make sure a block
with a double-spend in it doesn't pass validation if half of
the double-spend is already in the memory pool (so full-blown
transaction validation is skipped) when the block is received.
2019-12-04 17:13:57 +00:00
Homu 2383d1b1de Auto merge of #4211 - dagurval:rm-mempooltxinputlimit, r=mdr0id
Remove option mempooltxinputlimit

This option is no longer used after Overwinter. Fixes #4209.
2019-12-03 20:07:20 +00:00
Homu 46f44c6a38 Auto merge of #4180 - oxarbitrage:issue3198, r=mdr0id
Add node version to metrics screen

Closes #3198.

Example output:

```
Thank you for running a mainnet zcashd v2.1.0-rc1 node!
```
2019-12-03 18:02:57 +00:00
Homu 08c92b6e93 Auto merge of #4168 - oxarbitrage:issue3571, r=mdr0id
change LoadKeyMetadata, LoadZKeyMetadata and LoadSaplingZKeyMetadata to void

Fixes #3571
2019-12-03 16:59:15 +00:00