aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Split up bitcoinrpc (code movement only)Wladimir J. van der Laan2013-11-271-1367/+0
| | | | | | | | | | | | | | Split bitcoinrpc up into - rpcserver: bitcoind RPC server - rpcclient: bitcoin-cli RPC client - rpcprotocol: shared common HTTP/JSON-RPC protocol code One step towards making bitcoin-cli independent from the rest of the code, and thus a smaller executable that doesn't have to be linked against leveldb. This commit only does code movement, there are no functional changes.
* setgenerate creates multiple blocks in -regtest modeGavin Andresen2013-11-221-1/+1
| | | | | | | | | | | | | | | I'm writing some wallet regression tests using -regtest mode, and need to generate an initial multi-hundred-block chain. Repeatedly calling setgenerate to generate one block is slow and doesn't work properly, because block creation happens asynchronously. This adds two features to setgenerate in -regtest mode: 1) Instead of being interpreted as number of threads to start, the third argument is the number of blocks to generate. 2) setgenerate will not return until the block creation threads have created the requested number of blocks.
* Merge pull request #3283 from gavinandresen/rpcwaitGavin Andresen2013-11-201-2/+10
|\ | | | | RPC client option: -rpcwait, to wait for server start
| * RPC client option: -rpcwait, to wait for server startGavin Andresen2013-11-201-2/+10
| |
* | core: remove includes in .cpp, if header is already in .hPhilip Kaufmann2013-11-151-2/+0
|/ | | | | - example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
* Issue #1865 - Clean up RPC help messagessje2013-11-131-3/+8
| | | | | | | | | | | | | | | | | | | Based on the proposal, update the help message of rpc methods - strings arguments are in double quotes rather than square brackets - numeric arguments have no quotes (and no default value) - optional parameters are surrounded by round brackets - json arguments are strings but don't use double quotes Added 3 sections for the details - Arguments: lists each argument, it's type, required or not, a default, and a description - Result: The method result, with json format if applicable, type, and a description - Examples: examples calls using bitcoin-cli and curl for json rpc call Problems - maybe this is too verbose - lines might be too long - description are not good or complete - examples may be too much
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-15/+12
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Break dependency of init on wallet.Pieter Wuille2013-10-261-0/+2
| | | | | | This required some code movement (what was CWalletTx::AcceptToMemoryPool doing in main?), and adding a few explicit includes that used to be implicit through init.h.
* Revert "JSON Spirit updated to v4.06"Jeff Garzik2013-10-221-2/+0
| | | | This reverts commit 2227389fa8fa1b9ff19234838fc7b641e935125b.
* Revert "Switch to using raw_utf8"Jeff Garzik2013-10-221-5/+5
| | | | This reverts commit 2ecb7555a9df1e843fd25f588819e4ca1d94b266.
* Merge pull request #2740 from constantined/constantinedGavin Andresen2013-10-221-5/+7
|\ | | | | UTF-8 support for JSON-RPC
| * Switch to using raw_utf8constantined2013-07-231-5/+5
| |
| * JSON Spirit updated to v4.06constantined2013-07-231-0/+2
| |
* | Merge pull request #3104 from Diapolo/rpcssl-defaultciphersGavin Andresen2013-10-201-1/+1
|\ \ | | | | | | update default -rpcsslciphers to include TLSv1.2
| * | update default -rpcsslciphers to include TLSv1.2Philip Kaufmann2013-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | - this extends the accepted ciphersuites with TLSv1.2 ones - also removes !AH, as I could not find documentation on it and the change did not result in a changed ciphersuite list (checked via openssl ciphers -v) - closes #3096 (which also contains more details)
* | | Merge pull request #3119Pieter Wuille2013-10-201-1/+1
|\ \ \ | |/ / |/| | | | | db0e8cc Bump Year Number to 2013 (super3)
| * | Bump Year Number to 2013super32013-10-201-1/+1
| | |
* | | Merge pull request #2924 from sje397/TrafficGraphWladimir J. van der Laan2013-10-151-0/+1
|\ \ \ | | | | | | | | [QT] Add network traffic graph to debug window
| * | | Add network traffic graphScott Ellis2013-10-141-0/+1
| | | |
* | | | Avoid core dump if rpc port is in use.Gavin Andresen2013-10-151-1/+2
|/ / / | | | | | | | | | The cleanup code needs to check for NULL rpcworkers thread group.
* / / Added ping time measurement.Josh Lehan2013-10-041-0/+1
|/ / | | | | | | | | | | | | New RPC "ping" command to request ping. Implemented "pong" message handler. New "pingtime" field in getpeerinfo, to provide results to user. New "pingwait" field, to show pings still in flight, to better see newly lagging peers.
* | Support absence of wallet (pwalletMain==NULL) in several locations,Jeff Garzik2013-10-011-72/+80
| | | | | | | | notably RPC.
* | Merge pull request #2888 from litecoin-project/getnetworkhashpsJeff Garzik2013-10-011-0/+3
|\ \ | | | | | | Add getnetworkhashps to get the estimated network hashrate
| * | Add getnetworkhashps to get the calculated network hashratecoblee2013-09-171-0/+3
| | |
* | | misc small spelling/indentation fixesPhilip Kaufmann2013-10-011-2/+2
| | |
* | | Merge pull request #2949 from gmaxwell/fewer_fee_footgunsGavin Andresen2013-09-221-0/+1
|\ \ \ | | | | | | | | [raw] reject insanely high fees by default in sendrawtransaction
| * | | [raw] reject insanely high fees by default in sendrawtransactionGregory Maxwell2013-08-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There have been several incidents where mainnet experimentation with raw transactions resulted in insane fees. This is hard to prevent in the raw transaction api because the inputs may not be known. Since sending doesn't work if the inputs aren't known, we can catch it there. This rejects fees > than 10000 * nMinRelayTxFee or 1 BTC with the defaults and can be overridden with a bool at the rpc.
* | | | Replace printf with LogPrintf / LogPrintGavin Andresen2013-09-181-5/+5
| | | |
* | | | Add RPC call decodescriptPeter Todd2013-09-121-0/+1
| | | |
* | | | Move Parse{Hash|Hex} to be usable by all RPC codePeter Todd2013-09-121-0/+28
| | | |
* | | | RPC: add getrawchangeaddress, for raw transaction change destinationsJeff Garzik2013-08-281-0/+1
|/ / /
* | | Merge pull request #2886 from gavinandresen/rpctimingGavin Andresen2013-08-151-1/+1
|\ \ \ | | | | | | | | Make RPC password resistant to timing attacks
| * | | Make RPC password resistant to timing attacksGavin Andresen2013-08-081-1/+1
| |/ / | | | | | | | | | | | | | | | | | | Fixes issue#2838; this is a tweaked version of pull#2845 that should not leak the length of the password and is more generic, in case we run into other situations where we need timing-attack-resistant comparisons.
* | | Merge pull request #2776 from jgarzik/keypoolsizeGavin Andresen2013-08-141-0/+1
|\ \ \ | |/ / |/| | RPC: keypoolrefill now permits optional size parameter, to bump keypool
| * | RPC: keypoolrefill gains optional size parameterJeff Garzik2013-06-251-0/+1
| | |
* | | Remove #define loop from util.hGavin Andresen2013-07-311-1/+1
| | | | | | | | | | | | | | | Replace the loop macro with while (true). The #define caused problems for Qt.
* | | RPC: add getbestblockhash, to return tip of best chainJeff Garzik2013-07-031-0/+1
|/ /
* | Merge pull request #2592 from sipa/dumpwalletPieter Wuille2013-06-231-0/+2
|\ \ | | | | | | Add dumpwallet and importwallet RPC commands
| * | Add dumpwallet and importwallet RPCsPieter Wuille2013-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | | dumpwallet: produce a dump of all keys in a wallet, in a format compatible with Bitcoin Wallet for Android and Multibit. importwallet: import such a dump
* | | Merge pull request #2778 from jgarzik/rpc-verifydbJeff Garzik2013-06-221-0/+3
|\ \ \ | |/ / |/| | RPC: add 'verifychain' to verify chain database at runtime
| * | RPC: add 'verifychain', to verify chain database at runtimeJeff Garzik2013-06-191-0/+3
| | |
* | | Introduce a CChainParameters singleton class and regtest mode.Mike Hearn2013-06-191-9/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | The new class is accessed via the Params() method and holds most things that vary between main, test and regtest networks. The regtest mode has two purposes, one is to run the bitcoind/bitcoinj comparison tool which compares two separate implementations of the Bitcoin protocol looking for divergence. The other is that when run, you get a local node which can mine a single block instantly, which is highly convenient for testing apps during development as there's no need to wait 10 minutes for a block on the testnet.
* | Merge pull request #2747 from luke-jr/getblock_verbose0Jeff Garzik2013-06-101-0/+1
|\ \ | |/ |/| Add verbose flag to getblock RPC so it is possible to get hex dumps of blocks
| * RPC: getblock(): Accept 2nd "verbose" parameter, similar to ↵Luke Dashjr2013-06-071-0/+1
| | | | | | | | getrawtransaction, but defaulting to 1 for backward compatibility
* | remove GetBoolArg() fDefault parameter defaulting to falsePhilip Kaufmann2013-06-011-3/+3
| | | | | | | | | | | | | | | | - explicitly set the default of all GetBoolArg() calls - rework getarg_test.cpp and util_tests.cpp to cover this change - some indentation fixes - move macdockiconhandler.h include in bitcoin.cpp to the "our headers" section
* | Merge pull request #2716 from laanwj/2013_05_30_getworkJeff Garzik2013-05-301-9/+0
|\ \ | | | | | | Move pMiningKey init out of StartRPCThreads
| * | Move pMiningKey init out of StartRPCThreadsWladimir J. van der Laan2013-05-301-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit decouples the pMiningKey initialization and shutdown from the RPC threads. `getwork` and `getblocktemplate` rely on pMiningKey, and can also be ran from the debug window in the UI even when the RPC server is not running. Solves issue #2706.
* | | Merge pull request #2625 from gavinandresen/walletlock_asioJeff Garzik2013-05-301-3/+25
|\ \ \ | |/ / |/| | Use boost::asio::deadline_timer for walletpassphrase timeout
| * | Use boost::asio::deadline_timer for walletpassphrase timeoutGavin Andresen2013-05-071-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New method in bitcoinrpc: RunLater, that uses a map of deadline timers to run a function later. Behavior of walletpassphrase is changed; before, calling walletpassphrase again before the lock timeout passed would result in: Error: Wallet is already unlocked. You would have to call lockwallet before walletpassphrase. Now: the last walletpassphrase with correct password wins, and overrides any previous timeout. Fixes issue# 1961 which was caused by spawning too many threads. Test plan: Start with encrypted wallet, password 'foo' NOTE: python -c 'import time; print("%d"%time.time())' ... will tell you current unix timestamp. Try: walletpassphrase foo 600 getinfo EXPECT: unlocked_until is about 10 minutes in the future walletpassphrase foo 1 sleep 2 sendtoaddress mun74Bvba3B1PF2YkrF4NsgcJwHXXh12LF 11 EXPECT: Error: Please enter the wallet passphrase with walletpassphrase first. walletpassphrase foo 600 walletpassphrase foo 0 getinfo EXPECT: wallet is locked (unlocked_until is 0) walletpassphrase foo 10 walletpassphrase foo 600 getinfo EXPECT: wallet is unlocked until 10 minutes in future walletpassphrase foo 60 walletpassphrase bar 600 EXPECT: Error, incorrect passphrase getinfo EXPECT: wallet still scheduled to lock 60 seconds from first (successful) walletpassphrase
* | | Clean up mining CReserveKey to prevent crash at shutdownGavin Andresen2013-05-231-0/+9
|/ / | | | | | | Fixes issue#2687