Commit Graph

6579 Commits

Author SHA1 Message Date
Jack Grigg 08d6b02d5e
Rename libbitcoinconsensus to libzcashconsensus
Closes #1563
2016-10-18 16:45:37 -05:00
Simon f7a624299d Update release version number for 1.0.0-rc1 2016-10-17 10:59:07 -07:00
Jack Grigg 6a7acc29a1
Set CBlockIndex.hashAnchor correctly in ConnectBlock 2016-10-17 11:09:24 -05:00
Jack Grigg 85457ddec1
Add clear error message for upgrading users 2016-10-17 09:55:02 -05:00
Jack Grigg b6961fc112
Increment witnesses for new transactions on rescan
Closes #1400
2016-10-17 09:55:02 -05:00
zkbot fd23341f1e Auto merge of #1547 - daira:1378-witness-cache-assertion-failure.1, r=bitcartel
Add more precise assertions in IncrementNoteWitnesses

Part of #1378
2016-10-17 03:00:19 -04:00
zkbot 98224d76f5 Auto merge of #1521 - zcash:gitian, r=bitcartel
Update Linux Gitian descriptor for building Zcash

Changes required to use the Gitian builder at https://github.com/zcash/zcash-gitian

Closes #540.
2016-10-17 01:55:03 -04:00
zkbot 4ee9d712b5 Auto merge of #1541 - str4d:upstream-gitian-updates, r=bitcartel
Upstream gitian updates

This PR pulls in all gitian-related PRs that have been merged upstream since 0.11.2. The only ones I left out were documentation-only PRs, because we removed `doc/gitian-building.md` at some point. Here are the commits applied here, in the order shown in `git log` (ie. last to first):

- bitcoin/bitcoin#7283
  - fa42a67
  - fa58c76
- bitcoin/bitcoin#8175
  - 74c1347
- bitcoin/bitcoin#8167
  - 7e7eb27
  - ad38204
  - b676f38
- bitcoin/bitcoin#7776
  - f063863
- bitcoin/bitcoin#7424
  - a81c87f ~ we already partly applied
  - a8ce872
  - f3d3eaf ~ we already partly applied
  - 475813b
  - ~~cd27bf5~~ X we already applied
- bitcoin/bitcoin#7060
  - 3b468a0 ~ we removed doc/gitian-building.md
  - ~~99fda26~~ X we removed doc/gitian-building.md
- bitcoin/bitcoin#7251
  - fa09562
- bitcoin/bitcoin#6900
  - ~~2cecb24~~ X we removed doc/gitian-building.md
  - 957c0fd
  - 2e31d74
  - ~~0b416c6~~ X we removed QT
  - 9f251b7
- bitcoin/bitcoin#6854
  - 579b863 ~ we already partly applied

Part of #540
2016-10-17 01:17:01 -04:00
Daira Hopwood 95e32d88b0 Add another assertion about the witness cache.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-17 05:09:27 +01:00
Daira Hopwood 8e41408aa7 Add another assertion to narrow down where the bug occurs.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-17 05:09:27 +01:00
Daira Hopwood 8a7d37befd Move the increment of nWitnessCacheSize to make the later assertions correct.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-17 05:09:27 +01:00
Jack Grigg 83d7b5b67b Add more asserts to track down the bug 2016-10-17 05:09:27 +01:00
zkbot ec8dc3a88a Auto merge of #1431 - bitcartel:master_1373_taddr_coinbase_error, r=bitcartel
Return a more informative error message when trying to spend coinbase; select non-coinbase inputs when sending to a transparent output if needed

For #1373 and #1519

Code change:
- Extra parameter added to AvailableCoins to include or exclude Coinbase coins.  Default value of parameter is 'true' as current behaviour is to include Coinbase coins.
- SelectCoins, used for sending taddr->taddr, will now exclude Coinbase coins.

Unit test:
Tried to write a test to focus on the extra parameter added to AvailableCoins but could not.

Empirical testing on Testnet:
Current behaviour is that upstream RPC commands sendfrom and sendtoaddress try to spend coinbase coins returned by AvailableCoins.  So the user will see:

```
./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 1000.0
error: {"code":-6,"message":"Insufficient funds"}

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
error: {"code":-4,"message":"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."}

./zcash-cli sendfrom "" mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
error: {"code":-4,"message":"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."}
```

After fix is applied:

```
./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 1000.0
error: {"code":-6,"message":"Insufficient funds"}

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
error: {"code":-4,"message":"Coinbase funds can only be sent to a zaddr"}
```

When non-coinbase UTXOs exist, they will now be selected and used:

```
./zcash-cli z_sendmany tnPJZHeVxegCg91utaquBRPEDBGjozfz9iLDHt7zvphFbZdspNgkTVLCGjDcadQBKNyUwKs8pNjDXuEZKrE1aNLpFwHgz4t '[{"address":"mx5fTRhLZwbYE7ZqhAPueZgQGSnwTbdvKU", "amount":0.01}]'

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 1000.0
error: {"code":-6,"message":"Insufficient funds"}

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
9818e543ac2f689d4ce8b52087607d73fecd771d45d316a1d9db092f0485aff2

./zcash-cli sendfrom "" mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
899f2894823f51f15fc73b5e0871ac943edbe0ff88e1635f86906087b72caf30
```
2016-10-16 22:08:07 -04:00
Simon 2b1cda3b6a Return improved error message when trying to spend Coinbase coins (#1373).
Extra parameter added to AvailableCoins to include or exclude Coinbase coins.
SelectCoins, used for sending taddr->taddr, will exclude Coinbase coins.

Added qa rpc test and a runtime parameter -regtestprotectcoinbase to enforce
the coinbase->zaddr consensus rule in regtest mode.
2016-10-16 19:05:56 -07:00
Jack Grigg 6e263a5fd3
Address review comments 2016-10-16 16:26:51 -05:00
Kevin Gallagher b2ba9d64ed
Adds json_test_vectors.h to zcash_gtest_SOURCES 2016-10-15 15:57:11 -05:00
Kevin Gallagher 2f3ecb4422
Adds zcbenchmarks.h to libbitcoin_wallet_a_SOURCES 2016-10-15 15:57:11 -05:00
Kevin Gallagher 58d09f27f5
Adds files in src/zcash/circuit to libzcash_a_SOURCES 2016-10-15 15:57:11 -05:00
Kevin Gallagher 7553b173b7
Add alertkeys.h to libbitcoin_server_a_SOURCES 2016-10-15 15:57:11 -05:00
Kevin Gallagher 9ffe371d09
Adds zcash/Proof.hpp to LIBZCASH_H 2016-10-15 15:57:11 -05:00
Kevin Gallagher cc552e4db8
Adds zcash/Zcash.h to LIBZCASH sources 2016-10-15 15:57:11 -05:00
Kevin Gallagher 60157808cd
Inlude crypto/equihash.tcc in list of sources for dist 2016-10-15 15:57:11 -05:00
Jack Grigg c06664fb8f
Fix Makefiles so "make dist" will run 2016-10-15 15:57:11 -05:00
Cory Fields a5e918a07f
release: add check-symbols and check-security make targets
These are not added to the default checks because some of them depend on
release-build configs.

[Zcash: See 56734f4b27 for check-security]
2016-10-15 14:02:29 -05:00
Jack Grigg a581fe2aae
Only ignore runtime errors caused by failed note decryption 2016-10-14 17:16:09 -05:00
Jack Grigg ddea44a27e
Update comments 2016-10-14 17:16:09 -05:00
Jack Grigg 1a62587e9a
Delay caching of nullifiers when wallet is locked
Closes #1502
2016-10-14 17:16:09 -05:00
Jack Grigg fb2653ed0e
Add unit test that fails when calling FindMyNotes on a locked wallet 2016-10-14 17:14:13 -05:00
zkbot cc10005247 Auto merge of #1486 - str4d:1456-writewitnesscache-exception-safety, r=bitcartel
WriteWitnessCache: Catch errors and abort transaction

Closes #1452
2016-10-14 17:37:53 -04:00
zkbot 3fceaca3a1 Auto merge of #1506 - bitcartel:master_1478_fix_testnet3_test_issue, r=bitcartel
Stop some wallet tests creating ~/.zcash/testnet3 folder by setting -datadir environment

Closes #1478
2016-10-14 17:03:11 -04:00
Simon b13a87c6d7 Reorder gtests in zcash-gtest.
There is an issue where checktransaction_tests will output errors to ~/.zcash/testnet3/debug.log
because other tests which run before it select the testnet chain parameters.
2016-10-14 13:36:53 -07:00
Simon 6be367ea6d Fix test so that the encrypted wallet is output to the test_bitcoin -datadir folder. 2016-10-14 12:44:22 -07:00
4ZEC cc6c9ec05e Correct line swap
Pretty clear the author wanted these two lines in other order.
2016-10-14 13:35:22 -04:00
zkbot 27bc01a05b Auto merge of #1523 - bitcartel:master_1504_z_logging, r=bitcartel
Refine LogPrint debugging for z_* rpc calls

For #1504 ZCA011
2016-10-14 11:11:26 -04:00
Jack Grigg 6da46b692a
Refactor test to clarify expectations 2016-10-14 09:31:26 -05:00
zkbot bb25bd4bc1 Auto merge of #1533 - bitcartel:master_1447_document_getfilterednotes, r=bitcartel
Document CWallet::GetFilteredNotes

Also fixes return type of method which should be void.

Part of #1447
2016-10-13 20:25:19 -04:00
Simon cb0d208f6b Document CWallet::GetFilteredNotes and fix return type which should be
void.
2016-10-13 17:01:54 -07:00
zkbot 2b29970e28 Auto merge of #1531 - str4d:1447-document-findmynotes, r=bitcartel
Document CWalletTx::FindMyNotes

Part of #1447
2016-10-13 19:51:06 -04:00
Jack Grigg e492d98632
Document CWalletTx::FindMyNotes
Part of #1447
2016-10-13 18:27:58 -05:00
zkbot 8eb672251b Auto merge of #1513 - bitcartel:master_1491_fix_help_message_rpc_z_importkey, r=daira
Fixes #1491 by updating help message for rpc call z_importkey
2016-10-13 19:05:08 -04:00
Simon 438d1e45be Use -debug=zrpc for z_* rpc calls (#1504) 2016-10-12 15:46:24 -07:00
Simon 5bd677f5c6 Rename client identifier from Satoshi to MagicBean (closes #1481) 2016-10-12 10:50:05 -07:00
Simon e346a0b3f8 Add tests to verify that all z_* rpc calls return an error if there are too many input parameters. 2016-10-12 10:15:12 -07:00
Simon 49e591eb89 Fix incorrect check of number of parameters for z_getnewaddress. 2016-10-12 10:14:32 -07:00
Simon 950f8ffdb6 Fixes #1491 by updating help message for rpc call z_importkey 2016-10-11 16:52:38 -07:00
Jack Grigg 82c2d97c60
Add unit tests for WriteWitnessCache
Requires moving implementation into header
2016-10-11 09:33:47 -05:00
zkbot 7dc49cbc6a Auto merge of #1490 - str4d:1454-deprecate-accounts, r=bitcartel
Throw an RPC error for all accounts except the default

Closes #1454
2016-10-10 23:55:02 -04:00
Simon 32bf097f90 Fixes #1478 by ensuring wallet tests have the -datadir environment set appropriately. 2016-10-10 20:23:24 -07:00
zkbot 4210e20c9c Auto merge of #1501 - ebfull:100kb-max-tx, r=ebfull
Make 100KB transaction size limit a consensus rule, rather than a standard rule

Closes #1475
2016-10-10 15:39:42 -04:00
Jack Grigg 715e5bbefd
Correct docstring 2016-10-10 10:47:38 -05:00