Commit Graph

7575 Commits

Author SHA1 Message Date
Jack Grigg e2283742db
Add libsnark to "make clean" 2017-10-17 19:03:41 -07:00
Homu af549fe6ed Auto merge of #2650 - str4d:2645-listunspent-benchmark, r=str4d
Add benchmark for listunspent

Closes #2645.
2017-10-12 15:24:53 -07:00
Jack Grigg 8598c20d40
Changes to get test_r1cs_ppzksnark passing 2017-10-11 21:15:49 +01:00
Jack Grigg 82e839e4ff
Add "make libsnark-tests" that runs libsnark's "make check" 2017-10-11 15:22:24 +01:00
Jack Grigg 19f6668c27
Add "make check" to libsnark that runs the Google Tests 2017-10-11 15:21:44 +01:00
Jack Grigg 638e742f3f
Update libsnark LDLIBS
-lsodium is necessary as we altered libsnark to use libsodium's RNG.
2017-10-11 15:19:33 +01:00
Jack Grigg 4699d0eb36
Add alt_bn128 to QAP and Merkle tree gadget tests 2017-10-11 15:18:01 +01:00
Jack Grigg df3083fe4e
Remove test code corresponding to removed code 2017-10-11 14:59:51 +01:00
Jack Grigg 054ae60645
Migrate libsnark test code to Google Test 2017-10-11 14:54:42 +01:00
Jason Davies b30900a54b Replace "bitcoin" with "Zcash". 2017-10-05 18:10:15 +01:00
Simon 6de850120f Replace 'bitcoin address' with 'zcash address'. 2017-10-04 17:07:07 -07:00
Jay Graber c16528495c s/zcash/Zcash 2017-10-04 17:06:51 -07:00
Bruno Arueira d2c1e4a807 Removes out bitcoin mention in favor for zcash
Bitcoin Core => Zcash
bitcoin address => Zcash address
bitcoinaddress => zcashaddress

Closes #1756
2017-10-04 17:05:30 -07:00
Jack Grigg 99dd50c30c
Add benchmark for listunspent
Closes #2645.
2017-10-04 12:48:50 +01:00
Jack Grigg 0f49863acb
make-release.py: Versioning changes for 1.0.12. 2017-09-28 01:17:05 +01:00
Simon 5023af7bd5 Closes #2637. Make z_shieldcoinbase an experimental feature where it
can be enabled with: zcashd -experimentalfeatures -zshieldcoinbase.
2017-09-27 10:43:54 -07:00
Simon b85008e786 Update which lock to synchronize on when calling GetBestAnchor(). 2017-09-26 10:16:33 -07:00
Jack Grigg 39cb7df909
make-release.py: Versioning changes for 1.0.12-rc1. 2017-09-23 10:42:23 +01:00
Homu f34c60de37 Auto merge of #2615 - bitcartel:2448_shield_coinbase, r=bitcartel
Add RPC command shield_coinbase #2448.

Shield transparent coinbase funds by sending to a shielded z address. Closes #2448.
2017-09-22 12:04:31 -07:00
Simon 06c19063bb Implement RPC shield_coinbase #2448. 2017-09-21 15:04:12 -07:00
Homu 8f16b27304 Auto merge of #2616 - nathan-at-least:importprivkey-shows-address.4, r=str4d
Importprivkey shows address

Scratching an itch: make `importprivkey` output the corresponding address.

Without this PR, `importprivkey` shows no output. Because we're moving towards an "address-based" RPC interface, rather than "account-based", there's a gap when using `importprivkey` because there's no way to assign it to a specific account, but also no easy way to determine the address. This change fixes that wart.
2017-09-21 14:29:03 -07:00
Homu 60b4a79000 Auto merge of #2620 - bitcartel:2583_watch_only_fspendable, r=str4d
Closes #2583. Exclude watch-only utxos from coin selection.
2017-09-20 04:49:48 -07:00
Simon b17e1b4080 Closes #2583. Exclude watch-only utxos from z_sendmany coin selection. 2017-09-19 19:42:48 -07:00
Homu 6e9964ff70 Auto merge of #2613 - arielgabizon:load-wallet-benchmark, r=str4d
Add load-wallet benchmark

Closes #2518.
2017-09-19 01:52:22 -07:00
Ariel Gabizon 2e8aefdce1 add load-wallet benchmark 2017-09-18 21:54:53 +02:00
Homu 61d9c6745a Auto merge of #2545 - bhjortsberg:fixes-for-gcc-7, r=str4d
Fixes for gcc 7

This fixes a few issues when using a newer compiler (in my case gcc 7.1.1) available in for example Arch Linux.
Solves for example this issue: https://github.com/zcash/zcash/issues/2304

The first thing is an error when checking for boost_system and is solved by disabling that warning (wich is treated as an error and, hence, stops the build):

```
configure:22242: checking for exit in -lboost_system-mt
configure:22267: g++ -m64 -o conftest -std=c++11 -pipe -fPIC -O1 -fwrapv -fno-strict-aliasing -Werror -g  -Wformat -Wformat-security -Wstack-protector -fstack-protector-all -fPIE ..<snip>... /x86_64-unknown-linux-gnu/share/../lib conftest.cpp -lboost_system-mt  -lanl  >&5
conftest.cpp:70:6: error: declaration of 'char exit()' conflicts with built-in declaration 'void exit(int)' [-Werror=builtin-declaration-mismatch]
 char exit ();
      ^~~~
cc1plus: all warnings being treated as errors

```

The second thing was to clean some code that is deprecated in C++11 which also lead to a warning treated as error. It could also be fixed with `-Wno-deprecated` but better to fix the issue in my opinion.
2017-09-18 11:45:24 -07:00
Homu e0bef1de56 Auto merge of #2564 - str4d:2074-currency-units, r=str4d
Rationalize currency unit to "ZEC"

Cherry-picked from the upstream PR bitcoin/bitcoin#6504

Part of #2074
2017-09-18 00:07:52 -07:00
Nathan Wilcox de422c066b [tests pass] Ensure `importprivkey` outputs the address in case key is already imported. 2017-09-18 15:30:42 +09:00
Nathan Wilcox d187317083 [tests pass] Output address on new key import. 2017-09-18 15:30:42 +09:00
Homu d1bba6f1b6 Auto merge of #2601 - str4d:2156-large-wallet-utxos, r=str4d
Benchmark time to call sendtoaddress with many UTXOs

Part of #2156.
2017-09-13 15:38:57 -07:00
Jack Grigg a76174b76b
Benchmark time to call sendtoaddress with many UTXOs 2017-08-31 02:15:06 +01:00
Jason Davies d6252a9473 Fix deprecation policy comment.
Thanks to @daira for spotting this and suggesting the correct policy.
2017-08-15 19:09:12 +01:00
Jack Grigg 2fd43c599f
make-release.py: Versioning changes for 1.0.11. 2017-08-15 09:52:36 +01:00
Jack Grigg 6dec2d0355
Rationalize currency unit to "ZEC" 2017-08-03 18:49:04 +01:00
Ross Nicoll 091b2116a0
Rationalize currency unit to "BTC"
Previously various user-facing strings have used inconsistent currency units "BTC",
"btc" and "bitcoins". This adds a single constant and uses it for each reference to
the currency unit.

Also adds a description of the unit for --maxtxfee, and adds the missing "amount"
field description to the (deprecated) move RPC command.
2017-08-03 16:32:41 +01:00
Jack Grigg 24d98cece0
Add libsnark compile flag to not copy DEPINST to PREFIX
This is useful for Zcash, where DEPINST is its depends folder, not libsnark's
internal dependency folder.
2017-08-02 15:53:51 +01:00
Sean Bowe 26a8f68ea8
Remove libsnark from depends system and integrate it into build system. 2017-08-02 15:49:30 +01:00
Jack Grigg a06446408c
Merge commit '51e448641d6cbcd582afa22cd8475f8c3086dad7' as 'src/snark' 2017-08-02 11:17:32 +01:00
Jack Grigg 51e448641d
Squashed 'src/snark/' content from commit 9ada3f8
git-subtree-dir: src/snark
git-subtree-split: 9ada3f84ab484c57b2247c2f41091fd6a0916573
2017-08-02 11:17:25 +01:00
Cory Fields c98b91b7c5 httpserver: explicitly detach worker threads
When using std::thread in place of boost::thread, letting the threads destruct
results in a std::terminate. According to the docs, the same thing should be
be happening in later boost versions:
http://www.boost.org/doc/libs/1_55_0/doc/html/thread/thread_management.html#thread.thread_management.thread.destructor

I'm unsure why this hasn't blown up already, but explicitly detaching can't
hurt.

Zcash: cherry-picked from commit d3773ca9aeb0d2f12dc0c5a0726778050c8cb455
This fixes #2554 (zcash-cli stop during getblocktemplate long poll
causes 'Assertion `!pthread_mutex_unlock(&m)' failed.')
2017-08-01 20:24:27 +01:00
Wladimir J. van der Laan c7f77e28f0 http: speed up shutdown
This continues/fixes #6719.

`event_base_loopbreak` was not doing what I expected it to, at least in
libevent 2.0.21.
What I expected was that it sets a timeout, given that no other pending
events it would exit in N seconds. However, what it does was delay the
event loop exit with 10 seconds, even if nothing is pending.

Solve it in a different way: give the event loop thread time to exit
out of itself, and if it doesn't, send loopbreak.

This speeds up the RPC tests a lot, each exit incurred a 10 second
overhead, with this change there should be no shutdown overhead in the
common case and up to two seconds if the event loop is blocking.

As a bonus this breaks dependency on boost::thread_group, as the HTTP
server minds its own offspring.

Zcash: cherry-picked from commit a264c32e3321ae909ca59cb8ce8bf5d812dbc4e1
2017-08-01 20:24:27 +01:00
Wladimir J. van der Laan 2abe8ef721 http: Force-exit event loop after predefined time
This makes sure that the event loop eventually terminates, even if an
event (like an open timeout, or a hanging connection) happens to be
holding it up.

Zcash: cherry-picked from commit ec908d5f7aa9ad7e3487018e06a24cb6449cc58b
2017-08-01 20:24:27 +01:00
Wladimir J. van der Laan dbf7057f7a http: Wait for worker threads to exit
Add a WaitExit() call to http's WorkQueue to make it delete the work
queue only when all worker threads stopped.

This fixes a problem that was reproducable by pressing Ctrl-C during
AppInit2:
```
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:81: boost::condition_variable::~condition_variable(): Assertion `!ret' failed.
/usr/include/boost/thread/pthread/mutex.hpp:108: boost::mutex::~mutex(): Assertion `!posix::pthread_mutex_destroy(&m)' failed.
```

I was assuming that `threadGroup->join_all();` would always have been
called when entering the Shutdown(). However this is not the case in
bitcoind's AppInit2-non-zero-exit case "was left out intentionally
here".

Zcash: cherry-picked from commit de9de2de361ab1355b976f17371d73e36fe3bf56
Fixes #2334 and #2214.
2017-08-01 20:24:27 +01:00
Wladimir J. van der Laan c0fe29370a Make HTTP server shutdown more graceful
Shutting down the HTTP server currently breaks off all current requests.
This can create a race condition with RPC `stop` command, where the calling
process never receives confirmation.

This change removes the listening sockets on shutdown so that no new
requests can come in, but no longer breaks off requests in progress.

Meant to fix bitcoin/#6717.

Zcash: cherry-picked from commit 5e0c22135600fe36811da3b78216efc61ba765fb
2017-08-01 20:24:27 +01:00
Ariel Gabizon fcf824e9f1 make-release.py: Versioning changes for 1.0.11-rc1. 2017-08-01 17:11:57 +02:00
Homu 10acd8a1fb Auto merge of #2484 - str4d:block-download-completion, r=daira
Add block download progress to metrics UI
2017-07-28 21:57:19 -07:00
Jack Grigg 92bfde0edf
Improve network height estimation 2017-07-28 10:50:07 +00:00
Jack Grigg 4a651837be
Correct and extend EstimateNetHeightInner tests
Corrections are to the median block times, which were generated by subtracting
CBlockIndex::nMedianTimeSpan / 2 from the block height and then multiplying by
the target spacing. GetMedianTimePast() takes an array sorted by std::sort() and
returns element CBlockIndex::nMedianTimeSpan / 2, meaning that if
CBlockIndex::nMedianTimeSpan is odd (which it is), there is an out-by-one error
in the subtraction.
2017-07-28 10:45:44 +00:00
Homu d6e6f51724 Auto merge of #2526 - bitcartel:2480_segfault_zeroconf_from_zaddr, r=daira
Fixes #2480 where missing map entry would cause a segfault.

`wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight;` results in undefined behaviour when the block hash is not present in the map, returning a null value which is dereferenced via `->nHeight`.  This error is triggered by a zero-conf wallet transaction which has not been mined yet.  As discussed in #2480, on some systems there is a segfault whilst on others there is a silent exit.  This makes it difficult to write a test, but the fix has been tested empirically to confirm an exception is thrown.  This PR fixes the segfault and complements #2525 which prevents a user from sending from a zaddr with minconf 0.
2017-07-27 22:42:59 -07:00
Jack Grigg 047aec1e0e
Add block download progress to metrics UI 2017-07-26 00:51:12 +00:00
Homu e88ab1a920 Auto merge of #2529 - str4d:2444-rpc-www-authenticate, r=daira
[rpc] Add WWW-Authenticate header to 401 response

Fix cherry-picked from upstream PR bitcoin/bitcoin#7472.

Closes #2444.
2017-07-25 15:36:33 -07:00
Homu a698116b28 Auto merge of #2478 - bitcartel:2477_send_alert_1.0.10, r=daira
Alert for 2017-06-23.a degraded networking (fixed in 1.0.10-1)

Alert 1004 (version 1.0.10 only) Issue #2477
2017-07-25 13:03:53 -07:00
Homu 95d18784ec Auto merge of #2525 - bitcartel:2519_no_zero_minconf_from_zaddr_zsendmany, r=daira
When sending from a zaddr, minconf cannot be zero.

Closes #2519.
2017-07-20 08:24:54 -07:00
Bjorn Hjortsberg ecd04e914f Remove deprecated exception specification
Warns on a newer compiler that these are deprecated in C++11
2017-07-20 13:58:39 +02:00
Homu d2627bc65d Auto merge of #2504 - daira:2501.remove-upnp, r=daira
Remove UPnP support. fixes #2500

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-07-16 03:43:54 -07:00
Simon 9b5da42745 Fixes #2480. Null entry in map was dereferenced leading to a segfault. 2017-07-14 00:10:54 -07:00
Wladimir J. van der Laan 20fb708e6f
rpc: Add WWW-Authenticate header to 401 response
A WWW-Authenticate header must be present in the 401
response to make clients know that they can authenticate,
and how.

    WWW-Authenticate: Basic realm="jsonrpc"

Fixes #7462.
2017-07-12 16:37:48 -05:00
Jack Grigg 689264bbff
Add test for issue #2444
A WWW-Authenticate header must be present in the 401 response to make clients
know that they can authenticate, and how.
2017-07-12 16:34:58 -05:00
Simon b639bb1eef Fixes #2519. When sending from a zaddr, minconf cannot be zero. 2017-07-11 11:29:43 -07:00
Simon d77a0ac4a0 Closes #2446 by adding generated field to listunspent.
If generated is true, the unspent transaction output is from a
coinbase transaction and can only be sent to a shielded address.
2017-07-11 10:44:36 -07:00
Homu 90a255a747 Auto merge of #2464 - str4d:torcontrol-rbf-resource-leak, r=daira
Net: Fix resource leak in ReadBinaryFile(...)

Introduced in 3290567bbd via PR #2177.

Cherry-picked from Bitcoin PR https://github.com/bitcoin/bitcoin/pull/10408
2017-07-10 10:43:22 -07:00
Daira Hopwood 506a21850a Remove UPnP support. fixes #2500
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-07-03 08:57:05 +01:00
Daira Hopwood 262fc5f4e3 Alert 1004 (version 1.0.10 only)
Author: Simon <simon@bitcartel.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-06-24 19:49:41 +01:00
Simon d444e1cf40 make-release.py: Versioning changes for 1.0.10-1. 2017-06-23 19:43:29 -07:00
Sean Bowe 15a9937654 Revert "Delete old protocol version constants and simplify code that used them."
This reverts commit 5a49c929dd.
2017-06-23 18:19:25 -06:00
Sean Bowe 9ad9a25eff Revert "Remove an unneeded version workaround as per @str4d's review comment."
This reverts commit 1e9db0b38a.
2017-06-23 18:19:17 -06:00
practicalswift 1240717431
Net: Fix resource leak in ReadBinaryFile(...)
Introduced in 3290567bbd via PR #2177.
2017-06-23 18:49:43 +12:00
Jack Grigg dc2ead6021
make-release.py: Versioning changes for 1.0.10. 2017-06-22 14:47:15 +12:00
Homu 59de56eeca Auto merge of #2342 - bitcartel:1081__mempoolpatch, r=str4d
Add ability for node to reject tx from mempool by number of tx inputs

Implement short-term solution described in #2343 so that users can respond promptly to critical short-term problems caused by quadratic validation scaling, such as the getblocktemplate latency, block propagation latency, and mempool size inflation issues described in #2333.
2017-06-21 14:42:13 -07:00
Homu 02e5fffadc Auto merge of #2360 - daira:2359.remove-lax-der-validation, r=arcalinea
Remove unneeded lax ECDSA signature verification

Fixes #2359. Removes code for lax ECDSA verification, and the SCRIPT_VERIFY_DERSIG flag that controlled it. The behaviour is as-if the flag is always set.
2017-06-20 19:05:58 -07:00
Simon d8616d012a Partial revert & fix for commit 9e84b5a ; code block in wrong location. 2017-06-19 21:11:34 -07:00
Jack Grigg 4ef014151d
Additional testing of -mempooltxinputlimit 2017-06-20 15:58:46 +12:00
Kevin Pan 26d27a15ce "getblocktemplate" could work without wallet 2017-06-20 10:41:46 +08:00
Daira Hopwood c2a722d3c4 Fix a comment that was made stale before launch by #1016 (commit 542da61).
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-06-19 16:33:18 +01:00
Daira Hopwood 00fde35b1c Make transaction test failures print the comments preceding the test JSON.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-06-19 16:33:18 +01:00
Daira Hopwood 4a785b0a5b Repair tests for strict DER signatures.
While we're at it, repair a similar test for CLTV, and make the repaired RPC tests run by default.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-06-19 16:32:15 +01:00
Simon 9e84b5aa0d Check mempooltxinputlimit when creating a transaction to avoid local
mempool rejection.
2017-06-17 14:41:25 -07:00
Daira Hopwood de609b8c54 Strict DER signatures are always enforced; remove the flag and code that used it.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-06-17 17:19:08 +01:00
Daira Hopwood 3c985d26ce Remove unneeded lax ECDSA signature verification.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-06-17 17:19:08 +01:00
Homu ef24e8e6be Auto merge of #2335 - str4d:2333-validation-speed, r=str4d
Switch to libsecp256k1-based validation for ECDSA

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6983
- bitcoin/bitcoin#6954

Part of #2333.
2017-06-17 07:18:25 -07:00
Jack Grigg b661736b87
Hold an ECCVerifyHandle in zcash-gtest 2017-06-18 02:15:05 +12:00
Jack Grigg 5799c5f8c0
Add test for -mempooltxinputlimit 2017-06-17 14:59:16 +12:00
Simon da6d93916d Add option 'mempooltxinputlimit' so the mempool can reject a transaction
based on the number of transparent inputs.
2017-06-16 19:31:33 -07:00
Jack Grigg fd0d1c7d60
Ensure that ECDSA constant sizes are correctly-sized 2017-06-17 12:10:15 +12:00
Jack Grigg 1f5941062a
Remove redundant `= 0` initialisations 2017-06-17 12:10:14 +12:00
Jack Grigg 877964c82f
Specify ECDSA constant sizes as constants 2017-06-17 12:10:14 +12:00
Jack Grigg c032f1b687
Add comments 2017-06-17 12:09:44 +12:00
Homu dfa4ed19bb Auto merge of #2440 - bitcartel:1360_reduce_info_leakage_vpub_new, r=str4d
Fix intermediate vpub_new leakage in multi joinsplit tx

Resolves information leakage discussed here https://github.com/zcash/zcash/issues/1360#issuecomment-284561331

Example output in debug.log showing how intermediate vpub_new is now 0
https://gist.github.com/bitcartel/86ca316b74f0b1ec6d8de3ac132006da

When reviewing, note that the indentation of a large chunk of code (scenario 3 part 2) changed, so use `git diff -w` (or similar) or append `?w=1` to the Github URL e.g. https://github.com/zcash/zcash/pull/2440/files?w=1
2017-06-15 21:33:01 -07:00
Homu 3440de74ee Auto merge of #2386 - str4d:2385-consensus-correction, r=str4d
Correct consensus logic in ContextualCheckInputs

Closes #2385.
2017-06-15 18:50:03 -07:00
Jack Grigg 30006a2e79
Correct consensus logic in ContextualCheckInputs
Closes #2385.
2017-06-16 13:45:19 +12:00
Jack Grigg 1b786a93c3
Add test for incorrect consensus logic 2017-06-16 13:45:14 +12:00
Homu 0a80a1cea3 Auto merge of #2227 - str4d:2074-ignore-virtual-cores, r=str4d
Use real number of cores, ignore virtual cores

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6361
- bitcoin/bitcoin#6370

Part of #2074.
2017-06-15 17:05:02 -07:00
Homu 6189c70caa Auto merge of #1747 - str4d:fix-spendingkey-locking, r=str4d
Fix incorrect locking in CCryptoKeyStore
2017-06-15 16:02:07 -07:00
Simon c93a0872e8 Fix intermediate vpub_new leakage in multi joinsplit tx (#1360) 2017-06-13 23:21:53 -07:00
Homu a23fdf862d Auto merge of #2245 - daira:2244.remove-old-peer-workarounds, r=str4d
Delete old protocol version constants and simplify code that used them.

fixes #2244

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-06-13 23:10:19 -07:00
Jack Grigg 50fa079748
Fix potential overflows in ECDSA DER parsers 2017-06-06 20:08:03 +12:00
Pieter Wuille 3d02d0f63a
Switch to libsecp256k1-based validation for ECDSA 2017-06-06 17:52:25 +12:00
Pieter Wuille c1afe40a17
Update key.cpp to new secp256k1 API 2017-06-06 17:50:22 +12:00
Jack Grigg c7d50a19cd
Merge commit '77404203ee87992f34ff57c2e8a6f0c85717318f' into 2333-validation-speed 2017-06-06 17:49:32 +12:00
Jack Grigg 77404203ee
Squashed 'src/secp256k1/' changes from 22f60a6..84973d3
84973d3 Merge #454: Remove residual parts from the schnorr expirement.
5e95bf2 Remove residual parts from the schnorr expirement.
cbc20b8 Merge #452: Minor optimizations to _scalar_inverse to save 4M
4cc8f52 Merge #437: Unroll secp256k1_fe_(get|set)_b32 to make them much faster.
465159c Further shorten the addition chain for scalar inversion.
a2b6b19 Fix benchmark print_number infinite loop.
8b7680a Unroll secp256k1_fe_(get|set)_b32 for 10x26.
aa84990 Unroll secp256k1_fe_(get|set)_b32 for 5x52.
cf12fa1 Minor optimizations to _scalar_inverse to save 4M
1199492 Merge #408: Add `secp256k1_ec_pubkey_negate` and `secp256k1_ec_privkey_negate`
6af0871 Merge #441: secp256k1_context_randomize: document.
ab31a52 Merge #444: test: Use checked_alloc
eda5c1a Merge #449: Remove executable bit from secp256k1.c
51b77ae Remove executable bit from secp256k1.c
5eb030c test: Use checked_alloc
72d952c FIXUP: Missing "is"
70ff29b secp256k1_context_randomize: document.
9d560f9 Merge #428: Exhaustive recovery
8e48aa6 Add `secp256k1_ec_pubkey_negate` and `secp256k1_ec_privkey_negate`
2cee5fd exhaustive tests: add recovery module
8225239 Merge #433: Make the libcrypto detection fail the newer API.
12de863 Make the libcrypto detection fail the newer API.
678b0e5 exhaustive tests: remove erroneous comment from ecdsa_sig_sign
2928420 Merge #427: Remove Schnorr from travis as well
03ff8c2 group_impl.h: remove unused `secp256k1_ge_set_infinity` function
a724d72 configure: add --enable-coverage to set options for coverage analysis
b595163 recovery: add tests to cover API misusage
8eecc4a Remove Schnorr from travis as well
6f8ae2f ecdh: test NULL-checking of arguments
25e3cfb ecdsa_impl: replace scalar if-checks with VERIFY_CHECKs in ecdsa_sig_sign
a8abae7 Merge #310: Add exhaustive test for group functions on a low-order subgroup
b4ceedf Add exhaustive test for verification
83836a9 Add exhaustive tests for group arithmetic, signing, and ecmult on a small group
20b8877 Add exhaustive test for group functions on a low-order subgroup
80773a6 Merge #425: Remove Schnorr experiment
e06e878 Remove Schnorr experiment
04c8ef3 Merge #407: Modify parameter order of internal functions to match API parameter order
6e06696 Merge #411: Remove guarantees about memcmp-ability
40c8d7e Merge #421: Update scalar_4x64_impl.h
a922365 Merge #422: Restructure nonce clearing
3769783 Restructure nonce clearing
0f9e69d Restructure nonce clearing
9d67afa Update scalar_4x64_impl.h
7d15cd7 Merge #413: fix auto-enabled static precompuatation
00c5d2e fix auto-enabled static precompuatation
91219a1 Remove guarantees about memcmp-ability
7a49cac Merge #410: Add string.h include to ecmult_impl
0bbd5d4 Add string.h include to ecmult_impl
353c1bf Fix secp256k1_ge_set_table_gej_var parameter order
541b783 Fix secp256k1_ge_set_all_gej_var parameter order
7d893f4 Fix secp256k1_fe_inv_all_var parameter order
c5b32e1 Merge #405: Make secp256k1_fe_sqrt constant time
926836a Make secp256k1_fe_sqrt constant time
e2a8e92 Merge #404: Replace 3M + 4S doubling formula with 2M + 5S one
8ec49d8 Add note about 2M + 5S doubling formula
5a91bd7 Merge #400: A couple minor cleanups
ac01378 build: add -DSECP256K1_BUILD to benchmark_internal build flags
a6c6f99 Remove a bunch of unused stdlib #includes
65285a6 Merge #403: configure: add flag to disable OpenSSL tests
a9b2a5d configure: add flag to disable OpenSSL tests
b340123 Merge #402: Add support for testing quadratic residues
e6e9805 Add function for testing quadratic residue field/group elements.
efd953a Add Jacobi symbol test via GMP
fa36a0d Merge #401: ecmult_const: unify endomorphism and non-endomorphism skew cases
c6191fd ecmult_const: unify endomorphism and non-endomorphism skew cases
0b3e618 Merge #378: .gitignore build-aux cleanup
6042217 Merge #384: JNI: align shared files copyright/comments to bitcoinj's
24ad20f Merge #399: build: verify that the native compiler works for static precomp
b3be852 Merge #398: Test whether ECDH and Schnorr are enabled for JNI
aa0b1fd build: verify that the native compiler works for static precomp
eee808d Test whether ECDH and Schnorr are enabled for JNI
7b0fb18 Merge #366: ARM assembly implementation of field_10x26 inner (rebase of #173)
001f176 ARM assembly implementation of field_10x26 inner
0172be9 Merge #397: Small fixes for sha256
3f8b78e Fix undefs in hash_impl.h
2ab4695 Fix state size in sha256 struct
6875b01 Merge #386: Add some missing `VERIFY_CHECK(ctx != NULL)`
2c52b5d Merge #389: Cast pointers through uintptr_t under JNI
43097a4 Merge #390: Update bitcoin-core GitHub links
31c9c12 Merge #391: JNI: Only call ecdsa_verify if its inputs parsed correctly
1cb2302 Merge #392: Add testcase which hits additional branch in secp256k1_scalar_sqr
d2ee340 Merge #388: bench_ecdh: fix call to secp256k1_context_create
093a497 Add testcase which hits additional branch in secp256k1_scalar_sqr
a40c701 JNI: Only call ecdsa_verify if its inputs parsed correctly
faa2a11 Update bitcoin-core GitHub links
47b9e78 Cast pointers through uintptr_t under JNI
f36f9c6 bench_ecdh: fix call to secp256k1_context_create
bcc4881 Add some missing `VERIFY_CHECK(ctx != NULL)` for functions that use `ARG_CHECK`
6ceea2c align shared files copyright/comments to bitcoinj's
70141a8 Update .gitignore
7b549b1 Merge #373: build: fix x86_64 asm detection for some compilers
bc7c93c Merge #374: Add note about y=0 being possible on one of the sextic twists
e457018 Merge #364: JNI rebased
86e2d07 JNI library: cleanup, removed unimplemented code
3093576a JNI library
bd2895f Merge pull request #371
e72e93a Add note about y=0 being possible on one of the sextic twists
3f8fdfb build: fix x86_64 asm detection for some compilers
e5a9047 [Trivial] Remove double semicolons
c18b869 Merge pull request #360
3026daa Merge pull request #302
03d4611 Add sage verification script for the group laws
a965937 Merge pull request #361
83221ec Add experimental features to configure
5d4c5a3 Prevent damage_array in the signature test from going out of bounds.
419bf7f Merge pull request #356
6c527ec Merge pull request #357
445f7f1 Fix for Windows compile issue
03d84a4 Benchmark against OpenSSL verification
2bfb82b Merge pull request #351
06aeea5 Turn secp256k1_ec_pubkey_serialize outlen to in/out
970164d Merge pull request #348
6466625 Improvements for coordinate decompression
e2100ad Merge pull request #347
8e48787 Change secp256k1_ec_pubkey_combine's count argument to size_t.
c69dea0 Clear output in more cases for pubkey_combine, adds tests.
269d422 Comment copyediting.
b4d17da Merge pull request #344
4709265 Merge pull request #345
26abce7 Adds 32 static test vectors for scalar mul, sqr, inv.
5b71a3f Better error case handling for pubkey_create & pubkey_serialize, more tests.
3b7bc69 Merge pull request #343
eed87af Change contrib/laxder from headers-only to files compilable as standalone C
d7eb1ae Merge pull request #342
7914a6e Make lax_der_privatekey_parsing.h not depend on internal code
73f64ff Merge pull request #339
9234391 Overhaul flags handling
1a36898 Make flags more explicit, add runtime checks.
1a3e03a Merge pull request #340
96be204 Add additional tests for eckey and arg-checks.
bb5aa4d Make the tweak function zeroize-output-on-fail behavior consistent.
4a243da Move secp256k1_ec_privkey_import/export to contrib.
1b3efc1 Move secp256k1_ecdsa_sig_recover into the recovery module.
e3cd679 Eliminate all side-effects from VERIFY_CHECK() usage.
b30fc85 Avoid nonce_function_rfc6979 algo16 argument emulation.
70d4640 Make secp256k1_ec_pubkey_create skip processing invalid secret keys.
6c476a8 Minor comment improvements.
131afe5 Merge pull request #334
0c6ab2f Introduce explicit lower-S normalization
fea19e7 Add contrib/lax_der_parsing.h
3bb9c44 Rewrite ECDSA signature parsing code
fa57f1b Use secp256k1_rand_int and secp256k1_rand_bits more
49b3749 Add new tests for the extra testrand functions
f684d7d Faster secp256k1_rand_int implementation
251b1a6 Improve testrand: add extra random functions
31994c8 Merge pull request #338
f79aa88 Bugfix: swap arguments to noncefp
c98df26 Merge pull request #319
67f7da4 Extensive interface and operations tests for secp256k1_ec_pubkey_parse.
ee2cb40 Add ARG_CHECKs to secp256k1_ec_pubkey_parse/secp256k1_ec_pubkey_serialize
7450ef1 Merge pull request #328
68a3c76 Merge pull request #329
98135ee Merge pull request #332
37100d7 improve ECDH header-doc
b13d749 Fix couple of typos in API comments
7c823e3 travis: fixup module configs
cc3141a Merge pull request #325
ee58fae Merge pull request #326
213aa67 Do not force benchmarks to be statically linked.
338fc8b Add API exports to secp256k1_nonce_function_default and secp256k1_nonce_function_rfc6979.
52fd03f Merge pull request #320
9f6993f Remove some dead code.
357f8cd Merge pull request #314
118cd82 Use explicit symbol visibility.
4e64608 Include public module headers when compiling modules.
1f41437 Merge pull request #316
fe0d463 Merge pull request #317
cfe0ed9 Fix miscellaneous style nits that irritate overactive static analysis.
2b199de Use the explicit NULL macro for pointer comparisons.
9e90516 Merge pull request #294
dd891e0 Get rid of _t as it is POSIX reserved
201819b Merge pull request #313
912f203 Eliminate a few unbraced statements that crept into the code.
eeab823 Merge pull request #299
486b9bb Use a flags bitfield for compressed option to secp256k1_ec_pubkey_serialize and secp256k1_ec_privkey_export
05732c5 Callback data: Accept pointers to either const or non-const data
1973c73 Bugfix: Reinitialise buffer lengths that have been used as outputs
788038d Use size_t for lengths (at least in external API)
c9d7c2a secp256k1_context_set_{error,illegal}_callback: Restore default handler by passing NULL as function argument
9aac008 secp256k1_context_destroy: Allow NULL argument as a no-op
64b730b secp256k1_context_create: Use unsigned type for flags bitfield
cb04ab5 Merge pull request #309
a551669 Merge pull request #295
81e45ff Update group_impl.h
85e3a2c Merge pull request #112
b2eb63b Merge pull request #293
dc0ce9f [API BREAK] Change argument order to out/outin/in
6d947ca Merge pull request #298
c822693 Merge pull request #301
6d04350 Merge pull request #303
7ab311c Merge pull request #304
5fb3229 Fixes a bug where bench_sign would fail due to passing in too small a buffer.
263dcbc remove unused assignment
b183b41 bugfix: "ARG_CHECK(ctx != NULL)" makes no sense
6da1446 build: fix parallel build
5eb4356 Merge pull request #291
c996d53 Print success
9f443be Move pubkey recovery code to separate module
d49abbd Separate ECDSA recovery tests
439d34a Separate recoverable and normal signatures
a7b046e Merge pull request #289
f66907f Improve/reformat API documentation secp256k1.h
2f77487 Add context building benchmarks
cc623d5 Merge pull request #287
de7e398 small typo fix
9d96e36 Merge pull request #280
432e1ce Merge pull request #283
14727fd Use correct name in gitignore
356b0e9 Actually test static precomputation in Travis
ff3a5df Merge pull request #284
2587208 Merge pull request #212
a5a66c7 Add support for custom EC-Schnorr-SHA256 signatures
d84a378 Merge pull request #252
72ae443 Improve perf. of cmov-based table lookup
92e53fc Implement endomorphism optimization for secp256k1_ecmult_const
ed35d43 Make `secp256k1_scalar_add_bit` conditional; make `secp256k1_scalar_split_lambda_var` constant time
91c0ce9 Add benchmarks for ECDH and const-time multiplication
0739bbb Add ECDH module which works by hashing the output of ecmult_const
4401500 Add constant-time multiply `secp256k1_ecmult_const` for ECDH
e4ce393 build: fix hard-coded usage of "gen_context"
b8e39ac build: don't use BUILT_SOURCES for the static context header
baa75da tests: add a couple tests
ae4f0c6 Merge pull request #278
995c548 Introduce callback functions for dealing with errors.
c333074 Merge pull request #282
18c329c Remove the internal secp256k1_ecdsa_sig_t type
74a2acd Add a secp256k1_ecdsa_signature_t type
23cfa91 Introduce secp256k1_pubkey_t type
4c63780 Merge pull request #269
3e6f1e2 Change rfc6979 implementation to be a generic PRNG
ed5334a Update configure.ac to make it build on OpenBSD
1b68366 Merge pull request #274
a83bb48 Make ecmult static precomputation default
166b32f Merge pull request #276
c37812f Add gen_context src/ecmult_static_context.h to CLEANFILES to fix distclean.
125c15d Merge pull request #275
76f6769 Fix build with static ecmult altroot and make dist.
5133f78 Merge pull request #254
b0a60e6 Merge pull request #258
733c1e6 Add travis build to test the static context.
fbecc38 Add ability to use a statically generated ecmult context.
4fb174d Merge pull request #263
4ab8990 Merge pull request #270
bdf0e0c Merge pull request #271
31d0c1f Merge pull request #273
eb2c8ff Add missing casts to SECP256K1_FE_CONST_INNER
55399c2 Further performance improvements to _ecmult_wnaf
99fd963 Add secp256k1_ec_pubkey_compress(), with test similar to the related decompress() function.
145cc6e Improve performance of _ecmult_wnaf
36b305a Verify the result of GMP modular inverse using non-GMP code
0cbc860 Merge pull request #266
06ff7fe Merge pull request #267
5a43124 Save 1 _fe_negate since s1 == -s2
a5d796e Update code comments
3f3964e Add specific VERIFY tests for _fe_cmov
7d054cd Refactor to save a _fe_negate
b28d02a Refactor to remove a local var
55e7fc3 Perf. improvement in _gej_add_ge
a0601cd Fix VERIFY calculations in _fe_cmov methods
17f7148 Merge pull request #261
7657420 Add tests for adding P+Q with P.x!=Q.x and P.y=-Q.y
8c5d5f7 tests: Add failing unit test for #257 (bad addition formula)
5de4c5d gej_add_ge: fix degenerate case when computing P + (-lambda)P
bcf2fcf gej_add_ge: rearrange algebra
e2a07c7 Fix compilation with C++
873a453 Merge pull request #250
91eb0da Merge pull request #247
210ffed Use separate in and out pointers in `secp256k1_ec_pubkey_decompress`
a1d5ae1 Tiny optimization
729badf Merge pull request #210
2d5a186 Apply effective-affine trick to precomp
4f9791a Effective affine addition in EC multiplication
2b4cf41 Use pkg-config always when possible, with failover to manual checks for libcrypto

git-subtree-dir: src/secp256k1
git-subtree-split: 84973d393ac240a90b2e1a6538c5368202bc2224
2017-06-06 17:49:31 +12:00
Jack Grigg 3326155481
Revert "Fix secp256k1 test compilation"
This reverts commit 87da7b4ea0 to make updating
the subtree easier.
2017-06-06 17:45:50 +12:00
Nathan Wilcox de9c56c88a make-release.py: Versioning changes for 1.0.9. 2017-05-24 12:50:05 -07:00
Sean Bowe 9eb9eebbb8 Check that pairings work properly when the G1 point is at infinity. 2017-05-23 16:31:41 -06:00
Homu 8214ebc61c Auto merge of #2372 - str4d:2355-connectblock-bench, r=nathan-at-least
Benchmark for calling ConnectBlock on a block with many inputs

Requires placing `block-107134.tar.gz` (containing the block, and a fake CoinsDB containing its inputs) into the base directory of the repository.

To facilitate generation of the fake CoinsDB, an additional field `valuesZat` has been added to `getrawtransaction` containing the integer number of zatoshis instead of a decimal number of ZEC.

Closes #2355.
2017-05-18 20:13:26 -07:00
Jack Grigg c66c731adf
Add a benchmark for calling ConnectBlock on a block with many inputs
Requires placing block-107134.tar.gz (containing the block, and a fake CoinsDB
containing its inputs) into the base directory of the repository. This can be
generated using qa/zcash/create_benchmark_archive.py (see the script for usage
details).

To facilitate generation of the fake CoinsDB, an additional field 'valueZat' has
been added to 'getrawtransaction' containing the integer number of zatoshis
instead of a decimal number of ZEC.

Closes #2355.
2017-05-18 11:03:46 +12:00
Jack Grigg 2857f6960d
Regenerate miner tests
Closes #2271.
2017-05-16 22:38:07 +12:00
Homu 38684e4c42 Auto merge of #2293 - daira:alerts-for-2017-04-11.a, r=nathan-at-least
Alerts for 2017-04-11.a security issue (fixed in 1.0.8-1)

Alert 1002 (versions 1.0.0-1.0.2 inclusive).
Alert 1003 (versions 1.0.3-1.0.8 inclusive).

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-05-15 16:08:29 -07:00
Homu e209ba4951 Auto merge of #2338 - amgadabdelhafez:patch-1, r=nathan-at-least
Update timedata.cpp to fix error message string from bitcoin core to zcash

Changing error message string from bitcoin core to zcash. fixes issue #2336
2017-05-15 09:42:19 -07:00
Homu 3a98e3b4c2 Auto merge of #2297 - str4d:2274-apoptosis, r=nathan-at-least
Implement automatic shutdown of deprecated Zcash versions

Closes #2274.
2017-05-14 18:39:14 -07:00
Homu 01bc99205a Auto merge of #2251 - str4d:2210-tor-quotedstring-escapes, r=nathan-at-least
Handle escapes in Tor QuotedStrings

Also adds a missing copyright header.

Closes #2210.
2017-05-13 15:24:58 -07:00
Jack Grigg b4f861d191 Wrap messages nicely on metrics screen 2017-05-12 14:41:50 +12:00
Jack Grigg 5b3bc9716e Implement automatic shutdown of deprecated Zcash versions
Closes #2274.
2017-05-12 14:41:46 +12:00
Daira Hopwood 1e9db0b38a Remove an unneeded version workaround as per @str4d's review comment.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-05-11 07:27:43 +01:00
Amgad Abdelhafez 8dafb9c6ce Update timedata.cpp
Capitalizing the 'z' in "Zcash" string
2017-05-05 11:24:48 -04:00
Amgad Abdelhafez bed9dd2cd2 Update timedata.cpp
Changing error message string from botcoin core to zcash
2017-05-02 19:33:52 -04:00
Daira Hopwood 8d8318c947 Alert 1003 (versions 1.0.3-1.0.8 inclusive).
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-04-24 19:55:20 +01:00
Daira Hopwood fa151bc517 Alert 1002 (versions 1.0.0-1.0.2 inclusive).
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-04-24 19:42:12 +01:00
Jack Grigg 409606118b
Check that >3-digit octals are truncated. 2017-04-21 13:23:29 +12:00
Jack Grigg 8df5fd1116
Correctly handle three-digit octals with leading digit 4-7 2017-04-21 13:22:51 +12:00
Jack Grigg d15cab21bc
Address Daira's further comments 2017-04-21 13:15:39 +12:00
zkbot 20d61ac0ea Auto merge of #2270 - bitcartel:2269_change_regtest_port, r=daira
Change regtest port to 18344.  Closes #2269.
2017-04-19 11:07:49 +00:00
Jack Grigg 0b431fbdb5
Address Daira's comments 2017-04-19 15:23:28 +12:00
Jack Grigg 519713d32e
torcontrol: Add missing copyright header 2017-04-18 12:54:22 +12:00
Jack Grigg b93cedafe4
torcontrol: Handle escapes in Tor QuotedStrings
https://trac.torproject.org/projects/tor/ticket/14999 is tracking an encoding
bug with the Tor control protocol, where many of the QuotedString instances that
Tor outputs are in fact CStrings, but it is not documented which ones are which.

https://spec.torproject.org/control-spec section 2.1.1 provides a future-proofed
rule for handing QuotedStrings, which this commit implements.
2017-04-18 12:54:16 +12:00
zkbot 8e96dc44dd Auto merge of #2205 - arcalinea:1804_zcash_addresses_in_help, r=daira
Change help text examples to use Zcash addresses

Closes #1804 and #2109

Ensures command line help text addresses are Zcash addresses.

Didn't change the text strings that say bitcoin or btc, leaving that for #2150 to close

Did I get all the addresses?
2017-04-17 15:49:37 +00:00
Simon 05844ba53b Change regtest port to 18344. Closes #2269. 2017-04-16 14:48:04 -07:00
zkbot f7f764e0b2 Auto merge of #2189 - bitcartel:1.0.7_with_apache_qpid, r=bitcartel
Add AMQP 1.0 support via Apache Qpid Proton C++ API 0.17.0

Closes #2188
2017-04-16 15:09:19 +00:00
Nathan Wilcox 451047d14a Bump version numbers for v1.0.8-1. 2017-04-13 17:10:32 -07:00
Daira Hopwood 60b7410cce Add check for JoinSplit priority as calculated by CCoinsViewCache::GetPriority.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-04-13 22:40:37 +01:00
Daira Hopwood ec19e8e283 Simplify JoinSplit priority calculation. refs 1896
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-04-13 22:40:20 +01:00
str4d c83c5932e4 Add unit test for security issue 2017-04-11.a 2017-04-13 17:59:36 +01:00
str4d e40180aa0f Update tests to check actual infinity as well as INF_FEERATE 2017-04-13 17:59:36 +01:00
Daira Hopwood 0090c64534 Don't rely on a finite upper bound on fee rate or priority.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-04-13 17:59:36 +01:00
Daira Hopwood 5a49c929dd Delete old protocol version constants and simplify code that used them.
fixes #2244

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-04-09 13:19:48 +01:00
Jack Grigg 0d0265fd11
Use AtomicTimer for metrics screen thread count 2017-03-29 18:25:09 +13:00
Wladimir J. van der Laan 2854c4e366
Remove ChainParams::DefaultMinerThreads
No longer relevant after #5957. This hack existed because of another
hack where the numthreads parameter, on regtest, doubled as how many
blocks to generate.
2017-03-29 16:06:02 +13:00
Wladimir J. van der Laan da1357e6cc
Use real number of cores for default -par, ignore virtual cores
To determine the default for `-par`, the number of script verification
threads, use [boost:🧵:physical_concurrency()](http://www.boost.org/doc/libs/1_58_0/doc/html/thread/thread_management.html#thread.thread_management.thread.physical_concurrency)
which counts only physical cores, not virtual cores.

Virtual cores are roughly a set of cached registers to avoid context
switches while threading, they cannot actually perform work, so spawning
a verification thread for them could even reduce efficiency and will put
undue load on the system.

Should fix issue #6358, as well as some other reported system overload
issues, especially on Intel processors.

The function was only introduced in boost 1.56, so provide a utility
function `GetNumCores` to fall back for older Boost versions.
2017-03-29 16:06:00 +13:00
Daira Hopwood 83aac13083 Update version numbers.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-03-27 21:01:18 +01:00
zkbot 45faa928ec Auto merge of #2177 - str4d:2061-tor-ephemeral-hs, r=daira
Tor ephemeral hidden services

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6503 (included to reduce merge conflicts)
- bitcoin/bitcoin#6639
- bitcoin/bitcoin#6643
- bitcoin/bitcoin#7090
- bitcoin/bitcoin#7035
- bitcoin/bitcoin#7170
- bitcoin/bitcoin#7218 (non-QT part)
- bitcoin/bitcoin#7313
- bitcoin/bitcoin#7438
- bitcoin/bitcoin#7553
- bitcoin/bitcoin#7637
- bitcoin/bitcoin#7683
- bitcoin/bitcoin#7813
- bitcoin/bitcoin#7703
- bitcoin/bitcoin#8203
- bitcoin/bitcoin#9004
- bitcoin/bitcoin#9234
- bitcoin/bitcoin#9911 (partial)

Closes #2061.
2017-03-26 02:44:06 +00:00
zkbot f7fcad709b Auto merge of #2203 - arcalinea:2142_security_log_message, r=daira
Add message directing users to security guide

Addresses #2142, which was blocking on updates to zcash/support/security.html. That page has now been added, so this message directing users to the site can be included.

It displays in the zcash-cli --help and --version message text, and on the zcashd metrics screen.
2017-03-26 01:36:24 +00:00
Jack Grigg 87b7f4d878
torcontrol: Log invalid parameters in Tor reply strings where meaningful 2017-03-26 14:35:13 +13:00
Daira Hopwood f0d1accb7d Line-wrap privacy notice. Use <> around URL and end sentence with '.'.
Include privacy notice in help text for zcashd -help.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-03-26 02:08:29 +01:00
Jack Grigg 3290567bbd
torcontrol: Check for reading errors in ReadBinaryFile
This ensures that ReadBinaryFile never returns exactly TOR_COOKIE_SIZE bytes if
the file was larger than that.
2017-03-26 13:53:13 +13:00
Simon 99eb947a98 Add AMQP 1.0 support via Apache Qpid Proton C++ API 0.17.0 2017-03-25 08:51:40 -07:00
Jack Grigg 64101d0407
torcontrol: Fix ParseTorReplyMapping
- Ignore remaining input if it is an OptArguments
- Correctly handle escapes
2017-03-26 00:35:13 +13:00
Jack Grigg 6dbd95afa1
torcontrol: Add unit tests for Tor reply parsers 2017-03-26 00:34:53 +13:00
Jack Grigg 8966598033
torcontrol: Improve comments 2017-03-25 20:25:59 +13:00
Pavel Janík 4b5ba449bb
Make some global variables less-global (static) 2017-03-25 20:25:57 +13:00
Pavel Janík f0e9019223
Prevent -Wshadow warnings with gcc versions 4.8.5, 5.3.1 and 6.2.1.
Zcash: partial (ignoring src/test/script_tests.cpp due to merge conflicts)
2017-03-25 20:25:56 +13:00
Wladimir J. van der Laan 9e5c9d0a04
torcontrol: Explicitly request RSA1024 private key
When generating a new service key, explicitly request a RSA1024 one.

The bitcoin P2P protocol has no support for the longer hidden service names
that will come with ed25519 keys, until it does, we depend on the old
hidden service type so make this explicit.

See #9214.
2017-03-25 20:25:55 +13:00
Wladimir J. van der Laan ca5e229514
tor: Change auth order to only use HASHEDPASSWORD if -torpassword
Change authentication order to make it more clear (see #7700).

- If the `-torpassword` option is provided, force use of
  `HASHEDPASSWORD` auth.

- Give error message if `-torpassword` provided, but
  `HASHEDPASSWORD` auth is not available.

- Give error message if only `HASHEDPASSWORD` available, but
  `-torpassword` not given.
2017-03-25 20:25:50 +13:00
Jonas Schnelli 1a41e3f660
Fix torcontrol.cpp unused private field warning 2017-03-25 20:25:48 +13:00
Wladimir J. van der Laan 3d7cddcaa2
Fix memleak in TorController [rework]
It looks like, TorController::disconnected_cb(TorControlConnection&
conn) gets called multiple times which results in multiple event_new().

Avoid this by creating the event only once in the constructore, and
deleting it only once in the destructor (thanks to Cory Fields for the
idea).

Replaces the fix by Jonas Schnelli in #7610, see discussion there.
2017-03-25 20:25:46 +13:00
Patrick Strateman a05be280e7
Remove vfReachable and modify IsReachable to only use vfLimited.
We do not know that a class of Network is reachable, only that it is not.
2017-03-25 20:25:45 +13:00
Gregory Maxwell f28a87b4ba
Decide eviction group ties based on time.
This corrects a bug the case of tying group size where the code may
 fail to select the group with the newest member. Since newest time
 is the final selection criteria, failing to break ties on it
 on the step before can undermine the final selection.

Tied netgroups are very common.
2017-03-25 20:25:44 +13:00
Gregory Maxwell 35db253fb6
Do not absolutely protect local peers from eviction.
With automatic tor HS support in place we should probably not be providing
 absolute protection for local peers, since HS inbound could be used to
 attack pretty easily.  Instead, this counts on the latency metric inside
 AttemptToEvictConnection to privilege actually local peers.
2017-03-25 20:25:42 +13:00
calebogden e10e212470
Fixing typos on security-check.py and torcontrol.cpp 2017-03-25 20:25:41 +13:00
MarcoFalke 9b46a35b8d
torcontrol debug: Change to a blanket message that covers both cases 2017-03-25 20:25:39 +13:00
Daniel Cousens 65fd8eb134
torcontrol: only output disconnect if -debug=tor 2017-03-25 20:25:35 +13:00
Peter Todd 2b30758b2f
Connect to Tor hidden services by default
Adds 127.0.0.1:9050 for the .onion proxy if we can succesfully connect
to the control port.

Natural followup to creating hidden services automatically.
2017-03-25 20:24:58 +13:00
Wladimir J. van der Laan 975dc649af
torcontrol improvements and fixes
- Force AUTHCOOKIE size to be 32 bytes: This provides protection against
  an attack where a process pretends to be Tor and uses the cookie
  authentication method to nab arbitrary files such as the
  wallet
- torcontrol logging
- fix cookie auth
- add HASHEDPASSWORD auth, fix fd leak when fwrite() fails
- better error reporting when cookie file is not ok
- better init/shutdown flow
- stop advertizing service when disconnected from tor control port
- COOKIE->SAFECOOKIE auth
2017-03-25 20:22:12 +13:00
Peter Todd 77e5601e9e
Better error message if Tor version too old 2017-03-25 20:22:11 +13:00
Wladimir J. van der Laan eb5f63fe58
net: Automatically create hidden service, listen on Tor
Starting with Tor version 0.2.7.1 it is possible, through Tor's control socket
API, to create and destroy 'ephemeral' hidden services programmatically.
https://stem.torproject.org/api/control.html#stem.control.Controller.create_ephemeral_hidden_service

This means that if Tor is running (and proper authorization is available),
bitcoin automatically creates a hidden service to listen on, without user
manual configuration. This will positively affect the number of available
.onion nodes.

- When the node is started, connect to Tor through control socket
- Send `ADD_ONION` command
- First time:
    - Make it create a hidden service key
    - Save the key in the data directory for later usage
- Make it redirect port 8333 to the local port 8333 (or whatever port we're listening on).
- Keep control socket connection open for as long node is running. The hidden service will
  (by default) automatically go away when the connection is closed.
2017-03-25 20:22:09 +13:00
Matt Quinn 8a5ae3c7a9
Consolidate individual references to the current maximum peer connection
value of 125 into a single constant declaration.
2017-03-25 20:22:07 +13:00
zkbot f9f48667be Auto merge of #2176 - str4d:1593-libevent, r=bitcartel
libevent-based http server

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5677
- bitcoin/bitcoin#6695
- bitcoin/bitcoin#6899
- bitcoin/bitcoin#7016
- bitcoin/bitcoin#7964
- bitcoin/bitcoin#8722
- bitcoin/bitcoin#8730
- bitcoin/bitcoin#9073
- bitcoin/bitcoin#9265
- bitcoin/bitcoin#9387
- bitcoin/bitcoin#9471
- bitcoin/bitcoin#9647
- bitcoin/bitcoin#9903
- bitcoin/bitcoin#6640
- bitcoin/bitcoin#8139
- bitcoin/bitcoin#8839

Closes #1593 and #1856.
2017-03-25 04:52:16 +00:00
Jack Grigg 3da13e885e
Fix typo 2017-03-25 17:40:27 +13:00
Jack Grigg 206e2b9737
Wrap error string 2017-03-25 17:39:56 +13:00
zkbot 2bdb37276e Auto merge of #2198 - str4d:2139-timer, r=str4d
Improve mining metrics

Closes #2139.
2017-03-25 00:08:47 +00:00
Jack Grigg 601f00f6fb
Add AtomicTimer tests 2017-03-25 13:06:00 +13:00
Jack Grigg 5c0d105b6b
Update LocalSolPS test 2017-03-25 12:57:22 +13:00
Jay Graber 704547965a Change help text examples to use Zcash addresses 2017-03-24 14:52:28 -07:00
Jay Graber ab1d2d575c Add security message to license text, rm url from translation string 2017-03-24 13:48:27 -07:00
paveljanik 17694e4bcf
[TRIVIAL] Fix typo: exactmath -> exactmatch
... but not yet in trivial tree
2017-03-24 18:42:45 +13:00
zkbot 6344719817 Auto merge of #2052 - str4d:2032-z_importkey-partial-rescan, r=bitcartel
Usability improvements for z_importkey

- Add height parameter to z_importkey to reduce rescan range
- Change semantics of rescan parameter, so users can explicitly force a rescan
  for existing keys.

Closes #2032
2017-03-24 03:47:11 +00:00
Jay Graber 54c0a28123 Add security warning to zcashd metrics display 2017-03-23 20:43:23 -07:00
Jack Grigg 33589401ba
Require that z_importkey height parameter be in valid range 2017-03-24 16:07:53 +13:00
zkbot 23f792c2f5 Auto merge of #2187 - bitcartel:1.0.7_getblock_by_height, r=bitcartel
Closes #2186. RPC getblock now accepts height or hash.
2017-03-24 02:55:27 +00:00
Simon 7d3b152897 Closes #2186. RPC getblock now accepts height or hash. 2017-03-23 19:25:04 -07:00
Jay Graber efa9c265c4 Add security warning to zcash-cli --help and --version message output 2017-03-23 18:13:09 -07:00
Ian Kelling 629a875229
Docs: add details to -rpcclienttimeout doc 2017-03-24 09:03:59 +13:00
Luke Dashjr c65969a5a6
Skip RAII event tests if libevent is built without event_set_mem_functions 2017-03-24 09:03:59 +13:00
Karl-Johan Alm ca50af75b1
Added EVENT_CFLAGS to test makefile to explicitly include libevent headers. 2017-03-24 09:03:59 +13:00
Karl-Johan Alm e8b6d84b9f
Added some simple tests for the RAII-style events. 2017-03-24 09:03:59 +13:00
Karl-Johan Alm 68377e18a8
Switched bitcoin-cli.cpp to use RAII unique pointers with deleters. 2017-03-24 09:03:59 +13:00
Karl-Johan Alm 17fb609097
Added std::unique_ptr<> wrappers with deleters for libevent modules. 2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 7c2ab05969
bitcoin-cli: Make error message less confusing
Sorry for the churn on this, but the current message (introduced in #9073)
isn't acceptable:

    $ src/bitcoin-cli getinfo
    rpc: couldn't connect to server
    (make sure server is running and you are connecting to the correct RPC port: -1 unknown)

Putting the error code after the words "RPC port" made me wonder whether
there was a port configuration issue.

This changes it to:

    $ src/bitcoin-cli getinfo
    error: couldn't connect to server: unknown (code -1)
    (make sure server is running and you are connecting to the correct RPC port)
2017-03-24 09:03:59 +13:00
instagibbs 603205e381
Add common failure cases for rpc server connection failure 2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 6415573a59
bitcoin-cli: More detailed error reporting
Register a evhttp error handler to get a more detailed error message
if the HTTP request fails.
2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 08c581940a
auto_ptr → unique_ptr
Change the few occurrences of the deprecated `auto_ptr` to c++11 `unique_ptr`.
Silences the deprecation warnings.

Also add a missing `std::` for consistency.
2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 0e2b1ae259
chain: define enum used as bit field as uint32_t
Bitwise logic combined with `<` with undefined signedness will
potentially results in undefined behavior. Fix this by defining the type
as a c++11 typed enum.

Fixes #6017.
2017-03-24 09:03:59 +13:00
Gregory Maxwell 599d2c4034
Avoid a compile error on hosts with libevent too old for EVENT_LOG_WARN.
This uses _EVENT_LOG_WARN instead, which appears to be defined in the
 old versions of libevent that I have on some systems.
2017-03-24 09:03:59 +13:00
Bob McElrath c922edd00f
Add explicit shared_ptr constructor due to C++11 error 2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 89bccddcd8
rpc: Split option -rpctimeout into -rpcservertimeout and -rpcclienttimeout
The two timeouts for the server and client, are essentially different:

- In the case of the server it should be a lower value to avoid clients
clogging up connection slots

- In the case of the client it should be a high value to accomedate slow
  responses from the server, for example for slow queries or when the
  lock is contended

Split the options into `-rpcservertimeout` and `-rpcclienttimeout` with
respective defaults of 30 and 900.
2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan a659991a2c
http: Disable libevent debug logging, if not explicitly enabled
Add a option "-debug=libevent" to enable libevent debugging for troubleshooting.
Libevent logging is redirected to our own log.
2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 7ed4d40c61
init: Ignore SIGPIPE
Ignore SIGPIPE on all non-win32 OSes, otherwise an unexpectedly disconnecting
RPC client will terminate the application. This problem was introduced
with the libhttp-based RPC server.

Fixes #6660.
2017-03-24 09:03:59 +13:00
Jack Grigg 077ddc1187
Add libevent to zcash-gtest 2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 167b6231c9
Move windows socket init to utility function 2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 116503c0b8
Fix race condition between starting HTTP server thread and setting EventBase()
Split StartHTTPServer into InitHTTPServer and StartHTTPServer to give
clients a window to register their handlers without race conditions.

Thanks @ajweiss for figuring this out.
2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 9fb5b94e64
Document options for new HTTP/RPC server in --help 2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 858afa1a4a
Implement RPCTimerHandler for Qt RPC console
Implement RPCTimerHandler for Qt RPC console, so that `walletpassphrase`
works with GUI and `-server=0`.

Also simplify HTTPEvent-related code by using boost::function directly.

Zcash: QT changes ommitted
2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan afd64f76ea
evhttpd implementation
- *Replace usage of boost::asio with [libevent2](http://libevent.org/)*.
boost::asio is not part of C++11, so unlike other boost there is no
forwards-compatibility reason to stick with it. Together with #4738 (convert
json_spirit to UniValue), this rids Bitcoin Core of the worst offenders with
regard to compile-time slowness.

- *Replace spit-and-duct-tape http server with evhttp*. Front-end http handling
is handled by libevent, a work queue (with configurable depth and parallelism)
is used to handle application requests.

- *Wrap HTTP request in C++ class*; this makes the application code mostly
HTTP-server-neutral

- *Refactor RPC to move all http-specific code to a separate file*.
Theoreticaly this can allow building without HTTP server but with another RPC
backend, e.g. Qt's debug console (currently not implemented) or future RPC
mechanisms people may want to use.

- *HTTP dispatch mechanism*; services (e.g., RPC, REST) register which URL
paths they want to handle.

By using a proven, high-performance asynchronous networking library (also used
by Tor) and HTTP server, problems such as #5674, #5655, #344 should be avoided.

What works? bitcoind, bitcoin-cli, bitcoin-qt. Unit tests and RPC/REST tests
pass. The aim for now is everything but SSL support.

Configuration options:

- `-rpcthreads`: repurposed as "number of  work handler threads". Still
defaults to 4.

- `-rpcworkqueue`: maximum depth of work queue. When this is reached, new
requests will return a 500 Internal Error.

- `-rpctimeout`: inactivity time, in seconds, after which to disconnect a
client.

- `-debug=http`: low-level http activity logging
2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan df377ca82c
build: build-system changes for libevent 2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 72f52420ec
Remove rpc_boostasiotocnetaddr test
Dropping all use of boost::asio.
2017-03-24 09:03:59 +13:00
Jack Grigg bec25c91cb
Revert "Closes #1680, temporary fix for rpc deadlock inherited from upstream."
This reverts commit f4404d7b5b.
2017-03-24 09:03:59 +13:00
zkbot 7d9bf65501 Auto merge of #2168 - str4d:2164-getblock-anchor, r=daira
Add anchor to output of getblock

Closes #2164.
2017-03-23 18:21:10 +00:00
zkbot 00e59e5935 Auto merge of #2175 - str4d:2074-txn-mempool, r=bitcartel
Bitcoin 0.12 mempool memory usage PRs

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6410
- bitcoin/bitcoin#6453
- bitcoin/bitcoin#6013 (excludes changes to docs we deleted)

Part of #2074.
2017-03-23 17:29:35 +00:00
Jack Grigg b7e5b7d5ee
Simplify z_importkey by making rescan a string
Transparently handles older boolean values as well.
2017-03-23 15:57:11 +13:00
Jack Grigg 493d8d81fb
Expand on reasons for mining being paused 2017-03-23 15:16:04 +13:00
Jack Grigg af370021a0
Metrics: Improve mining status 2017-03-23 14:08:36 +13:00
Jack Grigg dd20d04679
Metrics: Move local solution rate into stats 2017-03-23 14:08:33 +13:00
Jack Grigg 07be8f7eb9
Use AtomicTimer for more accurate local solution rate 2017-03-23 14:07:52 +13:00
Jack Grigg 73bf85b44f
Implement an AtomicTimer 2017-03-23 14:07:29 +13:00
zkbot 3b11e24f92 Auto merge of #2183 - ebfull:rust-introduction, r=ebfull
Introduce Rust/librustzcash into the zcash build system

Introduces Rust into the build system and brings a trivial xor operation into the code (near where we will likely be working).
2017-03-21 03:40:12 +00:00
zkbot c4a7c9f20f Auto merge of #2157 - arcalinea:1652_submitblock_documentation, r=daira
Document returned results of submitblock

documentation for #1652
2017-03-20 17:11:50 +00:00
Sean Bowe 802ea76b3a Allow Rust-language related assets to be disabled with `--disable-rust`. 2017-03-18 07:47:40 -06:00
Sean Bowe 6a0c7ceae9 Introduce librustzcash and Rust to depends system. 2017-03-17 11:46:41 -06:00
Jack Grigg a31ba7a0cb
Usability improvements for z_importkey
- Add height parameter to z_importkey to reduce rescan range
- Change semantics of rescan parameter, so users can explicitly force a rescan
  for existing keys.

Closes #2032
2017-03-16 19:34:41 +13:00
Jack Grigg 43a03e3bfc
Migrate IncrementalMerkleTree memory usage calls 2017-03-14 18:01:05 +13:00
Pavel Janík 30c163d99d
Implement REST mempool API, add test and documentation. 2017-03-14 13:52:06 +13:00
Pieter Wuille 6bd1d60c97
Separate core memory usage computation in core_memusage.h 2017-03-14 13:45:05 +13:00
Pieter Wuille bde5c8b0f1
Implement accurate memory accounting for mempool 2017-03-14 13:44:39 +13:00
zkbot a28b17b7b7 Auto merge of #1636 - daira:fix-licensing-and-remove-qt, r=str4d
Remove QT code

This removes the QT wallet code, and updates license documentation accordingly.
2017-03-10 23:47:43 +00:00
Jack Grigg 0bc1e2c431
Add anchor to output of getblock
Closes #2164.
2017-03-10 20:09:40 +13:00
Simon 07cf426404 Remove stale Qt comments and dead code 2017-03-09 17:04:59 -08:00
Jay Graber 0fe4b85708 Update version to 1.0.7-1 2017-03-08 12:50:33 -08:00
Daira Hopwood 38ba3c666f Remove QT gunk from Makefiles.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-03-07 19:15:08 +00:00
Jay Graber 552d755339 Document returned results of submitblock 2017-03-06 13:18:58 -08:00
Jay Graber a83f0677b4 Update release to 1.0.7, generate manpages 2017-03-03 21:55:36 -08:00
Daira Hopwood d395fee8a5 Remove src/qt.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-03-04 05:11:57 +00:00
zkbot a7cf698873 Auto merge of #2100 - str4d:2074-rpc, r=arcalinea
Bitcoin 0.12 RPC PRs 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6266
- bitcoin/bitcoin#6257
- bitcoin/bitcoin#6271
- bitcoin/bitcoin#6158
- bitcoin/bitcoin#6307
- bitcoin/bitcoin#6290
- bitcoin/bitcoin#6262
- bitcoin/bitcoin#6088
- bitcoin/bitcoin#6339
- bitcoin/bitcoin#6299 (partial, remainder in #2099)
- bitcoin/bitcoin#6350
- bitcoin/bitcoin#6247
- bitcoin/bitcoin#6362
- bitcoin/bitcoin#5486
- bitcoin/bitcoin#6417
- bitcoin/bitcoin#6398 (partial, remainder was included in #1950)
- bitcoin/bitcoin#6444
- bitcoin/bitcoin#6456 (partial, remainder was included in #2082)
- bitcoin/bitcoin#6380
- bitcoin/bitcoin#6970

Part of #2074.
2017-03-04 02:57:46 +00:00
zkbot dadb1ab74c Auto merge of #2101 - str4d:2074-tests, r=arcalinea
Bitcoin 0.12 test PRs 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6337
- bitcoin/bitcoin#6390
- bitcoin/bitcoin#5515
- bitcoin/bitcoin#6287 (partial, remainder included in bitcoin/bitcoin#6703)
- bitcoin/bitcoin#6465

Part of #2074.
2017-03-03 21:25:03 +00:00
Cory Fields 72b25b0ffd
locking: add a quick example of GUARDED_BY
This was chosen not because it's necessarily helpful, but because its locking
assumptions were already correct.
2017-03-03 11:47:10 -08:00
Cory Fields 5093299af0
locking: teach Clang's -Wthread-safety to cope with our scoped lock macros
This allows us to use function/variable/class attributes to specify locking
requisites, allowing problems to be detected during static analysis.

This works perfectly with newer Clang versions (tested with 3.3-3.7). For older
versions (tested 3.2), it compiles fine but spews lots of false-positives.
2017-03-03 11:47:08 -08:00
Matt Corallo 8e4bc69d1f
Assert on probable deadlocks if the second lock isnt try_lock 2017-03-03 11:47:02 -08:00
Wladimir J. van der Laan 1eb6654314
tests: Fix bitcoin-tx signing testcase
Fixes wrong scriptPubkey problem, which caused the transaction to
not actually be signed.
2017-03-03 11:47:01 -08:00
Gavin Andresen abb0e8cced
Testing infrastructure: mocktime fixes
New, undocumented-on-purpose -mocktime=timestamp command-line
argument to startup with mocktime set. Needed because
time-related blockchain sanity checks are done on startup, before a
test has a chance to make a setmocktime RPC call.

And changed the setmocktime RPC call so calling it will not result in
currently connected peers being disconnected due to inactivity timeouts.
2017-03-03 11:46:59 -08:00
Jonas Schnelli 4d1d95310f
don't try to decode invalid encoded ext keys 2017-03-03 10:57:27 -08:00
Jonas Schnelli 51878774bf
extend bip32 tests to cover Base58c/CExtKey decode 2017-03-03 10:57:25 -08:00
Jonas Schnelli 53bcf8379a
fix and extend CBitcoinExtKeyBase template
- fix Decode call (req. only one param)
- add constructor for base58c->CExtKey
2017-03-03 10:57:24 -08:00
Adam Weiss 8550bcfeca
Buffer log messages and explicitly open logs
Prevents stomping on debug logs in datadirs that are locked by other
instances and lost parameter interaction messages that can get wiped by
ShrinkDebugFile().

The log is now opened explicitly and all emitted messages are buffered
until this open occurs.  The version message and log cut have also been
moved to the earliest possible sensible location.
2017-03-03 10:57:23 -08:00
Pavel Vasin 2af5a65066
remove unused inv from ConnectTip() 2017-03-03 10:57:22 -08:00
Jonas Schnelli f061578b8f
[bitcoin-cli] improve error output 2017-03-03 10:57:17 -08:00
Luke Dashjr a79c8e24a5
Fix various warnings
Found while building on Debian 7
2017-03-03 10:57:15 -08:00
Wladimir J. van der Laan 55fca515d8
build: Remove -DBOOST_SPIRIT_THREADSAFE
Now that boost spirit is no longer used, `-DBOOST_SPIRIT_THREADSAFE`
doesn't need to be passed to the compiler anymore.
2017-03-03 10:57:14 -08:00
Wladimir J. van der Laan 8d9719e0ef
Improve proxy initialization
Simplify and make the code in AppInit2 more clear.

This provides a straightforward flow, gets rid of .count() (which makes
it possible to override an earlier provided proxy option to nothing), as
well as comments the different cases.
2017-03-03 10:57:12 -08:00
Philip Kaufmann da7579184e
make CAddrMan::size() return the correct type of size_t 2017-03-03 10:57:11 -08:00
Jorge Timón e079f010bf
Consensus: Refactor: Separate Consensus::CheckTxInputs and GetSpendHeight in CheckInputs
Zcash:
- Replaces some of the refactoring performed in #1017
- Exposed Consensus::CheckTxInputs for testing
2017-03-03 10:57:09 -08:00
Philip Kaufmann fbbd3cc638
[init] add -blockversion help and extend -upnp help 2017-03-03 10:57:08 -08:00
Pieter Wuille bfa832c7ed
Reduce checkpoints' effect on consensus.
Instead of only checking height to decide whether to disable script checks,
actually check whether a block is an ancestor of a checkpoint, up to which
headers have been validated. This means that we don't have to prevent
accepting a side branch anymore - it will be safe, just less fast to
do.

We still need to prevent being fed a multitude of low-difficulty headers
filling up our memory. The mechanism for that is unchanged for now: once
a checkpoint is reached with headers, no headers chain branching off before
that point are allowed anymore.
2017-03-03 10:57:07 -08:00
Philip Kaufmann db954a65ac
use const references where appropriate 2017-03-03 10:57:05 -08:00
Peter Todd 5e478618e6
Improve comment explaining purpose of MAX_MONEY constant 2017-03-03 10:56:49 -08:00
Jack Grigg 14454a3a82
Fix typo in listbanned RPC keys 2017-03-02 13:26:34 -08:00
Jack Grigg 4acd140eeb
Update default RPC port in help strings 2017-03-02 13:26:34 -08:00
Jack Grigg 3c014397a9
BTC -> ZEC in paytxfee RPC docs
Revert before merging bitcoin/bitcoin#6504.
2017-03-02 13:26:34 -08:00
Wladimir J. van der Laan 56215c77d8
Fix crash in validateaddress with -disablewallet
Fix a null pointer dereference in validateaddress with -disablewallet. Also add a regression testcase.
2017-03-02 13:26:34 -08:00
Wladimir J. van der Laan 84d1d5fd6f
rpc: Accept strings in AmountFromValue
Accept strings containing decimal values, in addition to bare values.

Useful from JSON-RPC implementations where it's not possible to have
direct control over the text of numbers (e.g. where numbers are always
doubles), and it's still desired to send an exact value.

This would allow users to post JSON content with numbers encoded like
`{"value": "0.00000001"}` instead of `{"value": 0.00000001}` which some
php/python encoders wrap into 1e-8, or worse.
2017-03-02 13:26:34 -08:00
zathras-crypto a11c4bbd26
Exempt unspendable transaction outputs from dust checks
Since unspendable outputs can't be spent, there is no threshold at which it would be uneconomic to spend them.

This primarily targets transaction outputs with `OP_RETURN`.

---

Initially based on:

commit 9cf0ae26350033d43d5dd3c95054c0d1b1641eda
Author: zathras-crypto <zathrasc@gmail.com>
Date:   Wed Mar 25 02:04:02 2015 -0700

Changes:

- cherry-picked on top of bitcoin:master
- added RPC test for fundrawtransaction
2017-03-02 13:26:34 -08:00
Wladimir J. van der Laan ce83df8fc4
rpc: Remove chain-specific RequireRPCPassword
I've never liked the chain-specific exception to having to set a
password. It gives issues with #6388 which makes it valid to
set no password in every case (as it enables random cookie authentication).

This pull removes the flag, so that all chains are regarded the same.

It also removes the username==password test, which doesn't provide any
substantial extra security.
2017-03-02 13:23:03 -08:00
Jonas Schnelli 81eb80d841
[REST] add JSON support for /rest/headers/ 2017-03-02 13:23:03 -08:00
Forrest Voight 483672f772
When processing RPC commands during warmup phase, parse the
request object before returning an error so that id value can
be used in the response.

Prior to this commit, RPC commands sent during Bitcoin's
warmup/startup phase were responded to with a JSON-RPC error
with an id of null, which violated the JSON-RPC 2.0 spec:

id: This member is REQUIRED. It MUST be the same as the value
of the id member in the Request Object. If there was an error
in detecting the id in the Request object (e.g. Parse
error/Invalid Request), it MUST be Null.
2017-03-02 13:23:03 -08:00
Jack Grigg 0352b37bff
Adjust blockheaderToJSON() for Zcash block header 2017-03-02 13:23:03 -08:00
Peter Todd d3d5483eef
Add getblockheader RPC call
Alternative to getblock that works even when the block itself has been
pruned, returning all available information.
2017-03-02 13:23:03 -08:00
Jonas Schnelli 5548701eeb
UniValue: don't escape solidus, keep espacing of reverse solidus
Zcash: The UniValue changes are already merged; this updates the test
2017-03-02 13:23:03 -08:00
Matt Corallo 3d8013a01b
Add fundrawtransaction RPC method 2017-03-02 13:23:03 -08:00
Matt Corallo aa30f65502
Add FundTransaction method to wallet
Some code stolen from Jonas Schnelli <jonas.schnelli@include7.ch>
2017-03-02 13:23:03 -08:00
Matt Corallo b6616548ce
Small tweaks to CCoinControl for fundrawtransaction 2017-03-02 13:23:03 -08:00
Pieter Wuille 18e804a925
Add DummySignatureCreator which just creates zeroed sigs 2017-03-02 13:23:03 -08:00
dexX7 9c7167d1bc
Return all available information via validateaddress
`"validateaddress"` omits some information, even in cases where is it available.

The primary motivation is to be able to retrieve redeemScripts, after using `"addmultisigaddress"`, when not all keys are available in the keystore, but the redeemScript actually is.

The output of `"validateaddress"` with this commit:

Keys not available:
```js
validateaddress "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3"
{
  "isvalid": true,
  "address": "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3",
  "scriptPubKey": "76a914fa20d564550b105787f7ce3a9ad7fd9a45cd407088ac",
  "ismine": false,
  "iswatchonly": false,
  "isscript": false
}
```
```js
validateaddress "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK"
{
  "isvalid": true,
  "address": "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK",
  "scriptPubKey": "a9146769c19a16c9400b908756e19a4d2afb9e9760e187",
  "ismine": false,
  "iswatchonly": false,
  "isscript": true
}
```

After adding the redeemScript:
```js
addmultisigaddress 2 '["02537357B156A33306A7A014A3748631C59DF405B56F11BA4AA4A3CE81501AF095","02F1FB200390E7864EF4450C07B15988179A57C3CF3A878F668E1070CB615749FE"]'
2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK

validateaddress "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK"
{
  "isvalid": true,
  "address": "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK",
  "scriptPubKey": "a9146769c19a16c9400b908756e19a4d2afb9e9760e187",
  "ismine": false,
  "iswatchonly": false,
  "isscript": true,
  "script": "multisig",
  "hex": "522102537357b156a33306a7a014a3748631c59df405b56f11ba4aa4a3ce81501af0952102f1fb200390e7864ef4450c07b15988179a57c3cf3a878f668e1070cb615749fe52ae",
  "addresses": [
    "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3",
    "mmSKNtbYYHRrhTLKiok5TuYrGEs4Y2A4k6"
  ],
  "sigsrequired": 2,
  "account": ""
}
```

All keys available:
```js
validateaddress "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3"
{
  "isvalid": true,
  "address": "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3",
  "scriptPubKey": "76a914fa20d564550b105787f7ce3a9ad7fd9a45cd407088ac",
  "ismine": true,
  "iswatchonly": false,
  "isscript": false,
  "pubkey": "02537357b156a33306a7a014a3748631c59df405b56f11ba4aa4a3ce81501af095",
  "iscompressed": true,
  "account": ""
}
```
```js
validateaddress "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK"
{
  "isvalid": true,
  "address": "2N2g2H7gjA8a11g1yKBgh5VTqndyvbnWpBK",
  "scriptPubKey": "a9146769c19a16c9400b908756e19a4d2afb9e9760e187",
  "ismine": true,
  "iswatchonly": false,
  "isscript": true,
  "script": "multisig",
  "hex": "522102537357b156a33306a7a014a3748631c59df405b56f11ba4aa4a3ce81501af0952102f1fb200390e7864ef4450c07b15988179a57c3cf3a878f668e1070cb615749fe52ae",
  "addresses": [
    "n4KWZKx349gdMQGgTnZ8W6WfgSwybkGSK3",
    "mmSKNtbYYHRrhTLKiok5TuYrGEs4Y2A4k6"
  ],
  "sigsrequired": 2,
  "account": ""
}
```
2017-03-02 13:23:03 -08:00
Wladimir J. van der Laan a0455eca11
rpc: make `gettxoutsettinfo` run lock-free
For leveldb "An iterator operates on a snapshot of the database taken
when the iterator is created". This means that it is unnecessary to
lock out other threads while computing statistics, and neither to hold
cs_main for the whole time. Let the thread run free.
2017-03-02 13:23:03 -08:00
Jonas Schnelli cbf3ab51f9
fix lock issue for QT node diconnect and RPC disconnectnode
Zcash: only RPC disconnectnode
2017-03-02 13:23:03 -08:00
Jonas Schnelli fa80be8ff5
setban: add IPv6 tests 2017-03-02 13:23:03 -08:00
Jonas Schnelli 0382246bb1
fix missing lock in CNode::ClearBanned() 2017-03-02 13:23:03 -08:00
Jonas Schnelli 1cad8c9ff9
setban: add RPCErrorCode 2017-03-02 13:23:03 -08:00
Jonas Schnelli 171b4de8d9
fix CSubNet comparison operator 2017-03-02 13:23:03 -08:00
Jonas Schnelli fcc8920f36
setban: rewrite to UniValue, allow absolute bantime 2017-03-02 13:23:03 -08:00
Jonas Schnelli 63c06b232b
rename json field "bannedtill" to "banned_until" 2017-03-02 13:23:03 -08:00
Jonas Schnelli e521939942
[RPC] extend setban to allow subnets 2017-03-02 13:23:03 -08:00
Jonas Schnelli 445cd761c5
[net] remove unused return type bool from CNode::Ban() 2017-03-02 13:23:03 -08:00
Jonas Schnelli 962ec4b5e4
[QA] add setban/listbanned/clearbanned tests 2017-03-02 13:23:03 -08:00
Jonas Schnelli ed3f13a057
[RPC] add setban/listbanned/clearbanned RPC commands 2017-03-02 13:23:03 -08:00
Jonas Schnelli 997829713c
[net] extend core functionallity for ban/unban/listban 2017-03-02 13:23:03 -08:00
Alex van der Peet 94ee48c42a
New RPC command disconnectnode 2017-03-02 13:23:03 -08:00
Stephen 6699b42518
Add paytxfee to getwalletinfo, warnings to getnetworkinfo 2017-03-02 13:23:03 -08:00
Daniel Kraft e940185294
Fix univalue handling of \u0000 characters.
Univalue's parsing of \u escape sequences did not handle NUL characters
correctly.  They were, effectively, dropped.  The extended test-case
fails with the old code, and is fixed with this patch.
2017-03-02 13:23:03 -08:00
zkbot 28a5393401 Auto merge of #2138 - daira:2137.compactsize-portability.0, r=arcalinea
Don't assume sizes of unsigned short and unsigned int in GetSizeOfCompactSize and WriteCompactSize.

Fixes #2137

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-03-02 21:07:20 +00:00
zkbot 14711a4a43 Auto merge of #2141 - bitcartel:1969_free_rate_limiter, r=daira
Closes #1969. Large shielded transactions using the default fee are no longer treated as "free" transactions
2017-03-02 03:51:14 +00:00
zkbot c1cff6069f Auto merge of #2130 - str4d:2095-metrics-reindex-msg, r=arcalinea
Do not ask a UI question on metrics screen

Based on bitcoin/bitcoin#8257.

Closes #2095.
2017-03-02 03:08:29 +00:00
zkbot 1a41597af8 Auto merge of #2114 - bitcartel:fix_fr_test_bug_and_new_testnet_addresses, r=daira
Closes #2113. Fixes bug in test and updates testnet fr addresses.

Updating the testnet fr addresses will introduce a consensus change on testnet, so all testnet nodes will be required to upgrade.  See #2113 for more information.
2017-03-02 02:18:33 +00:00
zkbot 312fbd9d0e Auto merge of #1932 - aniemerg:1522-pause-mining-for-joinsplit, r=arcalinea
Pause mining during JoinSplit creation

Closes #1522 .
2017-03-02 01:23:44 +00:00
Allan Niemerg 49c2cecb9f Pause mining during joinsplit creation 2017-03-01 16:54:26 -08:00
zkbot 44ccf1ff20 Auto merge of #2123 - bitcartel:2112_z_getoperationresult_returns_executing_status, r=arcalinea
Closes #2112 where z_getoperationresult could return stale status.

The problem was similar to a check-then-act race condition.  Status object was obtained from an operation, which might be in an 'executing' state.  Instead of checking the state recorded in the status object, the operation was queried again to see if it was in a finished state (failed,success,cancelled) and if yes, the status object was returned to the user.  However, if the operation had changed state in the background, the status object would be stale.
2017-03-02 00:24:26 +00:00
Simon ebe750a882 Part of #1969. Changing min fee calculation also changes the dust threshold. 2017-02-28 11:44:07 -08:00
Simon 0f724e716d Closes #1969. Default fee now sufficient for large shielded tx.
Sets default min relay tx fee to 100, which is used to initialize
nSatoshisPerK for min fee calculation.  The default z_sendmany
fee of 10000 is now sufficient to cover a tx of size 100000 bytes,
so txs will not be treated as "free" and hit the free rate limiter.
2017-02-28 11:43:04 -08:00
zkbot 6f5d8fbe81 Auto merge of #2126 - bitcartel:checkpoint_mainnet_67500, r=daira
Add checkpoint at block 67500 (mainnet)

Close #2125
2017-02-28 01:01:56 +00:00
zkbot 98ddf87d18 Auto merge of #2128 - bitcartel:checkpoint_testnet_38000, r=daira
Add checkpoint at block 38000 (testnet)

Closes #2127
2017-02-28 00:12:04 +00:00
Daira Hopwood d76ed723c5 Don't assume sizes of unsigned short and unsigned int in GetSizeOfCompactSize and WriteCompactSize.
Fixes #2137

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-02-27 19:34:23 +00:00
Jack Grigg 0cd769fbb7
Treat metrics screen as non-interactive for now
Closes #2095
2017-02-23 12:55:14 +00:00
Jack Grigg f42cde3c30
Remove reference to -reindex-chainstate
Revert this when bitcoin/bitcoin#7917 is merged.
2017-02-23 12:42:28 +00:00
Pieter Wuille 5d66d0a11e
Do not ask a UI question from bitcoind 2017-02-23 12:40:45 +00:00
Simon 5a888f7294 Add testnet checkpoint at block 38000 2017-02-22 22:34:20 -08:00
Simon b897de531c Add mainnet checkpoint at block 67500 2017-02-22 21:36:44 -08:00
Simon 2f21206cfc Closes #2112 where z_getoperationresult could return stale status. 2017-02-22 16:14:56 -08:00
Simon 1003180260 Keep first three original testnet fr addresses so existing coinbase
transactions on testnet remain valid during upgrade.  New addresses
will be used starting from block 53127.
2017-02-22 11:04:17 -08:00
zkbot 4e338b0c36 Auto merge of #2093 - bitcartel:sent_network_alerts, r=daira
Closes #2092. Maintain record of alerts sent onto mainnet.
2017-02-20 17:28:40 +00:00
Simon 4340ec9705 Update founders reward addresses for testnet 2017-02-20 09:23:06 -08:00
Simon 2911b35712 Fix bug where test was generating but not saving keys to wallet on disk. 2017-02-20 09:23:06 -08:00
Simon f47269cda9 Add assert to check alert message length is valid 2017-02-17 11:55:41 -08:00
Leo Arias 82c754f628 Fix the path to the example configuration 2017-02-11 13:52:15 -06:00
Simon 2ddec8f0e4 Bump version to 1.0.6 as part of release process 2017-02-10 09:55:49 -08:00
zkbot 93baaeee3e Auto merge of #2081 - daira:1955-single-address-mining, r=bitcartel
Address @str4d's comment on #1965 about the case where -gen is not set

https://github.com/zcash/zcash/pull/1965#discussion_r100414069

Note that the case of calling the ``setgenerate true`` RPC with the wallet disabled was already handled correctly.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-02-10 08:58:19 +00:00
zkbot eaaa5f625f Auto merge of #2082 - str4d:univalue-subtree, r=bitcartel
Add UniValue as subtree

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6637
- bitcoin/bitcoin#6239
- bitcoin/bitcoin#6379
- bitcoin/bitcoin#6456
- bitcoin/bitcoin#6788
2017-02-10 07:46:58 +00:00
zkbot e51bd1b556 Auto merge of #1990 - str4d:1985-replace-json-spirit-with-univalue, r=str4d
Convert entire source tree from json_spirit to UniValue

This PR cherry-picks bitcoin/bitcoin#6121 and then migrates the Zcash-specific code to UniValue.

Also cherry-picks:
- bitcoin/bitcoin#6241
- bitcoin/bitcoin#6234

Closes #1985.
2017-02-10 05:15:53 +00:00
Jack Grigg f54db399f2
Get rid of fPlus argument to FormatMoney in Zcash-specific code 2017-02-10 02:19:14 +00:00
Jack Grigg c24109ecc3
UniValue::getValues const reference 2017-02-10 02:19:12 +00:00
Jack Grigg 2cc6bab201
Update UniValue includes in Zcash-specific code 2017-02-10 02:19:06 +00:00
Cory Fields 1dc626314d
build: match upstream build change 2017-02-10 02:19:03 +00:00
Wladimir J. van der Laan a8c22cc4d1
util: use locale-independent parsing in ParseDouble
Use locale-indepent C++ based parsing instead of C's strtod,
which checks for different input based on the user's locale.
Fixes #6443.
2017-02-10 02:19:02 +00:00
Wladimir J. van der Laan 2aee461930
univalue: Avoid unnecessary roundtrip through double for numbers
JSON makes no distinction between numbers and reals, and our code
doesn't need to do so either.

This removes VREAL, as well as its specific post-processing in
`UniValue::write`. Non-monetary amounts do not need to be forcibly
formatted with 8 decimals, so the extra roundtrip was unnecessary
(and potentially loses precision).

Zcash: cherry-picked from commit 7650449a6777710cf818d41862626164da0cd412
Dropped changes to qa/rpc-tests/rest.py pending addition of /rest/headers/
2017-02-10 02:19:01 +00:00
Wladimir J. van der Laan d5bf1afae9
rpc: Make ValueFromAmount always return 8 decimals
This is the format that was always returned to JSON clients.
The difference was not noticed before, because VREAL values
are post-processed by univalue.

By implementing the functionality directly it breaks the dependency
of rpcserver on utilmoneystr. FormatMoney is now only used for debugging
purposes.

To test, port over the formatting tests from util_tests.cpp to
rpc_tests.cpp.
2017-02-10 02:18:59 +00:00
Wladimir J. van der Laan fed500e2dd
rpc: Accept scientific notation for monetary amounts in JSON
Add a function `ParseFixedPoint` that parses numbers according
to the JSON number specification and returns a 64-bit integer.

Then this in `AmountFromValue`, rather than `ParseMoney`.

Also add lots of tests (thanks to @jonasschnelli for some of them).

Fixes issue #6297.
2017-02-10 02:18:58 +00:00
Wladimir J. van der Laan e76a3849c6
Changes necessary now that zero values accepted in AmountFromValue
- Add an accept test for zero amounts, and a reject test for negative
  amounts
- Remove ugly hack in `settxfee` that is no longer necessary
- Do explicit zero checks in wallet RPC functions
- Don't add a check for zero amounts in `createrawtransaction` - this
  could be seen as a feature
2017-02-10 02:18:57 +00:00
Wladimir J. van der Laan a5beb3a51b
Get rid of fPlus argument to FormatMoney
It's never used with any other value than false, the default.
2017-02-10 02:18:55 +00:00
Wladimir J. van der Laan c66dff3dc7
Don't go through double in AmountFromValue and ValueFromAmount
My prime gripe with JSON spirit was that monetary values still had to be
converted from and to floating point which can cause deviations (see #3759
and https://bitcoin.stackexchange.com/questions/22716/bitcoind-sendfrom-round-amount-error).

As UniValue stores internal values as strings, this is no longer
necessary. This avoids risky double-to-integer and integer-to-double
conversions completely, and results in more elegant code to boot.
2017-02-10 02:18:54 +00:00
Jonas Schnelli fbc98d7720
remove $(@F) and subdirs from univalue make 2017-02-10 02:18:52 +00:00
Jonas Schnelli a10a6e2a0e
[Univalue] add univalue over subtree
similar to secp256k1 include and compile univalue over a subtree
2017-02-10 02:18:51 +00:00
Jack Grigg 0025fb4b0e
Merge commit 'a4071034f6ad640ef91057fa3f45098c4933f444' as 'src/univalue' 2017-02-10 02:18:46 +00:00
Jonas Schnelli 7fc7bab25d
remove univalue, prepare for subtree 2017-02-10 00:56:22 +00:00
Jack Grigg 02972a1bcd
[cleanup] Simplify test code 2017-02-10 00:53:15 +00:00
Jack Grigg 873c40365a
[cleanup] Remove unused import 2017-02-10 00:53:14 +00:00
Jack Grigg cc71666a51
unsigned int -> size_t for comparing with UniValue.size() 2017-02-10 00:53:13 +00:00
Jack Grigg 5fb326d41d
Manually iterate over UniValue arrays in tests 2017-02-10 00:53:09 +00:00
Jack Grigg 0d37ae3a59
Migrate Zcash-specific code to UniValue 2017-02-10 00:52:57 +00:00
Jonas Schnelli f70084cf06
fix rpcmining/getblocktemplate univalue transition logic error 2017-02-10 00:35:24 +00:00
Jonas Schnelli b60e9f230f
fix util_tests.cpp clang warnings
was introduced with #6121
2017-02-10 00:35:24 +00:00
Jonas Schnelli 6b1e42bbfa
univalue: add type check unit tests 2017-02-10 00:35:24 +00:00
Wladimir J. van der Laan 4bcb9c9099
univalue: add strict type checking 2017-02-10 00:35:24 +00:00
Wladimir J. van der Laan 5960d70002
util: Add ParseInt64 and ParseDouble functions
Strict parsing functions for other numeric types.

- ParseInt64 analogous to ParseInt32, but for 64-bit values.
- ParseDouble for doubles.
- Make all three Parse* functions more strict (e.g. reject whitespace on
  the inside)

Also add tests.
2017-02-10 00:35:24 +00:00
Wladimir J. van der Laan ff67da37cd
Simplify RPCclient, adapt json_parse_error test
# Conflicts:
#	src/test/rpc_tests.cpp
2017-02-10 00:35:24 +00:00
Jonas Schnelli c288192b19
fix univalue json parse tests 2017-02-10 00:35:24 +00:00
Jonas Schnelli b47f3aea36
fix missing univalue types during constructing 2017-02-10 00:35:24 +00:00
Jonas Schnelli bf3f56025d
fix rpc batching univalue issue 2017-02-10 00:35:24 +00:00
Jonas Schnelli d014114d67
Remove JSON Spirit wrapper, remove JSON Spirit leftovers
- implement find_value() function for UniValue
- replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper
- remove JSON Spirit sources
2017-02-10 00:35:24 +00:00
Jonas Schnelli 851f58f94e
remove JSON Spirit UniValue wrapper 2017-02-10 00:35:24 +00:00
Jonas Schnelli 565d26737a
fix rpc unit test, plain numbers are not JSON compatible object
UniValues read() does only read valid json.
2017-02-10 00:35:24 +00:00
Jonas Schnelli 9ccfdd9a01
univalue: correct bool support 2017-02-10 00:35:24 +00:00
Jonas Schnelli 49a5df0ef3
univalue: add support for real, fix percision and make it json_spirit compatible
- avoid breaking the API because of different number/percision handling
2017-02-10 00:35:24 +00:00
Jonas Schnelli 23f71dc740
special threatment for null,true,false because they are non valid json 2017-02-10 00:35:24 +00:00
Jonas Schnelli 38fc4b7090
expicit set UniValue type to avoid empty values 2017-02-10 00:35:24 +00:00
Jonas Schnelli 9756b7bd29
extend conversion to UniValue 2017-02-10 00:35:24 +00:00
Jeff Garzik ed21d5bd4b
Convert tree to using univalue. Eliminate all json_spirit uses. 2017-02-10 00:35:24 +00:00