Commit Graph

234 Commits

Author SHA1 Message Date
Sean Bowe
c4643bd949 Throw more descriptive exceptions when the constraint system is violated. 2016-11-01 14:52:03 -06:00
Sean Bowe
58c4c0bba3 Change some Bitcoin strings to Zcash strings. 2016-10-26 13:29:05 -06:00
zkbot
489f1d38ee Auto merge of #1629 - bitcartel:1616_wallet_disallow_coinbase_change, r=daira
Add z_sendmany rule that when coinbase utxos must be spent in their entirety, with no change

See #1616 - coinbase utxos must be consumed entirely, without any change, since there
is currently no way to specify a change address in z_sendmany.
2016-10-25 15:40:36 -04:00
Simon
ad0ba9467d Add assert to AsyncRPCOperation_sendmany 2016-10-25 11:25:05 -07:00
Simon
db026807b8 Add z_sendmany rule that when sending coinbase utxos to a zaddr
they must be consumed entirely, without any change, since there
is currently no way to specify a change address in z_sendmany.
2016-10-24 21:34:16 -07:00
Simon
10d1b90987 Fix incorrect error message in z_sendmany 2016-10-24 07:59:32 -07:00
zkbot
71043784dd Auto merge of #1586 - bitcartel:z_sendmany_amount_too_strict, r=daira
Fix issue where z_sendmany amount parameter is too strict

Upstream treats an amount parameter of `1` the same as `1.0`.  Third-party would like this fixed.
2016-10-21 22:10:41 -04:00
zkbot
fd7ef7b632 Auto merge of #1584 - bitcartel:1504_zca_011_logging, r=daira
More granular control over logging of z_* calls

Closes #1504
2016-10-21 21:32:46 -04:00
zkbot
cd8e856df7 Auto merge of #1585 - bitcartel:1583_stop_test_writing_to_testnet3, r=daira
Closes #1583 by setting up the datadir for the wallet gtest.

Stops test writing to ~/.zcash/testnet3.
Also related to #1506
2016-10-21 03:15:00 -04:00
zkbot
323b8214c2 Auto merge of #1580 - str4d:1378-repair-witness-cache, r=daira
Clear witness cache when re-witnessing notes

Closes #1378
2016-10-21 00:24:39 -04:00
Simon
75407c6872 Fix issue where z_sendmany is too strict and does not allow integer based amount e.g. 1 which is the same as 1.0 2016-10-20 17:03:57 -07:00
Simon
ffd2cb3437 Closes #1583 by setting up the datadir for the wallet gtest. 2016-10-20 16:45:02 -07:00
Simon
446f867b4c Add debug option "zrpcunsafe" to be used when logging more sensitive information such as the memo field of a note. 2016-10-20 15:24:31 -07:00
zkbot
f90526579b Auto merge of #1569 - str4d:1552-disable-wallet-encryption, r=daira
Disable wallet encryption

Closes #1552
2016-10-20 17:01:51 -04:00
Jack Grigg
1532cb75f3 Throw an error when encryptwallet is disabled 2016-10-20 12:58:20 -05:00
Jack Grigg
1b407cba2b Add heights to log output 2016-10-20 11:02:15 -05:00
Jack Grigg
878c4b1b50 Clear witness cache when re-witnessing notes
Closes #1378
2016-10-20 10:32:20 -05:00
Jack Grigg
aa36398b27 Add more assertions, throw if find_output params are invalid 2016-10-19 08:49:08 -05:00
Jack Grigg
62c0aa9e58 Disable wallet encryption
Closes #1552
2016-10-18 17:47:17 -05:00
Jack Grigg
328d39d29c Remove stale comment 2016-10-18 13:10:20 -05:00
Jack Grigg
3774c944f8 Refactor test code to better test JSDescription::Randomized() 2016-10-18 12:44:56 -05:00
Jack Grigg
2eeb6bebde Randomize JoinSplits in z_sendmany 2016-10-18 10:41:30 -05:00
Jack Grigg
b6961fc112 Increment witnesses for new transactions on rescan
Closes #1400
2016-10-17 09:55:02 -05: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
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
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
Simon
438d1e45be Use -debug=zrpc for z_* rpc calls (#1504) 2016-10-12 15:46:24 -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
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
Jack Grigg
7b3351ff0e Deprecated -> Unsupported in RPC error 2016-10-10 10:47:36 -05:00
Sean Bowe
74f15a73a1 Make 100KB transaction size limit a consensus rule, rather than a standard rule. 2016-10-08 00:00:23 -06:00