aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | RPC: strictly require HTTP URI "/"Jeff Garzik2013-05-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, JSON-RPC clients accessed URI "/", and the JSON-RPC server did not care about the URI at all, and would accept any URI as valid. Change the JSON-RPC server to require URI "/" for all current accesses. This changes enables the addition of future interfaces at different URIs, such as pull request #1982 which demonstrates HTTP REST wallet download. Or, a future, breaking change in JSON-RPC interface could be introduced by serving JSON-RPC calls from new URI "/v2/".
* | Clean up shutdown processGavin Andresen2013-04-031-4/+8
| |
* | Port Thread* methods to boost::thread_groupGavin Andresen2013-04-031-96/+40
| |
* | Rename util.h Sleep --> MilliSleepGavin Andresen2013-04-031-1/+1
| | | | | | | | | | | | | | | | Two reasons for this change: 1. Need to always use boost::thread's sleep, even on Windows, so the sleeps can be interrupted (prior code used Windows' built-in Sleep). 2. I always forgot what units the old Sleep took.
* | translation base files update 2013-04-02Philip Kaufmann2013-04-021-1/+2
| | | | | | | | | | - also includes a small change to a string in bitcoinrpc.cpp, which is not on Transifex anyway, so is safe to merge
* | Recommend alertnotifyGavin Andresen2013-03-211-1/+3
| |
* | CRPCCommand.unlocked -> CRPCCommand.threadSafefreewil2013-03-071-3/+3
| | | | | | | | unlocked could be confused with wallet encryption
* | make vRPCCommands comment match property namesfreewil2013-03-071-64/+64
| |
* | Enable dumpprivkey in safe modeAndrew Poelstra2013-02-141-1/+1
| |
* | Add a getaddednodeinfo RPC.Matt Corallo2013-01-271-0/+2
| |
* | Add addnode RPC command.Matt Corallo2013-01-271-0/+1
| |
* | make bitcoinrpc.cpp UTF-8 conformant againPhilip Kaufmann2013-01-201-1/+1
| | | | | | | | | | - just replaces a character in a comment, which I had problems with when opening the file in Qt Creator IDE
* | Convert fRescan argument to importprivkey to boolPieter Wuille2012-12-191-0/+1
| |
* | Merge pull request #1861 from jgarzik/coinlockGavin Andresen2012-12-121-0/+4
|\ \ | | | | | | Add new RPC "lockunspent", to prevent spending of selected outputs
| * | Add new RPC "lockunspent", to prevent spending of selected outputsJeff Garzik2012-11-151-0/+4
| | | | | | | | | | | | | | | | | | and associated RPC "listlockunspent". This is a memory-only filter, which is empty when a node restarts.
* | | update CClientUIInterface and remove orphan Wx stuffPhilip Kaufmann2012-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - fix ThreadSafeMessageBox always displays error icon - allow to specify MSG_ERROR / MSG_WARNING or MSG_INFORMATION without a custom caption / title - allow to specify CClientUIInterface::ICON_ERROR / ICON_WARNING and ICON_INFORMATION (which is default) as message box icon - remove CClientUIInterface::OK from ThreadSafeMessageBox-calls, as the OK button will be set as default, if none is specified - prepend "Bitcoin - " to used captions - rename BitcoinGUI::error() -> BitcoinGUI::message() and add function documentation - change all style parameters and enum flags to unsigned - update code to use that new API - update Client- and WalletModel to use new BitcoinGUI::message() and rename the classes error() method into message() - include the possibility to supply the wanted icon for messages from Client- and WalletModel via "style" parameter
* | | RPC: Forbid RPC username == RPC passwordJeff Garzik2012-11-151-1/+3
|/ / | | | | | | Added security measure.
* | Merge pull request #1977 from Diapolo/rem_printf_redef_rpcWladimir J. van der Laan2012-11-101-3/+0
|\ \ | | | | | | remove printf redefinition from bitcoinrpc.cpp
| * | remove printf redefinition from bitcoinrpc.cppPhilip Kaufmann2012-11-041-3/+0
| | | | | | | | | | | | | | | - as the redefiniton of printf happens in util.h, which is included in bitcoinrpc.cpp, we don't need another redefinition
* | | Merge branch 'http-improvements'Jeff Garzik2012-11-091-12/+57
|\ \ \ | | | | | | | | | | | | The base bits of pull req #1982.
| * | | RPC: HTTP server uses its own ReadHTTPRequestLine()Jeff Garzik2012-11-041-4/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rather than reusing ReadHTTPStatus() from the client mode. The following additional HTTP request validations are added, both in line with existing HTTP client practice: 1) HTTP method must be GET or POST. Most clients use POST, some use GET. Either way, this continues to work. 2) HTTP URI must start with "/" character. Normal URI is "/" (a 1-char string), so this is fine.
| * | | RPC, cosmetic: push down ReadHTTPStatus() calls into ReadHTTP() callersJeff Garzik2012-11-041-11/+19
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ReadHTTPStatus() is currently overloaded: In client mode, it properly parses and receives an HTTP status line. In server mode, it incorrectly parses the HTTP request line as an HTTP status line. This server mode bug has never mattered, because the RPC server never cared about the URI (path) provided in the HTTP request. That will change in the future, so go ahead and begin fixing the problem. This patch is cosmetic, and should result in NO behavior changes. Further renames: ReadHTTPHeader -> ReadHTTPHeaders ReadHTTP -> ReadHTTPMessage
* / / Remove -detachdb and stop's detach argument.Pieter Wuille2012-11-041-5/+3
|/ / | | | | | | | | | | | | | | As the only BDB database left is the wallet, and it is always detached. Also remove IsChainFile() predicate and related chainfile-specific logic.
* | New createmultisig rpc commandGavin Andresen2012-10-291-0/+3
| | | | | | | | | | | | This is to support the signrawtransaction API call; given the public keys involved in a multisig transaction, this gives back the redeemScript needed to sign it.
* | Add gettxout and gettxoutsetinfo RPCsPieter Wuille2012-10-201-0/+4
| |
* | fix wrong (signed/unsigned) printf format specifier in bitcoinrpc.cppPhilip Kaufmann2012-10-051-1/+1
|/ | | | - also includes the required bitcoinstrings.cpp update
* Add constants for HTTP status codesWladimir J. van der Laan2012-10-041-17/+17
|
* Document RPC error codesWladimir J. van der Laan2012-10-041-18/+18
| | | | Replace all "magic values" in RPCError(...) by constants.
* fix -Wformat warnings all over the sourcePhilip Kaufmann2012-10-011-1/+1
|
* Remove stack randomizationPieter Wuille2012-09-281-4/+0
|
* Merge pull request #1862 from kjj2/testportsPieter Wuille2012-09-281-2/+7
|\ | | | | Fix: when testnet=1 specified, change default RPC port to 18332
| * Fix: when testnet=1 specified, change default ports to 18332 and 18333kjj22012-09-241-2/+7
| |
* | Merge pull request #1836 from kjj2/stopdetachWladimir J. van der Laan2012-09-231-3/+8
|\ \ | | | | | | Adds a stopdetach <detach> RPC command. <detach> defaults to true. Wor...
| * | Adds a stopdetach <detach> RPC command. <detach> defaults to true. Works ↵kjj22012-09-221-3/+8
| |/ | | | | | | | | | | | | just like stop, but overrides the commandline/config file -detachdb option. Useful for upgrading, for example. Lets you use fast stops usually, but force a detach when needed. Also, allows you to do a fast stop in a system normally configured for fast stops.
* | Merge pull request #1793 from Diapolo/fix_signed_unsigned_strprintfWladimir J. van der Laan2012-09-211-1/+1
|\ \ | |/ |/| fix signed/unsigned in strprintf and CNetAddr::GetByte()