Commit Graph
100 Commits
Author SHA1 Message Date
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 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
Simon cb0d208f6b Document CWallet::GetFilteredNotes and fix return type which should be
void.
2016-10-13 17:01:54 -07: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
Simon 32bf097f90 Fixes #1478 by ensuring wallet tests have the -datadir environment set appropriately. 2016-10-10 20:23:24 -07:00
Simon f7cfb52d3c Add vjoinsplit to JSON output of RPC call gettransaction 2016-10-06 19:53:46 -07:00
Simon 86cf60b5c8 Fixes #1345 so that UTXO debit and credits are computed correctly for a transaction. 2016-10-03 11:06:43 -07:00
Simon 4d11e5d2b9 Update mainnet addresses used for testing to have the correct number 2016-10-01 07:19:24 -07:00
Simon 2d6e97ecc5 Add field fMinerTestModeForFoundersRewardScript to chainparams 2016-09-30 18:31:51 -07:00
Simon 02acbfc262 Add mainnet 2-of-3 multisig addresses for testing. 2016-09-30 18:29:10 -07:00
Simon 6c54e9fc0b Update testnet founders reward addresses 2016-09-30 14:42:47 -07:00
Simon 88fd810150 Update founders reward test to output path of temporary wallet.dat file which contains keys which can be used for testing founders reward addresses. 2016-09-30 14:42:47 -07:00
Simon b7d072069e Update comment per review 2016-09-30 14:42:47 -07:00
Simon 22dadb35ec Refactor and fix per review 2016-09-30 14:42:47 -07:00
Simon 1a21a25e62 Refactor to add test to verify number of rewards each mainnet address will receive 2016-09-30 14:42:47 -07:00
Simon 241867b115 Founders reward: Refactor test and formatting per review. 2016-09-30 14:42:47 -07:00
Simon 3b30d8361a Founders reward: changed index computation, added new test and some refactoring. 2016-09-30 14:42:47 -07:00
Simon db0f931570 Add founders reward to ChainParams.
Fix bug where subsidy slow shift was ignored.
2016-09-30 14:42:47 -07:00
Simon 82bd9ee81b Fix comment and formatting per review 2016-09-29 22:07:38 -07:00
Simon 2aa9c0253a Update to use new API in CCryptoKeyStore and store a viewing key in walletdb. 2016-09-29 20:17:30 -07:00
Simon 73699ceaf6 Add support for spending keys to the encrypted wallet. 2016-09-29 20:17:30 -07:00
Simon eaccc007c9 Update test to filter and find notes. 2016-09-27 22:43:13 -07:00
Simon dec49d1f82 Fix GetFilteredNotes to use int for minDepth like upstream and avoid casting problems. Don't use FindMyNotes as mapNoteData has already been set on wallet tx. 2016-09-27 11:14:49 -07:00
Simon e63d14fd4d Replace %i format specifier with more commonly used %d. 2016-09-19 09:36:26 -07:00
de3dd8a015 Modify message string so we don't need to backport commits which implement FormatStateMessage and GetDebugMessage and involve changes to consensus/validation.h 2016-09-16 17:51:46 -07:00
0163f8faa2 Closes #1371 by updating signed message 2016-09-12 11:01:28 -07:00
Simon b11bb0e26a Replace GetTxid() with GetHash() 2016-09-08 21:54:34 -07:00
Simon 6114cfe767 Improve check that user supplied memo field is too long. 2016-09-08 21:46:15 -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 e2574666f6 Add lock for member variables.
Clean up and clarify that id_ and creation_time_ are never to be mutated anywhere.
Fix incomplete copy/assignment constructors.
2016-09-08 21:46:15 -07:00
Simon da5e7e5185 Formatting and updated test per review. 2016-09-08 21:46:15 -07:00
Simon 03812fefe4 Fix incorrect default value for argument of GetFilteredNotes. 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 9bdad43462 Fix formatting 2016-09-08 21:46:15 -07:00
Simon e883ffef91 Add test for calling RPC z_getbalance, z_gettotalbalance, z_listreceivedbyaddress with invalid parameters. 2016-09-08 21:46:15 -07:00
Simon 12448b6457 Add extra RPC parameter checks for minconf<0 and zaddr not belonging to wallet. 2016-09-08 21:46:15 -07:00
Simon 5e363861e0 Replace unique_lock with lock_guard, where appropriate, for consistency 2016-09-08 21:46:15 -07:00
Simon a50fd5fdb7 Add lock guard to getNumberOfWorkers() 2016-09-08 21:46:15 -07:00
Simon e91048f28d Fix formatting 2016-09-08 21:46:15 -07:00
Simon 69a4cb448a Move lock guard to start of addOperation to protect isClosed() and isFinishing() 2016-09-08 21:46:15 -07:00
Simon 61ea2abaf5 Update formatting and documentation. 2016-09-08 21:46:15 -07:00
Simon ca0ec80b4c Add 'DEPRECATED' to help message of zcraw* commands 2016-09-08 21:46:15 -07:00
Simon 6c41028f7c Add z_listreceivedbyaddress RPC call 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 6d2d045c6b Disable z_sendmany in safe mode 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 fe2f198277 Add test for GetUnspentNotes() in wallet. 2016-09-08 21:46:14 -07:00
Simon a5ac2e25a0 Add GetUnspentNotes to wallet. 2016-09-08 21:46:14 -07:00
Simon 7b79275eba Add tests to try and improve coverage of perform_joinsplit. 2016-09-08 21:46:14 -07:00
Simon 269310ce3c Replace zcashParams_ with global. 2016-09-08 21:46:14 -07:00
Simon 5f8118c8a4 Revert "Reduce use of global pzcashParams with private member variable"
This reverts commit 4d71ba58d37eb4f93d68b5e437086ce14fb24825.
2016-09-08 21:46:14 -07:00
Simon 4b32c16ba5 Reduce use of global pzcashParams with private member variable 2016-09-08 21:46:14 -07:00
Simon 485145ea78 Disable proof generation when testmode is enabled in async SendMany operation. 2016-09-08 21:46:14 -07:00
Simon 4cff8a5c50 Fix typo in error message 2016-09-08 21:46:14 -07:00
Simon a0a3334c4d Add z_getbalance and z_gettotalbalance RPC calls to close #1201. 2016-09-08 21:46:14 -07:00
Simon cff6f0ac46 Add friend class for testing private members of AsyncRPCOperation_sendmany. 2016-09-08 21:46:14 -07:00
Simon 9bb6162626 Add extra checking of memo data in hexadecimal string format. 2016-09-08 21:46:14 -07:00
Simon a5905772c8 Add logging under the category "asyncrpc". 2016-09-08 21:46:14 -07:00
Simon 39c7f954d0 Remove redundant call. 2016-09-08 21:46:14 -07:00
Simon fc4b127ed3 Add tests for async queue and rpc commands: z_getoperationstatus, z_getoperationresult, z_listoperationids, z_sendmany 2016-09-08 21:46:14 -07:00
Simon 15c83ac6b4 Remove redundant check when getting spending key for a payment address. 2016-09-08 21:46:14 -07:00
Simon f86f625dce Update RPCServer to use AsyncRPCQueue's shared queue. 2016-09-08 21:46:14 -07:00
Simon 423a63d0a9 Add shared queue to AsynRPCQueue. 2016-09-08 21:46:14 -07:00
Simon b922924d14 Add test for AsyncRPCQueue and AsyncRPCOperation. 2016-09-08 21:46:14 -07:00
Simon 017b3ede33 Clear the operation queue when closing it. 2016-09-08 21:46:14 -07:00
Simon 87f7c98795 Refactor to use wallet note tracking from commit a72379 2016-09-08 21:46:14 -07:00
Simon 97b6f365a1 Fix bug where wallet was not persisting witnesses to disk.
Author: str4d
2016-09-08 21:46:14 -07:00
Simon 9cd713439a Added option to close a queue and wait for queued up operations to finish,
rather than just closing a queue and immediately cancelling all operations.
2016-09-08 21:46:14 -07:00
Simon c93d8bdf9c Fix bug where call to sign and send a transaction was in wrong scope. 2016-09-08 21:46:14 -07:00
Simon 3fd5a615ac Coinbase utxos can only be spent when sending to a single zaddr.
Change from the transaction will be sent to the same zaddr.
2016-09-08 21:46:14 -07:00
Simon 008fccfa48 Disable option to allow multiple async rpc workers. 2016-09-08 21:46:13 -07:00
Simon 14af21e9f7 Add chaining of JoinSplits within a transaction. 2016-09-08 21:46:13 -07:00
Simon c1eae2806c Closes #1293 by adding z_getoperationresult and making z_getoperationstatus idempotent. 2016-09-08 21:46:13 -07:00
Simon 3b54bf5813 Refactoring and small improvements to async rpc operations.
Added AsyncRPCQueue::closeAndWait() so rpcserver can block on worker threads when shutting down.
AsyncRPCOperation is no longer copyable - copy constructor and assignment operators now private.
Refactoring: renamed methods, renamed member variables
Tidy up: comments, const, size_t, braces
2016-09-08 21:46:13 -07:00
Simon 34f0001ccc Implement RPC call z_listoperationids and update z_getoperationstatus to take a list parameter. 2016-09-08 21:46:13 -07:00
Simon 861513a01f Add public method to AsycnRPCQueue to retrieve all the known operation ids. 2016-09-08 21:46:13 -07:00
Simon c72a427274 Add public method to get state as a human readable string from an AsyncRPCOperation. 2016-09-08 21:46:13 -07:00
Simon 15d345466d Successful result of z_sendmany returns txid so it doesn't need to return raw hex. 2016-09-08 21:46:13 -07:00
Simon b7d7b2ad9d z_sendmany from a taddr now routes change to a new address instead of back to the sender's taddr, 2016-09-08 21:46:13 -07:00
Simon 4876de6c6d Update find_unspent_notes() as mapNoteAddrs_t has been replaced by mapNoteData_t. 2016-09-08 21:46:13 -07:00
Simon dafb81614b Implement z_sendmany RPC call.
Simple implementation does not try to optimize coin or note selection.
Caller can send from a taddr or zaddr to multiple recipients.
Currently only one of the recipients can be a zaddr.
2016-09-08 21:46:13 -07:00
Simon 4eb1a96f9a Add public field 'memo' to JSOutput to enable creation of notes with custom memos. 2016-09-08 21:46:13 -07:00
Simon 8d08172d0d Add config option 'rpcasyncthreads' to specify number of async rpc workers. Default is 1. 2016-09-08 21:46:13 -07:00
Simon 2e6321a154 Add prefix to async operation id so it is easier to manage on cli. 2016-09-08 21:46:13 -07:00
Simon fc72c078be Add async RPC queue and operation classes.
Add z_getoperationstatus RPC command.
Add z_sendmany RPC command (dummy implementation, does not send actual
coins).
2016-09-08 21:46:13 -07:00
bitcartel 4ab24d3625 Update payment API documentation for beta 1 2016-09-07 16:53:24 -07:00