aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/server.h
AgeCommit message (Collapse)Author
2021-01-29Remove pointer cast in CRPCTable::dumpArgMapRussell Yanofsky
CRPCTable::dumpArgMap currently works by casting RPC command unique_id integer field to a function pointer, and then calling the function. The unique_id field wasn't supposed to be used this way (it's meant to be used to detect RPC aliases), and this code segfaults in the rpc_help.py test in multiprocess PR https://github.com/bitcoin/bitcoin/pull/10102 because wallet RPC functions aren't directly accessible from the node process. Fix this by adding a new GET_ARGS request mode to retrieve argument information similar to the way the GET_HELP mode retrieves help information.
2021-01-28rpc: Remove duplicate name and argNames from CRPCCommandMarcoFalke
2021-01-28rpc: Use RPCHelpMan for check-rpc-mappings linterMarcoFalke
2020-12-31scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-09-24remove CRPCCommand constructor that takes rpcfn_type function pointerMarcoFalke
2020-08-14rpc: Remove unused return type from appendCommandMarcoFalke
2020-07-03rpc: Assert that passed arg names are equal to hardcoded onesMarcoFalke
2020-06-30rpc: Add CRPCCommand constructor which takes RPCHelpManMarcoFalke
This allows the constructor to ask the rpc manager for the name of the rpc method or the rpc argument names instead of having it manually passed in.
2020-05-22rpc: factor out RpcInterruptionPoint from dumptxoutsetMarcoFalke
2019-12-30scripted-diff: Bump copyright of files changed in 2019MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2019-10-15Remove unused includespracticalswift
2019-07-05rpc: migrate JSONRPCRequest functionality into request.cppKarl-Johan Alm
2019-04-09[build] Move rpc utility methods to rpc/utilJohn Newbery
Moves the following utility methods to rpc/util and moves that unit to libbitcoin_common so they can be accessed by all libraries. - `RPCTypeCheck` - `RPCTypeCheckArgument` - `RPCTypeCheckObj` - `AmountFromValue` - `ParseHashV``ParseHashO` - `ParseHexV` - `ParseHexO` - `HelpExampleCli` - `HelpExampleRpc`
2019-03-05Remove use of CRPCTable::appendCommand in wallet codeRussell Yanofsky
This commit does not change behavior.
2018-09-13convert C-style (void) parameter lists to C++ style ()Arvid Norberg
2018-08-08Merge #13780: 0.17: Pre-branch maintenanceWladimir J. van der Laan
3fc20632a3ad30809356a58d2cf0ea4a4ad4cec3 qt: Set BLOCK_CHAIN_SIZE = 220 (DrahtBot) 2b6a2f4a28792f2fe9dc1be843b1ff1ecae35e8a Regenerate manpages (DrahtBot) eb7daf4d600eeb631427c018a984a77a34aca66e Update copyright headers to 2018 (DrahtBot) Pull request description: Some trivial maintenance to avoid having to do it again after the 0.17 branch off. (The scripts to do this are in `./contrib/`) Tree-SHA512: 16b2af45e0351b1c691c5311d48025dc6828079e98c2aa2e600dc5910ee8aa01858ca6c356538150dc46fe14c8819ed8ec8e4ec9a0f682b9950dd41bc50518fa
2018-07-27Return void instead of bool for functions that cannot failpracticalswift
* CBlockTreeDB::ReadReindexing(...) * CChainState::ResetBlockFailureFlags(...) * CTxMemPool::addUnchecked(...) * CWallet::LoadDestData(...) * CWallet::LoadKeyMetadata(...) * CWallet::LoadScriptMetadata(...) * CWallet::LoadToWallet(...) * CWallet::SetHDChain(...) * CWallet::SetHDSeed(...) * RemoveLocal(...) * SetMinVersion(...) * StartHTTPServer(...) * StartRPC(...) * TorControlConnection::Disconnect(...)
2018-07-27Update copyright headers to 2018DrahtBot
2018-04-01Merge #12757: Clarify include guard naming conventionMarcoFalke
3bcc0059b8 Add lint-include-guards.sh which checks include guard consistency (practicalswift) 8fd6af89a0 Fix missing or inconsistent include guards (practicalswift) 8af65d96f4 Document include guard convention (practicalswift) Pull request description: * **Documentation**: Document include guard convention * **Fix**: Fix missing or inconsistent include guards * **Regression test**: Add `lint-include-guards.sh` which checks include guard consistency Tree-SHA512: 8171878f60fd08ccbea943a11e835195750592abb9d7ab74eaa4265ae7fac523b1da9d31ca13d6ab73dd596e49986bfb7593c696e5f39567c93e610165bc2acc
2018-03-25Add username and ip logging for RPC method requestsGabriel Davidian
2018-03-22Fix missing or inconsistent include guardspracticalswift
2018-03-15Document RPC method aliasingRussell Yanofsky
Suggested by Sjors Provoost <sjors@sprovoost.nl> in https://github.com/bitcoin/bitcoin/pull/11536#issuecomment-372820660
2018-03-07[rpc] createrawtransaction: Accept sorted outputsMarcoFalke
2018-02-22rpc: Allow typeAny in RPCTypeCheckMarcoFalke
2018-01-03Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa
2017-11-16scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider
-BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
2017-10-03Fix uninitialized URI in batch RPC requestsRussell Yanofsky
This fixes "Wallet file not specified" errors when making batch wallet RPC calls with more than one wallet loaded. This issue was reported by NicolasDorier <nicolas.dorier@gmail.com> https://github.com/bitcoin/bitcoin/issues/11257 Request URI is not used for anything except multiwallet request dispatching, so this change has no other effects. Fixes #11257
2017-09-26[rpc] Deprecate estimatefee RPCJohn Newbery
Deprecate estimatefee in v0.16, for final removal in v0.17. This commit introduces a phased removal of RPC methods. RPC method is disabled by default in version x, but can be enabled by using the `-deprecatedrpc=<method>` argument. RPC method is removed entirely in version (x+1).
2017-08-29rpc: Push down safe mode checksAndrew Chow
This contains most of the changes of 10563 "remove safe mode", but doesn't remove the safe mode yet, but put an `ObserveSafeMode()` check in individual calls with okSafeMode=false. This cleans up the ugly "okSafeMode" flag from the dispatch tables, which is not a concern for the RPC server. Extra-author: Wladimir J. van der Laan <laanwj@gmail.com>
2017-08-16Declare single-argument (non-converting) constructors "explicit"practicalswift
In order to avoid unintended implicit conversions.
2017-08-07rpc: Move ValueFromAmount to core_writeWladimir J. van der Laan
This is necessary because core_write has to write amounts in TxToUniv, and mistakingly uses FormatMoney for that (which is only for debugging). We don't move AmountFromValue at the same time, as this is more challenging due to the RPCError depencency there.
2017-06-12Remove unnecessary forward class declarations in header filespracticalswift
2017-06-04Perform member initialization in initialization lists where possiblepracticalswift
2017-05-13Replace boost::function with std::function (C++11)practicalswift
2017-03-27refactor: Move RPCNotifyBlockChange out of `rpc/server.h`Wladimir J. van der Laan
2017-03-27refactor: Move GetDifficulty out of `rpc/server.h`Wladimir J. van der Laan
It has no business in `rpcserver.h`. Define it in the interface header of the implementation unit `rpcblockchain` where it is defined. Also modernize the signature to: double GetDifficulty(const CBlockIndex* blockindex = nullptr); (remove `extern`, replace `NULL` with `nullptr`)
2017-03-19Fix parameter naming inconsistencies between .h and .cpp filespracticalswift
Inconsistencies prior to this commit: * serializeFlags vs serialFlags src/core_io.h:std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0); src/core_write.cpp:std::string EncodeHexTx(const CTransaction& tx, const int serialFlags) * statusOut vs outStatus src/rpc/server.h:bool RPCIsInWarmup(std::string *statusOut); src/rpc/server.cpp:bool RPCIsInWarmup(std::string *outStatus) * hashesToUpdate vs vHashesToUpdate src/txmempool.h: void UpdateTransactionsFromBlock(const std::vector<uint256> &hashesToUpdate); src/txmempool.cpp:void CTxMemPool::UpdateTransactionsFromBlock(const std::vector<uint256> &vHashesToUpdate) * nPruneUpToHeight vs nManualPruneHeight src/validation.h:void PruneBlockFilesManual(int nPruneUpToHeight); src/validation.cpp:void PruneBlockFilesManual(int nManualPruneHeight);
2017-03-17Remove unused codepracticalswift
2017-02-27Move wallet RPC declarations to rpcwallet.hLuke Dashjr
2017-02-27RPC: Pass on JSONRPCRequest metadata (URI/user/etc) for "help" methodLuke Dashjr
2017-02-27Move nWalletUnlockTime to CWallet::nRelockTime, and name timed task unique ↵Luke Dashjr
per CWallet
2017-02-27RPC: Do all wallet access through new GetWalletForJSONRPCRequestLuke Dashjr
2017-02-27RPC/Wallet: Pass CWallet as pointer to helper functionsLuke Dashjr
2017-01-19[wallet] Add include_unsafe argument to listunspent RPCRussell Yanofsky
2017-01-05rpc: Support named argumentsWladimir J. van der Laan
The [JSON-RPC specification](http://www.jsonrpc.org/specification) allows passing parameters as an Array, for by-position arguments, or an Object, for by-name arguments. This implements by-name arguments, but preserves full backwards compatibility. API using by-name arguments are easier to extend, and easier to use (no need to guess which argument goes where). Named are mapped to positions by a per-call structure, provided through the RPC command table. Missing arguments will be replaced by null, except if at the end, then the argument is left out completely. Currently calls fail (though not crash) on intermediate nulls, but this should be improved on a per-call basis later.
2016-12-31Increment MIT Licence copyright header year on files modified in 2016isle2983
Edited via: $ contrib/devtools/copyright_header.py update .
2016-12-05Add option to return non-segwit serialization via rpcGregory Sanders
2016-10-19[RPC] pass HTTP basic authentication username to the JSONRequest objectJonas Schnelli
2016-10-19[RPC] Give RPC commands more information about the RPC requestJonas Schnelli
2016-09-07add waitfornewblock/waitforblock/waitforblockheight rpcs and use them for testsCory Fields
waitfornewblock waits until a new block is received, or the timeout expires, then returns the current block height/hash. waitforblock waits for a specific blockhash, or until the timeout expires, then returns the current block height/hash. If the target blockhash is the current tip, it will return immediately. waitforblockheight waits until the tip has reached a certain height or higher, then returns the current height and hash. waitforblockheight is used to avoid polling in the rpc tests.