aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.cpp
AgeCommit message (Collapse)Author
2013-06-19Introduce a CChainParameters singleton class and regtest mode.Mike Hearn
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.
2013-06-10Merge pull request #2747 from luke-jr/getblock_verbose0Jeff Garzik
Add verbose flag to getblock RPC so it is possible to get hex dumps of blocks
2013-06-07RPC: getblock(): Accept 2nd "verbose" parameter, similar to ↵Luke Dashjr
getrawtransaction, but defaulting to 1 for backward compatibility
2013-06-01remove GetBoolArg() fDefault parameter defaulting to falsePhilip Kaufmann
- 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
2013-05-30Merge pull request #2716 from laanwj/2013_05_30_getworkJeff Garzik
Move pMiningKey init out of StartRPCThreads
2013-05-30Merge pull request #2625 from gavinandresen/walletlock_asioJeff Garzik
Use boost::asio::deadline_timer for walletpassphrase timeout
2013-05-30Move pMiningKey init out of StartRPCThreadsWladimir J. van der Laan
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.
2013-05-23Clean up mining CReserveKey to prevent crash at shutdownGavin Andresen
Fixes issue#2687
2013-05-07Use boost::asio::deadline_timer for walletpassphrase timeoutGavin Andresen
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
2013-05-01RPC: strictly require HTTP URI "/"Jeff Garzik
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/".
2013-04-03Clean up shutdown processGavin Andresen
2013-04-03Port Thread* methods to boost::thread_groupGavin Andresen
2013-04-03Rename util.h Sleep --> MilliSleepGavin Andresen
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.
2013-04-02translation base files update 2013-04-02Philip Kaufmann
- also includes a small change to a string in bitcoinrpc.cpp, which is not on Transifex anyway, so is safe to merge
2013-03-21Recommend alertnotifyGavin Andresen
2013-03-07CRPCCommand.unlocked -> CRPCCommand.threadSafefreewil
unlocked could be confused with wallet encryption
2013-03-07make vRPCCommands comment match property namesfreewil
2013-02-14Enable dumpprivkey in safe modeAndrew Poelstra
2013-01-27Add a getaddednodeinfo RPC.Matt Corallo
2013-01-27Add addnode RPC command.Matt Corallo
2013-01-20make bitcoinrpc.cpp UTF-8 conformant againPhilip Kaufmann
- just replaces a character in a comment, which I had problems with when opening the file in Qt Creator IDE
2012-12-19Convert fRescan argument to importprivkey to boolPieter Wuille
2012-12-12Merge pull request #1861 from jgarzik/coinlockGavin Andresen
Add new RPC "lockunspent", to prevent spending of selected outputs
2012-11-26update CClientUIInterface and remove orphan Wx stuffPhilip Kaufmann
- 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
2012-11-15Add new RPC "lockunspent", to prevent spending of selected outputsJeff Garzik
and associated RPC "listlockunspent". This is a memory-only filter, which is empty when a node restarts.
2012-11-15RPC: Forbid RPC username == RPC passwordJeff Garzik
Added security measure.
2012-11-10Merge pull request #1977 from Diapolo/rem_printf_redef_rpcWladimir J. van der Laan
remove printf redefinition from bitcoinrpc.cpp
2012-11-09Merge branch 'http-improvements'Jeff Garzik
The base bits of pull req #1982.
2012-11-04RPC: HTTP server uses its own ReadHTTPRequestLine()Jeff Garzik
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.
2012-11-04RPC, cosmetic: push down ReadHTTPStatus() calls into ReadHTTP() callersJeff Garzik
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
2012-11-04Remove -detachdb and stop's detach argument.Pieter Wuille
As the only BDB database left is the wallet, and it is always detached. Also remove IsChainFile() predicate and related chainfile-specific logic.
2012-11-04remove printf redefinition from bitcoinrpc.cppPhilip Kaufmann
- as the redefiniton of printf happens in util.h, which is included in bitcoinrpc.cpp, we don't need another redefinition
2012-10-29New createmultisig rpc commandGavin Andresen
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.
2012-10-20Add gettxout and gettxoutsetinfo RPCsPieter Wuille
2012-10-05fix wrong (signed/unsigned) printf format specifier in bitcoinrpc.cppPhilip Kaufmann
- also includes the required bitcoinstrings.cpp update
2012-10-04Add constants for HTTP status codesWladimir J. van der Laan
2012-10-04Document RPC error codesWladimir J. van der Laan
Replace all "magic values" in RPCError(...) by constants.
2012-10-01fix -Wformat warnings all over the sourcePhilip Kaufmann
2012-09-28Remove stack randomizationPieter Wuille
2012-09-28Merge pull request #1862 from kjj2/testportsPieter Wuille
Fix: when testnet=1 specified, change default RPC port to 18332
2012-09-24Fix: when testnet=1 specified, change default ports to 18332 and 18333kjj2
2012-09-23Merge pull request #1836 from kjj2/stopdetachWladimir J. van der Laan
Adds a stopdetach <detach> RPC command. <detach> defaults to true. Wor...
2012-09-22Adds a stopdetach <detach> RPC command. <detach> defaults to true. Works ↵kjj2
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.
2012-09-21Merge pull request #1793 from Diapolo/fix_signed_unsigned_strprintfWladimir J. van der Laan
fix signed/unsigned in strprintf and CNetAddr::GetByte()
2012-09-18Trim trailing whitespace for src/*.{h,cpp}Jeff Garzik
2012-09-12fix signed/unsigned in strprintf and CNetAddr::GetByte()Philip Kaufmann
- I checked every occurance of strprintf() in the code and used %u, where unsigned vars are used - the change to GetByte() was made, as ip is an unsigned char
2012-09-12Do not abort if RPC listening for IPv6 failsPieter Wuille
Instead, fall back to IPv4 listening.
2012-08-29Rename CreateThread to NewThreadWladimir J. van der Laan
Prevent clash with win32 API symbol
2012-08-24Merge pull request #1672 from gmaxwell/filter_listunspentGregory Maxwell
Listunspent txout address filtering and listaddressgroupings
2012-08-24Avoid leaving return types or function attributes on their own lines.Gregory Maxwell