Commit Graph

11214 Commits

Author SHA1 Message Date
Daira Hopwood
473a113241 Don't increase banscore if the transaction only just expired.
Author: Jack Grigg <str4d@z.cash>
2018-04-04 01:29:47 +01:00
Daira Hopwood
a0ea82301a Test that receiving an expired transaction does not increase the peer's ban score. 2018-04-04 00:01:49 +01:00
Daira Hopwood
697140ede5 Add support for Overwinter v3 transactions to mininode framework. 2018-04-04 00:01:23 +01:00
Jay Graber
e4dff510b4 Set ban score for expired txs to 0 2018-04-03 23:50:43 +01:00
Homu
77669b952b Auto merge of #2598 - str4d:2074-dbwrapper, r=str4d
Bitcoin 0.12+ dbwrapper improvements

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6650
  - Only refactor - excludes obfuscation
- bitcoin/bitcoin#6777
  - Excluding obfuscation-related changes
- bitcoin/bitcoin#6865
- bitcoin/bitcoin#6823
- bitcoin/bitcoin#6873
- bitcoin/bitcoin#7927
  - Excluding first commit (already included) and second commit (obfuscation-related)
- bitcoin/bitcoin#8467

Part of #2074.
2018-04-03 14:11:29 -07:00
Jack Grigg
2d7bae5b33 Update CBlockTreeDB::EraseBatchSync for dbwrapper refactor 2018-04-03 21:38:34 +01:00
Homu
599c847818 Auto merge of #2820 - str4d:darwin-build-patches, r=str4d
[macOS] Darwin build patches

Part of #2246.
2018-04-03 12:44:24 -07:00
Pavel Janík
56aa25684c Do not shadow members in dbwrapper 2018-04-03 20:40:54 +01:00
Wladimir J. van der Laan
3923bcca7c dbwrapper: Move HandleError to dbwrapper_private
HandleError is implementation-specific.
2018-04-03 20:40:54 +01:00
Wladimir J. van der Laan
809a429ecf dbwrapper: Pass parent CDBWrapper into CDBBatch and CDBIterator
Zcash: Makes future extensions easier.

Original description (when this was introduced upstream):

Pass parent wrapper directly instead of obfuscation key. This
makes it possible for other databases which re-use this code
to use other properties from the database.

Add a namespace dbwrapper_private for private functions to be used
only in dbwrapper.h/cpp and dbwrapper_tests.
2018-04-03 20:40:54 +01:00
Jeff Garzik
e3da7a572d leveldbwrapper file rename to dbwrapper.* 2018-04-03 20:40:54 +01:00
Jeff Garzik
f345c41ec4 leveldbwrapper symbol rename: Remove "Level" from class, etc. names 2018-04-03 20:40:54 +01:00
Jeff Garzik
7249ee6d7c leveldbwrapper: Remove unused .Prev(), .SeekToLast() methods
Also, trim trailing whitespace.
2018-04-03 20:40:54 +01:00
Daniel Kraft
c77586964a trivial: use constants for db keys
Replace literal occurances of the key "prefixes" 'c' and 'b' in txdb.cpp
by the respective constants.
2018-04-03 20:40:54 +01:00
Jack Grigg
26cdb83add Update blockchain.py RPC test for Zcash 2018-04-03 20:40:54 +01:00
Pieter Wuille
f95bf4c417 Fix chainstate serialized_size computation 2018-04-03 20:40:54 +01:00
James O'Beirne
79272bfaf9 Add tests for gettxoutsetinfo, CLevelDBBatch, CLevelDBIterator
Thanks @dexX7.
2018-04-03 20:40:54 +01:00
James O'Beirne
0d9524ba6b Minor bugfixes
Was "Handle obfuscation in CLevelDBIterator"

Zcash: Only bugfixes
2018-04-03 20:40:54 +01:00
Pieter Wuille
1ebf50b6da Encapsulate CLevelDB iterators cleanly
Conflicts:
	src/leveldb.cpp
	src/leveldb.h
	src/txdb.cpp
2018-04-03 20:40:54 +01:00
Jack Grigg
3a8e1d0cf4 Refactor Zcash changes to CCoinsViewDB
To match upstream changes.
2018-04-03 20:40:54 +01:00
James O'Beirne
0d81464be7 Refactor leveldbwrapper
Was "Add chainstate obfuscation to avoid spurious antivirus detection"

Zcash: Extracted the refactor, omitting the chainstate obfuscation.
2018-04-03 20:40:54 +01:00
Homu
3055fd5508 Auto merge of #3136 - str4d:2937-z_importviewingkey-startheight, r=daira
Fix z_importviewingkey startHeight parameter

Closes #2937.

Co-authored-by: Tomas M <tomas@slax.org>
2018-04-03 09:41:09 -07:00
Homu
395ed619a0 Auto merge of #2899 - str4d:2829-alertnotify-deprecation, r=str4d
Notify users about auto-senescence via -alertnotify

Closes #2829.
2018-04-03 06:07:08 -07:00
Homu
3a47b9bcfd Auto merge of #3132 - str4d:2898-rewind-block-index, r=daira
When rewinding, remove insufficiently-validated blocks

If a block is insufficiently-validated against a particular branch ID, then we
cannot guarantee that even the block header will be valid under the actual
consensus rules the node will want to apply. Instead require that the blocks are
completely re-validated, by removing them from the block index (which is
equivalent to reducing their validity to BLOCK_VALID_UNKNOWN).

Closes #3100.
2018-04-03 04:37:21 -07:00
Jack Grigg
6c44424322 Adjust deprecation message to work in both UI and -alertnotify 2018-04-03 12:17:30 +01:00
Jack Grigg
f5007d8912 When rewinding, remove insufficiently-validated blocks
If a block is insufficiently-validated against a particular branch ID, then we
cannot guarantee that even the block header will be valid under the actual
consensus rules the node will want to apply. Instead require that the blocks are
completely re-validated, by removing them from the block index (which is
equivalent to reducing their validity to BLOCK_VALID_UNKNOWN).
2018-04-03 10:58:31 +01:00
Jack Grigg
fe87fd2b36 Add RPC test of RewindBlockIndex 2018-04-03 10:58:27 +01:00
Homu
ca981fd442 Auto merge of #3080 - leto:jsindex, r=bitcartel
Return JoinSplit and JoinSplitOutput indexes in z_listreceivedbyaddress

This implements a feature request by @nathan-at-least in https://github.com/zcash/zcash/issues/2932 and I wanted to ask for feedback about the exact form of the data returned before updating tests and docs.
2018-04-03 00:30:11 -07:00
Jack Grigg
28915c30ca Fix z_importviewingkey startHeight parameter
Closes #2937.
2018-04-03 02:43:52 +01:00
Jonathan "Duke" Leto
afdd64c6ae Add tests for new JoinSplit keys returned by z_listreceivedbyaddress 2018-04-02 13:23:00 -07:00
Homu
65dedeeae3 Auto merge of #3131 - str4d:3096-cargo-checksum-fixes, r=daira
depends: Fix regex bugs in cargo-checksum.sh
2018-04-01 05:54:41 -07:00
Homu
347804fe73 Auto merge of #3106 - braddmiller:3046-mergetoaddress-concurrent, r=str4d
Add Note Locking to z_mergetoaddress

Adds note locking to `z_mergetoaddress` allowing it to be invoked multiple times before previous `z_mergetoaddress` operations have finished.

Reference issue [#3046](https://github.com/zcash/zcash/issues/3046)

Co-authored-by: Eirik Ogilvie-Wigley <eirik@z.cash>
2018-03-30 14:29:17 -07:00
Homu
1a9caa6ac1 Auto merge of #3127 - str4d:2688-mandatory-rust, r=ebfull
Make Rust compilation mandatory

The temporary integration check in CheckEquihashSolution() remains, until we
have "real" Rust code to integrate.

Closes #2688.
2018-03-30 12:58:34 -07:00
Jack Grigg
0e400c8854 depends: Fix regex bugs in cargo-checksum.sh 2018-03-30 19:06:51 +01:00
Homu
989e16e302 Auto merge of #3130 - bitcartel:upgrade_openssl_1.1.0h, r=str4d
Upgrade OpenSSL to 1.1.0h

Closes #3129
2018-03-30 10:02:15 -07:00
Homu
72f14060bc Auto merge of #3098 - str4d:2343-overwinter-disable-mempooltxinputlimit, r=str4d
Ignore -mempooltxinputlimit once Overwinter activates

Overwinter changes the SignatureHash function to solve the quadratic hashing problem, so this option will no longer be needed.
2018-03-30 08:33:58 -07:00
Simon
09bf7d2d3c Upgrade OpenSSL to 1.1.0h 2018-03-29 23:05:17 -07:00
Brad Miller
4e6400bc00 Implement note locking for z_mergetoaddress
Co-authored-by: Eirik Ogilvie-Wigley <eirik@z.cash>
2018-03-29 15:48:34 -06:00
Jack Grigg
9666cc912a Test calling z_mergetoaddress to merge notes while a note merge is ongoing 2018-03-29 15:38:26 -06:00
Jack Grigg
b96f7d692d wallet: Cast size_t to uint64_t before passing to UniValue 2018-03-29 01:05:45 +02:00
Jack Grigg
4ff92bb6d8 rpcwallet.cpp: Cast size_t to uint64_t before passing to UniValue 2018-03-29 01:02:58 +02:00
Jack Grigg
8e95a12b63 Cast ZCIncrementalMerkleTree::size() to uint64_t before passing to UniValue
size_t is ambiguous for serialization, and UniValue doesn't have an API for
handling this internally.
2018-03-28 19:51:48 +02:00
Homu
5bdce01848 Auto merge of #2913 - bitcartel:2910_z_listunspent, r=bitcartel
Closes #2910. Add z_listunspent RPC call.

Have tested on network.  Opening up for review.
2018-03-28 10:40:49 -07:00
Simon
d72c19a662 Closes #2910. Add z_listunspent RPC call. 2018-03-28 10:38:57 -07:00
Jack Grigg
f0118aaa0b Add base case to CurrentEpoch() 2018-03-28 18:29:20 +02:00
Jack Grigg
792c05d8a9 Set PLATFORM flag when compiling libsnark 2018-03-28 18:29:19 +02:00
Jack Grigg
381a79a909 libsnark: Don't set -static on Darwin
Co-authored-by: kozyilmaz <kazim@monolytic.com>
2018-03-28 18:29:19 +02:00
Jack Grigg
4fe053e6e8 Move explicit instantiation of IncrementalMerkleTree::emptyroots into header
Fixes a -Wundefined-var-template warning with clang.
2018-03-28 18:29:19 +02:00
Jack Grigg
6c7930f688 Use uint64_t instead of size_t for serialized indices into tx.vjoinsplit
size_t has no guarantee of uniform size, and thus far has been serialized as a
uint64_t on supported platforms.
2018-03-28 18:29:19 +02:00
Jack Grigg
d58ed91af0 Optimise serialization of MerklePath, avoiding ambiguity of std::vector<bool>
The serialization enforces a maximum supported Merkle tree depth of 64.

Closes #2831.
2018-03-28 18:26:08 +02:00