Commit Graph

898 Commits

Author SHA1 Message Date
Jack Grigg 9e851450ab
Adjust rewind logic to use the network upgrade mechanism 2018-02-04 22:58:42 +00:00
Pieter Wuille 89f20450c2
Add rewind logic to deal with post-fork software updates
Includes logic for dealing with pruning by Suhas Daftuar.
2018-02-04 22:58:42 +00:00
Jack Grigg b174b7e330
Allow changing network upgrade parameters on regtest
Derived from upstream commit 56c87e92110f05d7452f1e85bf755246ffc77206:
    Allow changing BIP9 parameters on regtest
2018-02-04 22:57:59 +00:00
Jack Grigg fee8835388
Mark libsnark includes as library includes 2017-11-15 16:49:10 +00:00
Homu c8ecd49574 Auto merge of #2159 - bitcartel:1.0.7_payment_disclosure, r=str4d
Payment disclosure (experimental feature)
2017-11-14 14:06:22 -08:00
Simon 45232b1961 Add payment disclosure as experimental feature. 2017-11-14 13:29:05 -08:00
Homu 6f9f09dfb0 Auto merge of #2670 - arielgabizon:lowmemprover, r=daira
Low memory prover

This PR integrates @ebfull 's low memory changes:  https://github.com/zcash/zcash/pull/2243/commits
on top of @str4d 's work bringing in libsnark as a subtree
4699d0eb36
2017-11-06 04:22:20 -08:00
Simon c2d3bafeaa Closes #2639. z_shieldcoinbase is now supported, no longer experimental.
This reverts commit 5023af7bd5.
2017-10-26 11:29:36 -07:00
Homu fb2f98e00b Auto merge of #2555 - jasondavies:fix-2554, r=str4d
Fix various thread assertion errors caused during shutdown.

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6719
- bitcoin/bitcoin#6990
- bitcoin/bitcoin#8421
  - Second commit only in this PR
- bitcoin/bitcoin#11006

I've cherry-picked the relevant commits, along with a note in each commit referring to the original Bitcoin commit ID (and the Zcash issue numbers where applicable).  I've tested each issue with/without these patches applied.

Closes #2214, #2334, and #2554.
2017-10-23 15:15:14 -07:00
Sean Bowe 1a9543d064 Remove crusty old "loadVerifyingKey"/"loadProvingKey" APIs and associated invariants. 2017-10-21 15:42:41 +03: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
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
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
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
Daira Hopwood 506a21850a Remove UPnP support. fixes #2500
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-07-03 08:57:05 +01: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 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
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
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
Pieter Wuille 3d02d0f63a
Switch to libsecp256k1-based validation for ECDSA 2017-06-06 17:52:25 +12:00
Jack Grigg 5b3bc9716e Implement automatic shutdown of deprecated Zcash versions
Closes #2274.
2017-05-12 14:41:46 +12: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
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
Simon 99eb947a98 Add AMQP 1.0 support via Apache Qpid Proton C++ API 0.17.0 2017-03-25 08:51:40 -07: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
Daniel Cousens 65fd8eb134
torcontrol: only output disconnect if -debug=tor 2017-03-25 20:25:35 +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
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
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
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 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
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
Simon 07cf426404 Remove stale Qt comments and dead code 2017-03-09 17:04:59 -08: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
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
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
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 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
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
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
Daira Hopwood 3df7c4c8c0 Address @str4d's comment about the case where -gen is not set.
Also avoid shadowing mineToLocalWallet variable.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-02-10 00:15:12 +00:00
Jack Grigg b8eb37757b
Require -experimentalmode for wallet encryption 2017-02-09 22:10:58 +00:00
Jack Grigg 1f015f6afa
Add a flag for enabling experimental features 2017-02-09 22:10:58 +00:00
zkbot 0c78782662 Auto merge of #1965 - str4d:1955-single-address-mining, r=bitcartel
Switch miner to P2PKH, add -mineraddress option

Closes #945 and #1955.
2017-02-09 20:58:00 +00:00
zkbot 253c610783 Auto merge of #2050 - str4d:2020-zmq, r=bitcartel
Add ZeroMQ notifications

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6103
- bitcoin/bitcoin#6684
- bitcoin/bitcoin#6686
- bitcoin/bitcoin#6736
- bitcoin/bitcoin#6739
- bitcoin/bitcoin#6743
- bitcoin/bitcoin#6768
- bitcoin/bitcoin#6779
- bitcoin/bitcoin#6810
- bitcoin/bitcoin#6927
- bitcoin/bitcoin#6980 (only upgrading zeromq)
- bitcoin/bitcoin#6680
- bitcoin/bitcoin#7058
- bitcoin/bitcoin#7621
- bitcoin/bitcoin#7335 (only parts affecting `zmq_test.py`)
- bitcoin/bitcoin#7853 (only parts affecting `zmq_test.py`)
- bitcoin/bitcoin#7762
- bitcoin/bitcoin#7993 (only upgrading zeromq)
- bitcoin/bitcoin#8238
- bitcoin/bitcoin#8701
- bitcoin/bitcoin#6685

Closes #2020.
2017-02-09 20:08:15 +00:00
Daira Hopwood 9bba9b37c8 Better error reporting for the !ENABLE_WALLET && ENABLE_MINING case.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-02-09 19:31:47 +00:00
zkbot 80a32b2845 Auto merge of #1863 - str4d:1795-config-flag-disable-miner, r=bitcartel
Add compile flag to disable compilation of mining code

Closes #1795
2017-02-09 17:43:43 +00:00
Jack Grigg f49bcdf92b
Add -minetolocalwallet flag, enforced on -mineraddress 2017-02-08 23:37:45 +00:00
Daniel Cousens 6550e97224
init: add zmq to debug categories 2017-02-08 22:11:53 +00:00
Daniel Cousens 57c6ef01d9
init: amend ZMQ flag names 2017-02-08 22:10:42 +00:00
João Barbosa 5015d2b27f
Fix ZMQ Notification initialization and shutdown
Moves the call Initialize() from init.cpp to CreateWithArguments() and handles the
return value. Moves the call Shutdown() from init.cpp to destructor.
Changes Initialize() and Shutdown() to protected members.
2017-02-08 22:10:42 +00:00
Jeff Garzik f200002cf3
Add ZeroMQ support. Notify blocks and transactions via ZeroMQ
Continues Johnathan Corgan's work.
Publishing multipart messages

Bugfix: Add missing zmq header includes

Bugfix: Adjust build system to link ZeroMQ code for Qt binaries
2017-02-08 22:10:42 +00:00
Simon 43b6753782 Update zrpc vs zrpcunsafe logging in z_sendmany operation 2017-02-08 10:50:40 -08:00
Simon 3307124a2b Add parameter interaction, where zrpcunsafe implies zrpc 2017-02-06 23:29:07 -08:00
Jack Grigg 78ba3472d2
Update help text for mining options 2017-02-06 11:55:05 +00:00
Jack Grigg 8e8b6d701b
Switch miner to P2PKH, add -mineraddress option
Closes #945 and #1955.
2017-02-06 11:54:58 +00:00
Jack Grigg 2cc0a252ad
Add compile flag to disable compilation of mining code 2017-01-30 21:14:46 +01:00
Jack Grigg 207924a1d5
Remove OpenSSL PRNG reseeding
Per https://download.libsodium.org/doc/generating_random_data/ reseeding the
default libsodium PRNG is not required.
2017-01-23 17:06:54 +01:00
zkbot c2c7998c2e Auto merge of #1979 - str4d:1786-inform-users-to-fetch-params, r=bitcartel
Instruct users to run zcash-fetch-params if network params aren't available

Closes #1786.
2017-01-19 21:47:26 +00:00
zkbot 78674ca79e Auto merge of #2007 - bitcartel:1097_copyright_notice_and_date, r=bitcartel
Closes #1097 so that zcash-cli displays license info like zcashd.

LicenseInfo is refactored from init.cpp to util.cpp so that the
bitcoin-cli makefile target does not need to be modified.
2017-01-19 00:56:47 +00:00
zkbot 63e0e895a5 Auto merge of #2006 - bitcartel:1497_destination_path_validation_when_exporting, r=bitcartel
Fixes #1497 ZCA-009 by restricting export to a user defined folder and sanitizing filenames
2017-01-18 18:19:50 +00:00
Simon 9064d73bf8 Fixes #1497 ZCA-009 by restricting data exporting to user defined folder.
Previously the RPC interface allowed z_exportwallet, backupwallet and
dumpwallet to write data to an arbitrary filename.  ZCA-009 demonstrates
how this is vulnerable.  The resolution is to only allow data to
written when the -exportdir has been configured.  Also filenames are
restricted to alphanumeric characters.
2017-01-16 10:56:06 -08:00
Simon af02114469 Closes #1097 so zcash-cli now displays license info like zcashd.
LicenseInfo is refactored from init.cpp to util.cpp so that the
bitcoin-cli makefile target does not need to be modified.
2017-01-16 09:38:09 -08:00
Jack Grigg 53e9a6a0e2
Update debug categories
Closes #1954.
2017-01-05 11:56:42 +01:00
Jack Grigg 0b0a48c881
Suggest ./zcutil/fetch-params.sh as well
Once we improve the from-source installation docs to use 'make install', we can
revert this commit.
2017-01-05 11:38:38 +01:00
Jack Grigg bddf4079fd
Instruct users to run zcash-fetch-params if network params aren't available
Closes #1786.
2017-01-04 17:58:07 +01:00
zkbot 9f7bc6cba5 Auto merge of #1904 - str4d:1749-write-witness-cache-with-best-block, r=ebfull
Write witness caches when writing the best block

For steady-state operation, this reduces the average time between wallet disk
writes from once per block to once per hour.

On -rescan, witness caches are only written out at the end along with the best
block, increasing speed while ensuring that on-disk state is kept consistent.

Witness caches are now never recreated during a -reindex, on the assumption that
the blocks themselves are not changing (the chain is just being reconstructed),
and so the witnesses will remain valid.

Part of #1749.
2016-12-09 21:11:15 +00:00
zkbot 07a728300b Auto merge of #1642 - str4d:add-solver-rate-to-getmininginfo, r=str4d
Add getlocalsolps and getnetworksolps RPC calls, show them in getmininginfo
2016-12-09 03:18:23 +00:00
zkbot 400c4f04e6 Auto merge of #1878 - str4d:1875-non-tty-metrics-usability, r=str4d
Improve non-TTY metrics usability

Closes #1875.
2016-12-07 23:19:47 +00:00
Jack Grigg 03f83b9b0d
Write witness caches when writing the best block
For steady-state operation, this reduces the average time between wallet disk
writes from once per block to once per hour.

On -rescan, witness caches are only written out at the end along with the best
block, increasing speed while ensuring that on-disk state is kept consistent.

Witness caches are now never recreated during a -reindex, on the assumption that
the blocks themselves are not changing (the chain is just being reconstructed),
and so the witnesses will remain valid.

Part of #1749.
2016-11-30 14:04:37 +13:00
Jack Grigg 18f656d2af
Clarify that metrics options are only useful without -daemon and -printtoconsole 2016-11-29 18:11:25 +13:00
lpescher ae31e4563f Update help message to match the #4219 change 2016-11-28 13:28:32 -08:00
Jack Grigg 0076a80a8a
Document metrics screen options 2016-11-18 16:49:37 +13:00
Jack Grigg 57724029da
Only show metrics by default if stdout is a TTY 2016-11-18 16:37:10 +13:00
Jack Grigg 000499ae64
Add getlocalsolps and getnetworksolps RPC calls, show them in getmininginfo 2016-11-16 22:02:49 +13:00
zkbot 057ab6b4d1 Auto merge of #1760 - ebfull:vk-preprocess, r=bitcartel
Process verification keys to perform online verification

Checking proofs involves some arithmetic with pairings using components of the proof and the verification key. If you already have some curve points, like those in the verification key, you can amortize the cost of some of the more expensive arithmetic.

This PR adopts libsnark's precomputation of G2 elements in the verification key.

We *currently* call `r1cs_ppzksnark_verifier_strong_IC`:

```c++
template<typename ppT>
bool r1cs_ppzksnark_verifier_strong_IC(const r1cs_ppzksnark_verification_key<ppT> &vk,
                                       const r1cs_ppzksnark_primary_input<ppT> &primary_input,
                                       const r1cs_ppzksnark_proof<ppT> &proof)
{
    enter_block("Call to r1cs_ppzksnark_verifier_strong_IC");
    r1cs_ppzksnark_processed_verification_key<ppT> pvk = r1cs_ppzksnark_verifier_process_vk<ppT>(vk);
    bool result = r1cs_ppzksnark_online_verifier_strong_IC<ppT>(pvk, primary_input, proof);
    leave_block("Call to r1cs_ppzksnark_verifier_strong_IC");
    return result;
}
```

Notice that this merely performs precomputation of the verification key, and then calls `r1cs_ppzksnark_online_verifier_strong_IC`. This PR merely performs the precomputation during verification key initialization, and calls that function directly.
2016-11-15 14:56:22 +00:00
Simon f4404d7b5b Closes #1680, temporary fix for rpc deadlock inherited from upstream. 2016-11-15 00:31:24 -08:00
Sean Bowe 226a6b3248 Initialize after profiling messages are suppressed. 2016-11-14 10:19:46 -07:00
ITH4Coinomia df22af008d Update init.cpp
Reformatted Text
2016-11-03 18:34:12 +05:30
Jack Grigg d35172fb67
Disable the metrics screen on regtest 2016-10-27 19:41:10 -07:00
zkbot 278439fbe3 Auto merge of #1623 - ebfull:sprout-params, r=str4d
Zcash zk-SNARK public parameters for 1.0 "Sprout".

Created in the ceremony this weekend! 🎉

We're writing a blog post about this, I'm going to publish the code shortly too.

Closes #1553
2016-10-27 03:08:10 +00:00
Sean Bowe 7662d72bf4 Make more string changes. 2016-10-26 13:57:22 -06:00
Pieter Wuille bf673640e3 Use std::atomic for fRequestShutdown and fReopenDebugLog 2016-10-24 21:55:52 -07:00
Chirag Davé 7a4e0e0932 fReopenDebugLog and fRequestShutdown should be type sig_atomic_t
This allows access as an atomic variable in the presence
of async interrupts.

See issue #7433 for more details
fixes: #7433
2016-10-24 21:54:50 -07:00
Sean Bowe 27e3f362f0 Zcash zk-SNARK public parameters for 1.0 "Sprout". 2016-10-24 11:22:39 -06:00
Jack Grigg 4ace963c80
Show important console messages on metrics screen 2016-10-22 15:50:11 -05:00
Jack Grigg a6df7ab567
Add a persistent screen showing basic node metrics
The screen is implemented using ANSI Escape sequences.

Closes #1331
2016-10-22 15:50:06 -05:00
Daira Hopwood f91bbeedb7 Add help for -equihashsolver= option.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-20 21:17:02 +01:00
Sean Bowe 796c7ee52f Update to `beta2` public parameters, remove `regtest`/`testnet3` parameters
subdirectories.
2016-10-03 15:58:02 -06:00
Jack Grigg 1683b1f58b Clear note witness caches on reindex 2016-09-27 15:21:18 +13:00
Simon 008fccfa48 Disable option to allow multiple async rpc workers. 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 805344dcf4 Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
Sean Bowe 7ee82c4361 Deallocate the public parameters during Shutdown. 2016-08-26 16:55:43 -06:00
Sean Bowe 393b2b7834 Update proving/verifying keys. 2016-08-22 15:48:43 -06:00
zkbot 365845216b Auto merge of #1268 - ThisIsNotOfficialCodeItsJustForks:t1130-upgrade-libsodium, r=ebfull
Upgrade libsodium for AVX2-detection bugfix.

Upgrades libsodium to bring in an AVX2-detection bugfix (to help with #1130).
2016-08-22 02:34:30 +00:00
Taylor Hornby 2902ac7ce8 Use libsodium's s < L check, instead checking that libsodium checks that. 2016-08-18 16:38:20 -06:00
Patrick Strateman 0560d671ab Remove redundant whiteconnections option 2016-08-15 19:37:27 -06:00
Simon 10d2c57c0d Replace calls to GetHash() with GetTxid() for transaction objects.
Where the caller intends to receive a transaction id and not a double
SHA256 hash.
2016-07-26 17:13:03 -07:00
Sean Bowe 1477fd3f40 Remove the constraint system from the alpha proving key. 2016-07-19 14:01:58 -06:00
zkbot d20d866d89 Auto merge of #1105 - bitcartel:zc.v0.11.2.z6_issue_424, r=ebfull
New private/public key pairs for broadcasting alert messages

Implements #424

Fixes and integrates method of sending alerts as described by upstream here:
- https://gist.github.com/laanwj/0e689cfa37b52bcbbb44

To send an alert:
- Copy private keys into alertkeys.h.
- Modify alert parameters and message found in sendalert.cpp
- Build and run to send the alert e.g. ./zcashd -printtoconsole -sendalert

Tested and verified with local nodes on alpha 6 testnet.
2016-07-18 21:09:46 +00:00
Simon b39e1bdbca Fixes to integrate sendalert.cpp.
Add sendalert.cpp to build process.
Add alertkeys.h as a placeholder for private keys.
2016-07-15 19:57:55 -07:00
Sean Bowe f4091941f5 Reorder initialization routines to ensure verifying key log messages appear in debug.log. 2016-07-10 21:10:02 -06:00
aniemerg dd74e9dd32 Suppress Libsnark Debugging Info
Suppress the Libsnark debugging information displayed on launch
2016-06-19 17:38:44 -04:00
Jack Grigg 3985a40d1f Change default ports 2016-06-17 00:21:58 +12:00
zkbot fe97a405e3 Auto merge of #994 - ebfull:remove-redundant-constraints, r=ebfull
Final changes to the circuit

* Remove [redundant](https://github.com/scipr-lab/libsnark/issues/37) bitness constraints that I pointed out in #908.
* The depth is increased from 20 to 29. I chose 29 because the QAP degree ends up being a power of two, which is probably going to be useful for the FFT in our MPC. (Closes #16)

If we're happy with depth 29 (over 268 million possible joinsplits), this will probably be the final change to the constraint system before 1.0.
2016-06-15 21:39:32 +00:00
Jack Grigg a5150a156e Set -relaypriority default to false
This enables spending of individual coins during mining slow start.

Closes #904.
2016-06-07 21:11:57 +12:00
Sean Bowe 1744fec274 Update the zkSNARK parameters. 2016-06-03 21:04:07 -06:00
Sean Bowe 6b5d608899 Update proving key and tests that depend on transaction structure changes 2016-05-24 11:09:17 -06:00
Jack Grigg c5d080bb83 Add Zcash Developers to CLI copyright notice 2016-05-20 11:56:19 +12:00
Sean Bowe b8d320df19 Update public zkSNARK parameters for new circuit. 2016-05-12 16:44:49 -06:00
Sean Bowe 2dc3599271 Transplant of libzcash. 2016-05-12 16:44:47 -06:00
Taylor Hornby aaf6495948 Rename bitcoin.conf and bitcoind.pid to zcash.conf and zcashd.pid in qa/ and src/ 2016-05-03 14:01:01 -06:00
Taylor Hornby 9bab3e89a2 Initialize libsodium first. 2016-03-24 13:13:14 -06:00
Sean Bowe 6806256b80 Initialize libsodium and remove openssl headers from util.cpp 2016-03-23 16:26:57 -06:00
Sean Bowe a633044b25 Reorder proving key and verifying key arguments. 2016-03-15 15:59:52 -06:00
Sean Bowe 8f8c4c6c0c Lazily load the proving key at time of first pour. 2016-03-15 14:16:05 -06:00
Sean Bowe 9144ea8c2b Testnet modifications -- just take the parameters from regtest. Also, move loading ZC params to _before_ verification. 2016-01-19 14:36:10 -07:00
Sean Bowe d66877afb3 Added mapSerials consensus rules to prohibit double-spending. 2016-01-19 14:36:09 -07:00
Sean Bowe 4f1c37980e Load proving/verifying keys at startup from the public alpha parameters file. 2016-01-19 14:36:04 -07:00
Alex Morcos dfe55bdc32
Do not allow blockfile pruning during reindex.
Also clarify startup message.

Github-Pull: #6856
Rebased-From: d3b09f6bac738958b6bf5711bcb5291049b7466d
2015-10-23 14:42:05 +02:00
Adam Weiss e6adac7b3f Delay initial pruning until after wallet init
Don't prune until any wallet rescanning has taken place to avoid
potentially pruning blocks that the wallet rescan may need.
2015-09-22 00:43:12 +00:00
Wladimir J. van der Laan e6334f4aad
Revert "Disable partition check for now, it triggers too often (issue #6251)"
Re-enable partition check, it should be safe again after #6256.

This reverts commit 3eada74d6f.
2015-06-21 17:51:01 +02:00
Gavin Andresen fce474c9df
Use best header chain timestamps to detect partitioning
The partition checking code was using chainActive timestamps
to detect partitioning; with headers-first syncing, it should use
(and with this pull request, does use) pIndexBestHeader timestamps.

Fixes issue #6251

Github-Pull: #6256
Rebased-From: 65b94545036ae6e38e79e9c7166a3ba1ddb83f66
2015-06-15 10:34:07 +02:00
Wladimir J. van der Laan 4d9c7fe61d
Add option `-alerts` to opt out of alert system
Make it possible to opt-out of the centralized alert system by providing
an option `-noalerts` or `-alerts=0`. The default remains unchanged.

This is a gentler form of #6260, in which I went a bit overboard by
removing the alert system completely.

I intend to add this to the GUI options in another pull after this.

Github-Pull: #6274
Rebased-From: 02a6702a82a5b00e0e0351041dd3267308b7f319
2015-06-15 09:58:05 +02:00
Wladimir J. van der Laan 94cd7051a3
Remove translation for -help-debug options
Github-Pull: #6264
Rebased-From: 9b5659d1c4c62bc6b80e35ff7573c781835e4187
2015-06-12 15:12:14 +02:00
Adam Weiss 6cb70ca4ee
Prune: Support noncontiguous block files
In some corner cases, it may be possible for recent blocks to end up in
the same block file as much older blocks.  Previously, the pruning code
would stop looking for files to remove upon first encountering a file
containing a block that cannot be pruned, now it will keep looking for
candidate files until the target is met and all other criteria are
satisfied.

This can result in a noncontiguous set of block files (by number) on
disk, which is fine except for during some reindex corner cases, so
make reindex preparation smarter such that we keep the data we can
actually use and throw away the rest.  This allows pruning to work
correctly while downloading any blocks needed during the reindex.

Rebased-From: c257a8c9a6397eee40734b235a4fdcb8045aec91
Github-Pull: #6221
2015-06-11 18:25:45 +02:00
Wladimir J. van der Laan 3eada74d6f
Disable partition check for now, it triggers too often (issue #6251) 2015-06-08 10:14:44 +02:00
Luke Dashjr c00ae64f77
Remove P2SH coinbase flag, no longer interesting
Github-Pull: #6203
Rebased-From: d449772cf69c01932fc5d72c46054815d6300b3c
2015-06-02 09:13:03 +02:00
Wladimir J. van der Laan c7c9af381c
Merge pull request #5669
da29ecb Consensus: MOVEONLY: Move CValidationState from main consensus/validation (jtimon)
27afcd8 Consensus: Refactor: Decouple CValidationState from main::AbortNode() (Cory Fields)
2015-05-27 15:00:02 +02:00
Wladimir J. van der Laan 0bcf04f046
Merge pull request #6153
8c35b6f Parameter interaction: disable upnp if -proxy set (Wladimir J. van der Laan)
2015-05-27 09:33:01 +02:00
Wladimir J. van der Laan e9af4e65b5
Merge pull request #5947
36cba8f Alert if it is very likely we are getting a bad chain (Gavin Andresen)
2015-05-26 10:41:17 +02:00
Wladimir J. van der Laan e1412d3e96
Merge pull request #6159
ffdda4e Catch errors on datadir lock and pidfile delete (Adam Weiss)
2015-05-24 10:57:22 +02:00
Adam Weiss ffdda4e8a7 Catch errors on datadir lock and pidfile delete
Prevents bad permissions (or other fs related problems) from resulting
in hard crashes with cryptic messages on startup and shutdown.
2015-05-22 14:15:22 -04:00
Wladimir J. van der Laan 8c35b6f3be Parameter interaction: disable upnp if -proxy set
To protect privacy, do not use UPNP when a proxy is set. The user may
still specify -listen=1 to listen locally (for a hidden service), so
don't rely on this happening through -listen.

Fixes #2927.
2015-05-18 11:22:39 +02:00
Wladimir J. van der Laan 77ed59df4d wallet: Introduce constant for `-txconfirmtarget` default 2015-05-18 09:00:24 +02:00
jtimon da29ecbcc6 Consensus: MOVEONLY: Move CValidationState from main consensus/validation 2015-05-15 16:05:28 +02:00
Wladimir J. van der Laan e47c94e64c
Merge pull request #6135
f13dac9 Comment edits and cleanup (BitcoinPRReadingGroup)
ff734e9 Alphabetic order in makefile (Jorge Timón)
5207f33 fix header include groups (Philip Kaufmann)
59b149f remove unneeded incude of wallet/db.h from rpcmining.cpp (Philip Kaufmann)
3703385 remove unused classes from db.h (Philip Kaufmann)
0a7bcb7 fix IDE/compiler warning "extra ';'" in validationinterface.h (Philip Kaufmann)
3b00e7c [Trivial] Update COPYING (sandakersmann)
dd9e688 Trivial: Corrected owner of DNS seeder (ayeowch)
a60bfd8 [init] better message when no wallet support is compiled in (Philip Kaufmann)
78f44b6 Capitalized P2P (sandakersmann)
8e9248d [Trivial] Cryptocurrency is one word (sandakersmann)
803f51e Typo in GetRawMemPool RPC method help: "]" --> "}" (Chris Arnesen)
605a735 addrman: update comments (Pavel Vasin)
2015-05-15 13:59:07 +02:00
Wladimir J. van der Laan 6fb90d8983
Merge pull request #6102
86a5f4b Relocate calls to CheckDiskSpace (Alex Morcos)
67708ac Write block index more frequently than cache flushes (Pieter Wuille)
b3ed423 Cache tweak and logging improvements (Pieter Wuille)
fc684ad Use accurate memory for flushing decisions (Pieter Wuille)
046392d Keep track of memory usage in CCoinsViewCache (Pieter Wuille)
540629c Add memusage.h (Pieter Wuille)
2015-05-15 13:43:02 +02:00
Gavin Andresen 36cba8f118
Alert if it is very likely we are getting a bad chain
Create a monitoring task that counts how many blocks have been found in the last four hours.

If very few or too many have been found, an alert is triggered.

"Very few" and "too many" are set based on a false positive rate of once every fifty years of constant running with constant hashing power, which works out to getting 5 or fewer or 48 or more blocks in four hours (instead of the average of 24).

Only one alert per day is triggered, so if you get disconnected from the network (or are being Sybil'ed) -alertnotify will be triggered after 3.5 hours but you won't get another -alertnotify for 24 hours.

Tested with a new unit test and by running on the main network with -debug=partitioncheck

Run test/test_bitcoin --log_level=message to see the alert messages:
    WARNING: check your network connection, 3 blocks received in the last 4 hours (24 expected)
    WARNING: abnormally high number of blocks generated, 60 blocks received in the last 4 hours (24 expected)

The -debug=partitioncheck debug.log messages look like:
    ThreadPartitionCheck : Found 22 blocks in the last 4 hours
    ThreadPartitionCheck : likelihood: 0.0777702
2015-05-14 14:58:44 -04:00
Gavin Andresen b4c219b622
Merge pull request #5964
9a1dcea Use CScheduler for net's DumpAddresses (Gavin Andresen)
ddd0acd Create a scheduler thread for lightweight tasks (Gavin Andresen)
68d370b CScheduler unit test (Gavin Andresen)
cfefe5b scheduler: fix with boost <= 1.50 (Cory Fields)
ca66717 build: make libboost_chrono mandatory (Cory Fields)
928b950 CScheduler class for lightweight task scheduling (Gavin Andresen)
e656560 [Qt] add defaultConfirmTarget constant to sendcoinsdialog (Philip Kaufmann)
2015-05-14 14:27:07 -04:00
Gavin Andresen 9a1dcea2df
Use CScheduler for net's DumpAddresses
Instead of starting Yet Another Thread to dump addresses,
use CScheduler to do it.
2015-05-14 12:50:42 -04:00
Gavin Andresen ddd0acd3db
Create a scheduler thread for lightweight tasks 2015-05-14 12:50:41 -04:00
Philip Kaufmann a60bfd810f [init] better message when no wallet support is compiled in 2015-05-14 01:02:00 -04:00
Alex Morcos 472b4c5dda Clean up parsing of bool command line args 2015-05-12 16:41:55 -04:00
Pieter Wuille b3ed4236be Cache tweak and logging improvements 2015-05-11 17:58:14 -07:00
Pieter Wuille fc684ad8af Use accurate memory for flushing decisions 2015-05-11 17:57:27 -07:00
Jonas Schnelli a1d0ec44d7 re-add -reindex help message
was suddenly removed with fc44231cb7 (probably not by purpose)
2015-05-08 19:59:01 +02:00
Wladimir J. van der Laan 12f3488253
Merge pull request #6047
a56054b Update key.cpp to use new libsecp256k1 (Pieter Wuille)
a591d98 Squashed 'src/secp256k1/' changes from 1897b8e..22f60a6 (Pieter Wuille)
2015-05-06 12:29:07 +02:00
Wladimir J. van der Laan 00820f921d
Merge pull request #6055
a8cdaf5 checkpoints: move the checkpoints enable boolean into main (Cory Fields)
11982d3 checkpoints: Decouple checkpoints from Params (Cory Fields)
6996823 checkpoints: make checkpoints a member of CChainParams (Cory Fields)
9f13a10 checkpoints: store mapCheckpoints in CCheckpointData rather than a pointer (Cory Fields)
2015-05-06 11:38:39 +02:00
Wladimir J. van der Laan fc44231cb7
trivial: Merge pruning help message after Transifex comment
The prune help message was broken in nonsensical parts. Merge it into
one, this is easier for translators.

Reported by yahoe.001 on transifex.
2015-05-04 18:48:38 +02:00
Wladimir J. van der Laan 04140457f4 Show an init message while activating best chain
Connecting the chain can take quite a while.
All the while it is still showing `Loading wallet...`.
Add an init message to inform the user what is happening.
2015-05-04 17:39:19 +02:00
Pieter Wuille a56054be65 Update key.cpp to use new libsecp256k1
libsecp256k1's API changed, so update key.cpp to use it.

Libsecp256k1 now has explicit context objects, which makes it completely thread-safe.
In turn, keep an explicit context object in key.cpp, which is explicitly initialized
destroyed. This is not really pretty now, but it's more efficient than the static
initialized object in key.cpp (which made for example bitcoin-tx slow, as for most of
its calls, libsecp256k1 wasn't actually needed).

This also brings in the new blinding support in libsecp256k1. By passing in a random
seed, temporary variables during the elliptic curve computations are altered, in such
a way that if an attacker does not know the blind, observing the internal operations
leaks less information about the keys used. This was implemented by Greg Maxwell.
2015-05-04 14:45:34 +02:00
Wladimir J. van der Laan 00e76db8c2
Merge pull request #6085
b05a89b Non-grammatical language improvements (Luke Dashjr)
7e6d23b Bugfix: Grammar fixes (Corinne Dashjr)
2015-05-04 08:01:58 +02:00
Corinne Dashjr 7e6d23b171 Bugfix: Grammar fixes 2015-05-01 11:21:27 +00:00
Cory Fields a8cdaf5c96 checkpoints: move the checkpoints enable boolean into main
This pertains to app-state, so it doesn't make sense to handle inside the
checkpoint functions.
2015-04-30 23:14:48 -04:00
Wladimir J. van der Laan 8a10000222
Merge pull request #6022
b74dcb3 Separate CTranslationInterface from CClientUIInterface (Jorge Timón)
2015-04-30 16:37:18 +02:00
mrbandrews f9ec3f0fad Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:

- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
  reasonably be met, with some assumptions about block sizes, orphan rates,
  etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
  mainnet; defined separately for mainnet, testnet, and regtest in chainparams
  as nPruneAfterHeight).

This unsets NODE_NETWORK if pruning is enabled.

Also included is an RPC test for pruning (pruning.py).

Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-04-22 15:53:48 -04:00
Wladimir J. van der Laan b6ea3bcede
Merge pull request #5911
6be3562 rpc-tests: Add proxy test (Wladimir J. van der Laan)
67a7949 privacy: Stream isolation for Tor (Wladimir J. van der Laan)
2015-04-20 16:37:38 +02:00
Wladimir J. van der Laan 9e16cb108e Make 'Default: %u' spacing consistent in help message
Comment by pryds on Transifex.
2015-04-20 13:29:22 +02:00
Michael Ford c069234665 Fix typo in init.cpp interpration/interpretation 2015-04-20 13:29:21 +02:00
Wladimir J. van der Laan 67a7949397 privacy: Stream isolation for Tor
According to Tor's extensions to the SOCKS protocol
(https://gitweb.torproject.org/torspec.git/tree/socks-extensions.txt)
it is possible to perform stream isolation by providing authentication
to the proxy. Each set of credentials will create a new circuit,
which makes it harder to correlate connections.

This patch adds an option, `-proxyrandomize` (on by default) that randomizes
credentials for every outgoing connection, thus creating a new circuit.

    2015-03-16 15:29:59 SOCKS5 Sending proxy authentication 3842137544:3256031132
2015-04-17 13:26:47 +02:00
Jorge Timón b74dcb3b4a Separate CTranslationInterface from CClientUIInterface 2015-04-16 19:58:48 +02:00
Wladimir J. van der Laan ea2b425b00
Merge pull request #5997
4e38217 Chainparams: Refactor: Remove redundant HashGenesisBlock() getter (Jorge Timón)
2015-04-15 12:06:55 +02:00
Jorge Timón 4e382177ed Chainparams: Refactor: Remove redundant HashGenesisBlock() getter 2015-04-12 23:01:30 +02:00
Jonas Schnelli b9fb692d04 Push down RPC reqWallet flag 2015-04-12 19:37:29 +02:00
Wladimir J. van der Laan 7efc9cf672
Merge pull request #5951
77650cc add -walletbroadcast=0 rpc test (Jonas Schnelli)
6f25262 wallet: make it possible to disable transaction broadcast (Wladimir J. van der Laan)
2015-04-08 12:09:21 +02:00
Wladimir J. van der Laan 6f252627b2 wallet: make it possible to disable transaction broadcast
This is an advanced feature which will disable any kind of automatic
transaction broadcasting in the wallet. This gives the user full control
of how the transaction is sent.

For example they can broadcast new transactions through some other
mechanism themselves, after getting the transaction hex through `gettransaction`.

This just adds the option `-walletbroadcast=<0,1>`. Right now these
transactions will get the status

    Status: conflicted, has not been successfully broadcast yet

They shouldn't be shown as conflicted at all (`walletconflicts` is empty). This status
will go away when the transaction is received through the network.
2015-04-01 13:03:39 +02:00
Pieter Wuille 3fcfbc8ac5 Add a consistency check for the block chain data structures
This adds a -checkblockindex (defaulting to true for regtest), which occasionally
does a full consistency check for mapBlockIndex, setBlockIndexCandidates, chainActive, and
mapBlocksUnlinked.
2015-03-27 13:38:48 -07:00
Wladimir J. van der Laan cbb2cf5522
Fix --disable-wallet build after merge of #5681 2015-03-24 22:15:04 +01:00
Jonas Schnelli 2bb1c87700 refactor: move bdb (bitdb) interaction from init.cpp to wallet.cpp
this will remove db.h from init.cpp
2015-03-20 16:23:39 +01:00
Jonas Schnelli 50c72f23ad [Move Only] Move wallet related things to src/wallet/
could once be renamed from /src/wallet to /src/legacywallet.
2015-03-12 14:13:02 +01:00
Luca Venturini f75470794b Fix - bitcoin-qt usage message
. Closes the bug from commit e179eb3d9b
("bitcoin-qt -help" did not show any message)
. Move all the options in init.cpp (there were already some
options related to bitcoin-qt)
2015-03-10 22:07:17 -07:00
Luca Venturini 1fdb9fa3f9 Help messages correctly formatted (79 chars)
Help messages are formatted programmatically with FormatParagraph
in order not to break existing strings in Transifex.

The new format works even if the translation of the strings
modifies the lenght of the message.

Sqashed 6 commits in a single one.
Help messages correctly formatted for SVGA text mode (132 chars)

Help messages are formatted programmatically with FormatParagraph
in order not to break existing strings in Transifex.

The new format should work even if the translation of the strings
modifies the lenght of the message.

Fix - syntax error

Correct formatting for 79 chars

Correctly based on C++ functions

Removed spare spaces from option strings

Fix - syntax error
2015-03-10 22:07:17 -07:00
Wladimir J. van der Laan 87ecfb0f96
Merge pull request #5711
5ebe095 Trim RPC command table (Wladimir J. van der Laan)
4401b2d Removed main.h dependency from rpcserver.cpp (Eric Lombrozo)
2015-02-04 10:23:09 +01:00
Pavel Janík 5262fde0ec Remove whitespaces before double colon in errors and logs 2015-01-31 17:38:28 -05:00
Eric Lombrozo 4401b2d7c5 Removed main.h dependency from rpcserver.cpp
Rebased by @laanwj:

- update for RPC methods added since 84d13ee: setmocktime,
  invalidateblock, reconsiderblock. Only the first, setmocktime, required a change,
  the other two are thread safe.
2015-01-28 07:41:54 +01:00
Wladimir J. van der Laan 2fae1875ea
Merge pull request #5243
ff09e31 sleep-wait on genesis block during init with -reindex (Matt Corallo)
2015-01-26 12:29:15 +01:00
Wladimir J. van der Laan 8204e19abe
Merge pull request #4805
44bc988 [Wallet] Do not flush the wallet in AddToWalletIfInvolvingMe(..) (Cozz Lovan)
2015-01-26 12:19:12 +01:00
Gregory Maxwell 7d2cb48511 Restore RPC HTTP keepalives to default.
This avoids a regression for issues like #334 where high speed
 repeated connections eventually run the HTTP client out of
 sockets because all of theirs end up in time_wait.

Maybe the trade-off here is suboptimal, but if both choices will
 fail then we prefer fewer changes until the root cause is solved.
2015-01-16 05:59:36 -08:00
Gregory Maxwell 16a5c18cea Add a -rpckeepalive and disable RPC use of HTTP persistent connections.
It turns out that some miners have been staying with old versions of
 Bitcoin Core because their software  behaves poorly with persistent
 connections and the Bitcoin Core thread and connection limits.

What happens is that underlying  HTTP libraries leave connections open
 invisibly to their users and then the user runs into the default four
 thread limit.  This looks like Bitcoin Core is unresponsive to RPC.

There are many things that should be improved in Bitcoin Core's behavior
 here, e.g. supporting more concurrent connections, not tying up threads
 for idle connections, disconnecting kept-alive  connections when limits
 are reached, etc. All are fairly big, risky changes.

Disabling keep-alive is a simple workaround. It's often not easy to turn
 off the keep-alive support in the client where it may be buried in some
 platform library.

If you are one of the few who really needs persistent connections you
 probably know that you want them and can find a switch; while if you
 don't and the misbehavior is hitting you it is hard to discover the
 source of your problems is keepalive related.  Given that it is best
 to default to off until they're handled better.
2015-01-14 09:49:57 -08:00
Pieter Wuille 13cdce4336 Catch UTXO set read errors and shutdown 2015-01-08 15:51:15 +01:00
Wladimir J. van der Laan d79adc1ab1
Merge pull request #5535
1c52aad Require sufficent priority for relay of free transactions (Pieter Wuille)
2015-01-07 13:01:56 +01:00
Cory Fields a3241998e1 namespace: remove boost namespace pollution 2015-01-02 15:12:03 -05:00
Pieter Wuille 1c52aad540 Require sufficent priority for relay of free transactions 2014-12-30 02:03:29 +01:00
Wladimir J. van der Laan 0f2308cf7c
Merge pull request #5272
13f9031 init: minor parameter interaction updates (Philip Kaufmann)
2014-12-27 05:41:13 +01:00
Luke Dashjr a15dba5dff en: Avoid ambiguous language regarding when transactions confirm 2014-12-23 22:07:10 +00:00
Wladimir J. van der Laan d01bcc446e
Merge pull request #5485
aa279d6 Enforce minRelayTxFee on wallet created tx and add a maxtxfee option. (Gregory Maxwell)
2014-12-23 12:12:05 +01:00
Jameson Lopp 4bc95c4387 remove max orphan blocks config parameter since it is no longer functional 2014-12-21 09:10:43 -05:00
Matt Corallo ff09e31a51 sleep-wait on genesis block during init with -reindex 2014-12-20 22:11:51 -05:00
Gregory Maxwell aa279d6131 Enforce minRelayTxFee on wallet created tx and add a maxtxfee option.
Previously the minRelayTxFee was only enforced on user specified values.

It was possible for smartfee to produce a fee below minRelayTxFee which
 would just result in the transaction getting stuck because it can't be
 relayed.

This also introduces a maxtxfee option which sets an absolute maximum
 for any fee created by the wallet, with an intention of increasing
 user confidence that the automatic fees won't burn them. This was
 frequently a concern even before smartfees.

If the configured fee policy won't even allow the wallet to meet the relay
 fee the transaction creation may be aborted.
2014-12-19 12:05:10 -08:00