aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Modify chain consensus parameters to be height aware (#1396)Ross Nicoll2018-09-191-3/+3
| | | | | | | | | * Modify chain consensus parameters to be height aware * Correct implementation of simplified rewards in parameters * Correct max money * Use base block version in IsSuperMajority() instead of full version * Correct mining of blocks in AuxPoW tests * Add in missing pre-AuxPoW consensus checks
* Merge AuxPoW support from NamecoreRoss Nicoll2018-09-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes are as below: Wrap CBlockHeader::nVersion into a new class (CBlockVersion). This allows to take care of interpreting the field into a base version, auxpow flag and the chain ID. Update getauxblock.py for new 'generate' RPC call. Add 'auxpow' to block JSON. Accept auxpow as PoW verification. Add unit tests for auxpow verification. Add check for memory-layout of CBlockVersion. Weaken auxpow chain ID checks for the testnet. Allow Params() to overrule when to check the auxpow chain ID and for legacy blocks. Use this to disable the checks on testnet. Introduce CPureBlockHeader. Split the block header part that is used by auxpow and the "real" block header (that uses auxpow) to resolve the cyclic dependency between the two. Differentiate between uint256 and arith_uint256. This change was done upstream, modify the auxpow code. Add missing lock in auxpow_tests. Fix REST header check for auxpow headers. Those can be longer, thus take that into account. Also perform the check actually on an auxpow header. Correctly set the coinbase for getauxblock results. Call IncrementExtraNonce in getauxblock so that the coinbase is actually initialised with the stuff it should be. (BIP30 block height and COINBASE_FLAGS.) Implement getauxblock plus regression test. Turn auxpow test into FIXTURE test. This allows using of the Params() calls. Move CMerkleTx code to auxpow.cpp. Otherwise we get linker errors when building without wallet. Fix rebase with BIP66. Update the code to handle BIP66's nVersion=3. Enforce that auxpow parent blocks have no auxpow block version. This is for compatibility with namecoind. See also https://github.com/namecoin/namecoin/pull/199. Move auxpow-related parameters to Consensus::Params.
* Refactor: Remove using namespace <xxx> from src/*.cpp.Karl-Johan Alm2017-01-271-27/+25
|
* Avoid boost dynamic_bitset in rest_getutxosPieter Wuille2017-01-121-5/+7
|
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Adapt ZMQ/rest serialization to take rpcserialversion arginstagibbs2016-12-051-2/+2
|
* Switch GetTransaction to returning a CTransactionRefPieter Wuille2016-12-021-2/+2
|
* Rename the remaining main.{h,cpp} to validation.{h,cpp}Matt Corallo2016-12-021-1/+1
|
* Get rid of nType and nVersionPieter Wuille2016-11-071-1/+1
| | | | | | | | | | | Remove the nType and nVersion as parameters to all serialization methods and functions. There is only one place where it's read and has an impact (in CAddress), and even there it does not impact any of the recursively invoked serializers. Instead, the few places that need nType or nVersion are changed to read it directly from the stream object, through GetType() and GetVersion() methods which are added to all stream classes.
* [RPC] pass HTTP basic authentication username to the JSONRequest objectJonas Schnelli2016-10-191-0/+1
|
* [RPC] Give RPC commands more information about the RPC requestJonas Schnelli2016-10-191-3/+3
|
* rest.cpp: change HTTP_INTERNAL_SERVER_ERROR to HTTP_BAD_REQUESTdjpnewton2016-09-011-7/+7
|
* rpc: Register calls where they are definedWladimir J. van der Laan2016-03-311-0/+3
| | | | | | | | | | | | Split out methods to every module, apart from 'help' and 'stop' which are implemented in rpcserver.cpp itself. - This makes it easier to add or remove RPC commands - no longer everything that includes rpcserver.h has to be rebuilt when there's a change there. - Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions. - Removes most of the bitcoin-specific code from rpcserver.cpp and .h. Continues #7307 for the non-wallet.
* move rpc* to rpc/Daniel Cousens2016-01-211-1/+1
|
* Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|
* Fix various typospaveljanik2015-12-021-1/+1
|
* Globals: Explicit Consensus::Params arg for main:Jorge Timón2015-10-301-2/+3
| | | | | | | | | -CheckBlockIndex -DisconnectTip -GetTransaction -InvalidateBlock -ProcessGetData -ReadBlockFromDisk
* [Univalue] add univalue over subtreeJonas Schnelli2015-10-011-1/+1
| | | | similar to secp256k1 include and compile univalue over a subtree
* Simplify logic of REST request suffix parsing.Daniel Kraft2015-09-071-25/+32
| | | | | | | | | | This patch changes the way the suffix (giving the requested data format) is parsed for REST requests. Before, the string was split at '.' characters and it was assumed that the second part was the suffix. Now, we look for the last dot and use that to determine the suffix. This allows for strings that contain dots (not used now, though), and seems, in general, to be clearer and more intuitive.
* evhttpd implementationWladimir J. van der Laan2015-09-031-132/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - *Replace usage of boost::asio with [libevent2](http://libevent.org/)*. boost::asio is not part of C++11, so unlike other boost there is no forwards-compatibility reason to stick with it. Together with #4738 (convert json_spirit to UniValue), this rids Bitcoin Core of the worst offenders with regard to compile-time slowness. - *Replace spit-and-duct-tape http server with evhttp*. Front-end http handling is handled by libevent, a work queue (with configurable depth and parallelism) is used to handle application requests. - *Wrap HTTP request in C++ class*; this makes the application code mostly HTTP-server-neutral - *Refactor RPC to move all http-specific code to a separate file*. Theoreticaly this can allow building without HTTP server but with another RPC backend, e.g. Qt's debug console (currently not implemented) or future RPC mechanisms people may want to use. - *HTTP dispatch mechanism*; services (e.g., RPC, REST) register which URL paths they want to handle. By using a proven, high-performance asynchronous networking library (also used by Tor) and HTTP server, problems such as #5674, #5655, #344 should be avoided. What works? bitcoind, bitcoin-cli, bitcoin-qt. Unit tests and RPC/REST tests pass. The aim for now is everything but SSL support. Configuration options: - `-rpcthreads`: repurposed as "number of work handler threads". Still defaults to 4. - `-rpcworkqueue`: maximum depth of work queue. When this is reached, new requests will return a 500 Internal Error. - `-rpctimeout`: inactivity time, in seconds, after which to disconnect a client. - `-debug=http`: low-level http activity logging
* Implement REST mempool API, add test and documentation.Pavel Janík2015-08-141-0/+56
|
* TRIVIAL: Missing includesJorge Timón2015-07-231-0/+1
|
* [REST] add JSON support for /rest/headers/Jonas Schnelli2015-07-051-4/+15
|
* Merge pull request #6133Wladimir J. van der Laan2015-07-021-1/+1
|\ | | | | | | e617fe2 Fix various warnings (Luke Dashjr)
| * Fix various warningsLuke Dashjr2015-06-231-1/+1
| | | | | | | | Found while building on Debian 7
* | Remove JSON Spirit wrapper, remove JSON Spirit leftoversJonas Schnelli2015-06-041-3/+4
| | | | | | | | | | | | - implement find_value() function for UniValue - replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper - remove JSON Spirit sources
* | remove JSON Spirit UniValue wrapperJonas Schnelli2015-06-041-3/+3
| |
* | expicit set UniValue type to avoid empty valuesJonas Schnelli2015-06-041-6/+6
| |
* | extend conversion to UniValueJonas Schnelli2015-06-041-5/+4
|/
* [REST] remove json input for getutxos, limit to query max. 15 outpointsJonas Schnelli2015-05-271-34/+50
| | | | | | Remove possibility to send json encoded parameters to `/rest/getutxos/` to avoid possible DoS scenarios. The JSON output option is untouched.
* rest.cpp: strip whitespaceJonas Schnelli2015-05-271-5/+5
|
* Merge pull request #6058Wladimir J. van der Laan2015-05-111-0/+3
|\ | | | | | | | | 03c5687 appropriate response when trying to get a block in pruned mode (Jonas Schnelli) 1b2e555 add autoprune information to RPC "getblockchaininfo" (Jonas Schnelli)
| * appropriate response when trying to get a block in pruned modeJonas Schnelli2015-05-111-0/+3
| |
* | [REST] getutxos REST command (based on Bip64)Jonas Schnelli2015-04-211-17/+227
|/ | | | | | | | 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
* Merge #5548: [REST] add /rest/chaininfosWladimir J. van der Laan2015-02-101-3/+30
|\ | | | | | | | | 2c0f901 [REST] rest/chaininfos add documentation (Jonas Schnelli) 59582c8 [REST] add /rest/chaininfos (Jonas Schnelli)
| * [REST] add /rest/chaininfosJonas Schnelli2014-12-291-3/+30
| |
* | Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan2015-01-051-1/+1
|/ | | | | | Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
* Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* Make pass-by-ref arguments const.Daniel Kraft2014-12-161-15/+15
| | | | | Make some of the arguments in rest.cpp, that are passed by reference but never modified, const to emphasise that.
* Add /rest/headersPieter Wuille2014-12-121-0/+64
|
* [REST] /rest/block response with full tx detailsJonas Schnelli2014-12-091-4/+22
| | | | | - rest block request returns full unfolded tx details - /rest/block/notxdetails/<HASH> returns block where transactions are only represented by its hash
* MOVEONLY: core/ -> primitives/Luke Dashjr2014-12-031-2/+2
|
* [REST] make selection of output-format mandatory, support dot url syntaxJonas Schnelli2014-11-271-32/+57
| | | | | | 1. Remove the default format (binary) because `rest/block/<hash>/Hex` would end up delivering binary data. 2. List available formats when chosen format was not found (reduces need for documentation) 3. Change url syntax to dot extension like format chosing (like `rest/tx/<hash>.json`
* [REST] give an appropriate response in warmup phaseJonas Schnelli2014-11-261-0/+4
|
* [REST] fix headersonly flag for BINARY responsesJonas Schnelli2014-11-261-2/+2
|
* minor style cleanup after HTTP rest interface mergePhilip Kaufmann2014-11-201-9/+9
| | | | - no code changes
* Properly lock cs_main in rest_blockPieter Wuille2014-11-181-6/+11
|
* HTTP REST: minor fixesJeff Garzik2014-11-181-2/+2
| | | | | | 1) const-ify internal helper ParseHashStr() 2) use HTTPError() helper when returning HTTP_NOT_FOUND
* Add unauthenticated HTTP REST interface to public blockchain data.Jeff Garzik2014-11-111-0/+201