Commit Graph

109 Commits

Author SHA1 Message Date
Simon 008fccfa48 Disable option to allow multiple async rpc workers. 2016-09-08 21:46:13 -07:00
Simon c1eae2806c Closes #1293 by adding z_getoperationresult and making z_getoperationstatus idempotent. 2016-09-08 21:46:13 -07:00
Simon 3b54bf5813 Refactoring and small improvements to async rpc operations.
Added AsyncRPCQueue::closeAndWait() so rpcserver can block on worker threads when shutting down.
AsyncRPCOperation is no longer copyable - copy constructor and assignment operators now private.
Refactoring: renamed methods, renamed member variables
Tidy up: comments, const, size_t, braces
2016-09-08 21:46:13 -07:00
Simon 34f0001ccc Implement RPC call z_listoperationids and update z_getoperationstatus to take a list parameter. 2016-09-08 21:46:13 -07:00
Simon 8d08172d0d Add config option 'rpcasyncthreads' to specify number of async rpc workers. Default is 1. 2016-09-08 21:46:13 -07:00
Simon fc72c078be Add async RPC queue and operation classes.
Add z_getoperationstatus RPC command.
Add z_sendmany RPC command (dummy implementation, does not send actual
coins).
2016-09-08 21:46:13 -07:00
Simon e709997ff2 Implemented z_listaddresses to return all the zaddr in the wallet. 2016-08-24 11:19:33 -07:00
Simon 92444edc00 Add z_importwallet and z_exportwallet to handle keys for both
taddr and zaddr.  Restore behaviour of dumpwallet and importwallet
to only handle taddr.
2016-08-24 11:19:33 -07:00
Simon c1c4594371 Implemented RPC calls z_importkey, z_exportkey, z_getnewaddress.
Modified RPC calls dumpwallet and importwallet to include spending keys.
2016-08-24 11:19:33 -07:00
Gaurav Rana 6c7cc8ebea update zcash-cli stop message
changed "Bitcoin server stopping" to "Zcash server stopping"
2016-08-20 12:27:12 +00:00
Sean Bowe 1737627c4e Introduce `zcsamplejoinsplit` for creating a raw joinsplit description, and use it to construct the joinsplit for the performance tests that verify joinsplits. 2016-07-19 15:49:11 -06:00
Sean Bowe b7e4abd6f7 Rename some usage of 'pour'. 2016-07-18 10:06:18 -06:00
Simon 1b114e54c4 Add getblocksubsidy RPC command to return the block reward for a given
block, taking into account the mining slow start.
2016-06-27 13:04:33 -07:00
Jack Grigg 3985a40d1f Change default ports 2016-06-17 00:21:58 +12:00
Taylor Hornby 6962bb3df0 Add automated performance measurement system. 2016-04-11 08:15:25 -06:00
Sean Bowe a8ac403db0 Added mapAnchors consensus rules, finished zcrawpour/zcrawreceive.
Some specifics on consensus changes:
* Transactions must be anchored to a real anchor in the chain.
* Anchors are pushed and popped during ConnectBlock/DisconnectBlock as appropriate.
* DisconnectTip triggers evictions, under some circumstances, of transactions in the
  mempool which are anchored to roots that are no longer valid.
* Commitments append to the tree at the current best root during ConnectBlock.
2016-01-19 14:36:04 -07:00
Sean Bowe 730790f7a4 Added primitive zcrawkeygen/zcrawpour implementations 2016-01-19 14:36:04 -07:00
Veres Lajos 45bfa137ef PARTIAL: typofixes (found by misspell_fixer)
Upstream: 9f68ed6b6d1a9c6436ce37913666165f2b180ee3 (PR #6539)
2015-09-22 00:43:15 +00:00
Wladimir J. van der Laan 7ff9d122e4 Make sure LogPrintf strings are line-terminated
Fix the cases where LogPrint[f] was accidentally called without line
terminator, which resulted in concatenated log lines.

(see e.g. #6492)
2015-09-22 00:43:11 +00:00
Wladimir J. van der Laan 1fd2d39529
Merge pull request #5420
6b4feb8 [QA] rest.py RPC test: change setgenerate() to generate() (Jonas Schnelli)
97ee866 [REST] getutxos REST command (based on Bip64) (Jonas Schnelli)
2015-05-06 16:50:05 +02:00
Luke Dashjr b05a89b2de Non-grammatical language improvements 2015-05-02 15:23:59 +00:00
Matt Corallo 59ed61b389 Add RPC call to generate and verify merkle blocks 2015-04-23 17:50:39 -07:00
Jonas Schnelli 97ee866549 [REST] getutxos REST command (based on Bip64)
has parts of @mhearn #4351
* allows querying the utxos over REST
* same binary input and outputs as mentioned in Bip64
* input format = output format
* various rpc/rest regtests
2015-04-21 20:26:49 +02:00
Jonas Schnelli b9fb692d04 Push down RPC reqWallet flag 2015-04-12 19:37:29 +02:00
Pieter Wuille 6b04508e37 Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
Gavin Andresen 0f5954c434
Regression test for ResendWalletTransactions
Adds a regression test for the wallet's ResendWalletTransactions function, which uses a new, hidden RPC command "resendwallettransactions."

I refactored main's Broadcast signal so it is passed the best-block time, which let me remove a global variable shared between main.cpp and the wallet (nTimeBestReceived).

I also manually tested the "rebroadcast unconfirmed every half hour or so" functionality by:

1. Running bitcoind -connect=0.0.0.0:8333
2. Creating a couple of send-to-self transactions
3. Connect to a peer using -addnode
4. Waited a while, monitoring debug.log, until I see:
```2015-03-23 18:48:10 ResendWalletTransactions: rebroadcast 2 unconfirmed transactions```

One last change: don't bother putting ResendWalletTransactions messages in debug.log unless unconfirmed transactions were actually rebroadcast.
2015-03-24 15:29:20 -04: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
Gregory Maxwell 28d4cff0ed Sanitize command strings before logging them.
Normally bitcoin core does not display any network originated strings without
 sanitizing or hex encoding.  This wasn't done for strcommand in many places.

This could be used to play havoc with a terminal displaying the logs,
 especially with printtoconsole in use.

Thanks to Evil-Knievel for reporting this issue.
2015-02-08 19:58:59 +00:00
Wladimir J. van der Laan 5ebe0956b3 Trim RPC command table
- invalidateblock and reconsiderblock were defined doubly
- remove no-longer-used threadSafe, as locks have been pushed down
2015-01-28 07:41:54 +01: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 40e96a3016
Merge pull request #5599
0cc0d8d Get rid of the internal miner's hashmeter (jtimon)
2015-01-24 16:00:40 +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
jtimon 0cc0d8d60b Get rid of the internal miner's hashmeter 2015-01-04 21:04:55 +01:00
Cory Fields a3241998e1 namespace: remove boost namespace pollution 2015-01-02 15:12:03 -05:00
Cory Fields 8db1760751 rpcserver: attempt to fix uncaught exception. 2014-12-29 15:20:09 -05:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Philip Kaufmann 27df4123c4 make all catch() arguments const
- I saw this on http://en.cppreference.com/w/cpp/language/try_catch and
  thought it would be a good idea
- also unify used format to better be able to search for exception
  uses in our codebase
2014-12-17 09:39:24 +01:00
Gregory Maxwell 683dc4009b Disable SSLv3 (in favor of TLS) for the RPC client and server.
TLS is subject to downgrade attacks when SSLv3 is available, and
 SSLv3 has vulnerabilities.

The popular solution is to disable SSLv3. On the web this breaks
 some tiny number of very old clients. While Bitcoin RPC shouldn't
 be exposed to the open Internet, it also shouldn't be exposed to
 really old SSL implementations, so it shouldn't be a major issue
 for us to disable SSLv3.

There is more information on the downgrade attacks and disabling
 SSLv3 at https://disablessl3.com/ .
2014-12-06 07:08:02 -08:00
Gavin Andresen 1c7e09f0b9
Merge pull request #5369
b2d0162 Test resurrecting memory pool transactions during chain re-org (Gavin Andresen)
3dd8ed7 Delay writing block indexes in invalidate/reconsider (Pieter Wuille)
798faec Add 'invalidateblock' and 'reconsiderblock' RPC commands. (Pieter Wuille)
2014-12-02 11:59:41 -05:00
Wladimir J. van der Laan f86a24b368
Move `setmocktime` to hidden category
Another testing-only potential footgun command.
2014-11-28 10:57:14 +01:00
Pieter Wuille bd9aebf19d Introduce a hidden category 2014-11-26 16:36:26 +01:00
Pieter Wuille 9b0a8d3152 Add 'invalidateblock' and 'reconsiderblock' RPC commands.
These can be used for testing reorganizations or for manual intervention in case of
chain forks.
2014-11-26 16:36:25 +01:00
Jonas Schnelli 5dc713bfc7 [REST] set REST API behind "-rest" option 2014-11-26 13:53:27 +01:00
Jonas Schnelli 78bdc8103f [REST] give an appropriate response in warmup phase 2014-11-26 13:51:02 +01:00
Pieter Wuille 798faec3ea Add 'invalidateblock' and 'reconsiderblock' RPC commands.
These can be used for testing reorganizations or for manual intervention in case of
chain forks.
2014-11-25 12:32:51 +01:00
Glenn Willen 77c38bb5cc Truthier error message when rpcpassword is missing 2014-11-19 15:34:36 -08:00
Gavin Andresen fd3777b0b2
Merge pull request #5280
3c30f27 travis: disable rpc tests for windows until they're not so flaky (Cory Fields)
daf03e7 RPC tests: create initial chain with specific timestamps (Gavin Andresen)
a8b2ce5 regression test only setmocktime RPC call (Gavin Andresen)
2014-11-18 14:31:29 -05:00
Jeff Garzik 7715c84747
HTTP REST: minor fixes
1) const-ify internal helper ParseHashStr()

2) use HTTPError() helper when returning HTTP_NOT_FOUND
2014-11-18 10:27:45 -05:00
Gavin Andresen a8b2ce557d
regression test only setmocktime RPC call 2014-11-17 10:33:49 -05:00