Commit Graph

68 Commits

Author SHA1 Message Date
Jack Grigg
0d37ae3a59 Migrate Zcash-specific code to UniValue 2017-02-10 00:52:57 +00:00
zkbot
b2e2dccc64 Auto merge of #2068 - bitcartel:2045_sendmany_fee_zero, r=bitcartel
Closes #2045 by allowing z_sendmany with 0 fee
2017-02-09 18:56:44 +00:00
Simon
43b6753782 Update zrpc vs zrpcunsafe logging in z_sendmany operation 2017-02-08 10:50:40 -08:00
Simon
7eccce4e44 Closes #2045 by allowing z_sendmany with 0 fee 2017-02-06 14:14:28 -08:00
Simon
ee84f279a9 Update z_sendmany logging 2017-02-01 09:27:44 -08:00
Simon
3110b793f0 Closes #2057 by adding extra zrpcunsafe logging 2017-01-31 22:00:46 -08:00
zkbot
f37f0805cc Auto merge of #1980 - bitcartel:fix_z_sendmany_logging_bug_txid, r=ebfull
Fix bug where z_sendmany logged incorrect txid fragment when sending from taddr

Closes #1987.
2017-01-18 05:10:18 +00:00
zkbot
c583e42e6b Auto merge of #1977 - bitcartel:1967_z_sendmany_debug_age_of_notes, r=ebfull
Fixes #1967 by adding age of note to z_sendmany logging.
2017-01-18 04:29:06 +00:00
zkbot
1e8778a274 Auto merge of #1976 - bitcartel:1964_z_sendmany_exception_handling, r=ebfull
Fixes #1964 to catch general exception in z_sendmany and catch exceptions as reference-to-const.
2017-01-18 03:48:12 +00:00
Simon
8aa7937d44 Fixes #1960: z_getoperationstatus/result now includes operation details. 2017-01-16 16:45:27 -08:00
Simon
4c1cd287be Fixes a bug where the unsigned transaction was logged by z_sendmany
after a successful sign and send, meaning that the logged hash fragment
would be different from the txid logged by "AddToWallet".  This issue
occured when sending from transparent addresses, as utxo inputs must be
signed.  It did not occur when sending from shielded addresses.
2017-01-04 12:26:23 -08:00
Simon
01f6c5dbee Fixes #1967 by adding age of note to z_sendmany logging. 2017-01-03 23:57:11 -08:00
Simon
fce7260811 Fixes #1964 to catch general exception in z_sendmany and catch
exceptions as reference-to-const.
2017-01-03 12:50:19 -08:00
zkbot
a398121503 Auto merge of #1919 - ebfull:abstract-verification, r=str4d
Isolate verification to a ProofVerifier context object that allows verification behavior to be tuned by the caller.

This is an alternative foundation for #1892, i.e., #1892 will have to be changed if this PR is accepted.

I think this is a safer approach because it allows us to isolate verification behavior to a single object. This will come in handy when @arielgabizon finishes the batching code.
2016-12-09 06:22:53 +00:00
zkbot
e68e26c208 Auto merge of #1911 - bitcartel:1823_witness_does_not_have_same_anchor_as_change_input, r=str4d
With chained joinsplits, witness anchors for input notes no longer cross block boundaries

Closes #1823
2016-12-08 01:23:40 +00:00
Simon
84e8c5f921 WitnessAnchorData only needs to store one witness per JSOutPoint. 2016-12-07 12:05:29 -08:00
Sean Bowe
bc59f53722 Isolate verification to a ProofVerifier context object that allows verification behavior to be tuned by the caller. 2016-12-05 12:40:06 -07:00
Simon
2d931e905b Fixes #1823. Witness anchors for input notes no longer cross block boundaries. 2016-12-03 00:22:42 -08:00
Simon
af53da0225 Closes #1903. Add fee parameter to z_sendmany. 2016-11-30 14:23:35 -08:00
Simon
0afd3687c8 Closes #1854. z_sendmany selects more utxos to avoid dust change output. 2016-11-15 17:12:37 -08:00
Simon
de38bfbbed Track the correct change witness across chained joinsplits 2016-11-15 12:39:16 -08:00
Simon
9384e74c50 Closes #1833. Format currency amounts in z_sendmany error message.
Improve coverage of possible error states from z_sendmany.
Refactor qa test for z_sendmany operations.
2016-11-10 16:57:36 -08:00
Simon
38276c6ba2 Add GenIdentity, an identity function for MappedShuffle.
We use this function in z_sendmany as part of the fix for #1779.
2016-11-05 14:17:19 -07:00
Simon
7c463780cf Fixes #1779 so that sending to multiple zaddrs no longer fails.
Commit 2eeb6b randomized the order of input and output notes,
but this is now known to prevent the chaining of multiple joinsplits
in a single transaction.  The root cause has yet to be determined.

This patch is a temporary fix and disables the shuffling of input
and output notes.  It also adds a chained joinsplit test to the
python qa test suite.
2016-11-04 23:23:48 -07: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
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
Jack Grigg
aa36398b27 Add more assertions, throw if find_output params are invalid 2016-10-19 08:49:08 -05:00
Jack Grigg
328d39d29c Remove stale comment 2016-10-18 13:10:20 -05:00
Jack Grigg
2eeb6bebde Randomize JoinSplits in z_sendmany 2016-10-18 10:41:30 -05: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
Simon
438d1e45be Use -debug=zrpc for z_* rpc calls (#1504) 2016-10-12 15:46:24 -07:00
Simon
b11bb0e26a Replace GetTxid() with GetHash() 2016-09-08 21:54:34 -07:00
Simon
e79ded8a47 Remove line of commented out code we don't need 2016-09-08 21:46:15 -07:00
Simon
dfc0080d06 Update comment with ticket issue number 2016-09-08 21:46:15 -07:00
Simon
1eb8789789 Add assert 2016-09-08 21:46:15 -07:00
Simon
ed42053a6c Fix formatting 2016-09-08 21:46:15 -07:00
Simon
2ad0b7bfe2 Use zcash constants 2016-09-08 21:46:15 -07:00
Simon
b99d4f9b17 Improve error reporting when attempting to spend coinbase utxos. 2016-09-08 21:46:15 -07:00
Simon
9fb18458e8 Add assert for two mutually exclusive member variables. 2016-09-08 21:46:15 -07:00
Simon
cc59ac12a9 Add ticket number to issues raised in comment. 2016-09-08 21:46:15 -07:00
Simon
00edda4ac6 Remove unused varible. 2016-09-08 21:46:15 -07:00
Simon
a101ef7979 Update log statement to include fee. 2016-09-08 21:46:15 -07:00
Simon
1b141933e5 Rename GetUnspentNotes to GetFilteredNotes
Added parameter to ignore spent notes, which is true by default.
2016-09-08 21:46:15 -07:00
Simon
fc46069e81 Add more logging. 2016-09-08 21:46:14 -07:00
Simon
a9743bc8bf Refactor async sendmany and getbalance calls to use GetUnspentNotes(). 2016-09-08 21:46:14 -07:00
Simon
269310ce3c Replace zcashParams_ with global. 2016-09-08 21:46:14 -07:00