aboutsummaryrefslogtreecommitdiff
path: root/src/rpcmining.cpp
AgeCommit message (Collapse)Author
2014-06-28Replace HexBits with strprintfjtimon
2014-06-26JSON-RPC method: prioritisetransaction <txid> <priority delta> <priority tx fee>Luke Dashjr
Accepts the transaction into mined blocks at a higher (or lower) priority
2014-06-25Remove unnecessary dependencies for bitcoin-cliWladimir J. van der Laan
This commit removes all the unnecessary dependencies (key, core, netbase, sync, ...) from bitcoin-cli. To do this it shards the chain parameters into BaseParams, which contains just the RPC port and data directory (as used by utils and bitcoin-cli) and Params, with the rest.
2014-06-23Refactor proof of work related functions out of mainjtimon
2014-06-21Remove getwork() RPC callPieter Wuille
2014-06-17Add "chain" to getmininginfo, improve help in getblockchaininfojtimon
2014-06-17Get rid of Params().RPCisTestNet()jtimon
2014-06-10small formatting, indentation and comment fixesPhilip Kaufmann
- contains zero code changes
2014-06-09Merge pull request #3824Wladimir J. van der Laan
f0a83fc Use Params().NetworkID() instead of TestNet() from the payment protocol (jtimon) 2871889 net.h was using std namespace through chainparams.h included in protocol.h (jtimon) c8c52de Replace virtual methods with static attributes, chainparams.h depends on protocol.h instead of the other way around (jtimon) a3d946e Get rid of TestNet() (jtimon) 6fc0fa6 Add RPCisTestNet chain parameter (jtimon) cfeb823 Add RequireStandard chain parameter (jtimon) 21913a9 Add AllowMinDifficultyBlocks chain parameter (jtimon) d754f34 Move majority constants to chainparams (jtimon) 8d26721 Get rid of RegTest() (jtimon) cb9bd83 Add DefaultCheckMemPool chain parameter (jtimon) 2595b9a Add DefaultMinerThreads chain parameter (jtimon) bfa9a1a Add MineBlocksOnDemand chain parameter (jtimon) 1712adb Add MiningRequiresPeers chain parameter (jtimon)
2014-06-06estimatefee / estimatepriority RPC methodsGavin Andresen
New RPC methods: return an estimate of the fee (or priority) a transaction needs to be likely to confirm in a given number of blocks. Mike Hearn created the first version of this method for estimating fees. It works as follows: For transactions that took 1 to N (I picked N=25) blocks to confirm, keep N buckets with at most 100 entries in each recording the fees-per-kilobyte paid by those transactions. (separate buckets are kept for transactions that confirmed because they are high-priority) The buckets are filled as blocks are found, and are saved/restored in a new fee_estiamtes.dat file in the data directory. A few variations on Mike's initial scheme: To estimate the fee needed for a transaction to confirm in X buckets, all of the samples in all of the buckets are used and a median of all of the data is used to make the estimate. For example, imagine 25 buckets each containing the full 100 entries. Those 2,500 samples are sorted, and the estimate of the fee needed to confirm in the very next block is the 50'th-highest-fee-entry in that sorted list; the estimate of the fee needed to confirm in the next two blocks is the 150'th-highest-fee-entry, etc. That algorithm has the nice property that estimates of how much fee you need to pay to get confirmed in block N will always be greater than or equal to the estimate for block N+1. It would clearly be wrong to say "pay 11 uBTC and you'll get confirmed in 3 blocks, but pay 12 uBTC and it will take LONGER". A single block will not contribute more than 10 entries to any one bucket, so a single miner and a large block cannot overwhelm the estimates.
2014-06-04Add RPCisTestNet chain parameterjtimon
2014-06-04Add MineBlocksOnDemand chain parameterjtimon
2014-05-13switch from boost int types to <stdint.h>Kamil Domanski
2014-05-09Move {Get,Set}Compact from bignum to uint256Pieter Wuille
2014-03-22RPC command getmininginfo showing right genproclimitIsidoro Ghezzi
2013-12-29"getnetworkhashps" with defaults was yielding "0", the hashrate is not 0.Gregory Maxwell
This was broken in 4c6d41b8b653ef90639b1a32f6aab0bb1cef90c5.
2013-12-19Make bitcoin compile without wallet if "db_cxx.h" is not presentThomas Holenstein
Moved includes of "db.h" into #ifdef ENABLE_WALLET blocks or remove them.
2013-12-09Allow mining RPCs with --disable-walletWladimir J. van der Laan
The following mining-related RPC calls don't use the wallet: - getnetworkhashps - getmininginfo - getblocktemplate - submitblock Enable them when compiling with --disable-wallet.
2013-11-27Split up bitcoinrpc (code movement only)Wladimir J. van der Laan
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.
2013-11-22setgenerate creates multiple blocks in -regtest modeGavin Andresen
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.
2013-11-13Issue #1865 - Clean up RPC help messagessje
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
2013-11-11misc small changes to polish after include cleanupPhilip Kaufmann
2013-11-10Cleanup code using forward declarations.Brandon Dahler
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.
2013-11-04Refactor: CTxMempool class to its own txmempool.{cpp,h}Gavin Andresen
2013-10-20Merge pull request #3119Pieter Wuille
db0e8cc Bump Year Number to 2013 (super3)
2013-10-20Bump Year Number to 2013super3
2013-10-11Refactor/encapsulate chain globals into a CChain classPieter Wuille
2013-10-01Support absence of wallet (pwalletMain==NULL) in several locations,Jeff Garzik
notably RPC.
2013-10-01Merge pull request #2888 from litecoin-project/getnetworkhashpsJeff Garzik
Add getnetworkhashps to get the estimated network hashrate
2013-09-17Add getnetworkhashps to get the calculated network hashratecoblee
2013-08-24RPC: getblocktemplate does not require a key, to create a block templateJeff Garzik
getblocktemplate only uses certain portions of the coinbase transaction, notably ignoring the coinbase TX output entirely. Use CreateNewBlock() rather than CreateNewBlockWithKey(), eliminating the needless key passing. Should be zero behavior changes.
2013-08-24CreateNewBlock() now takes scriptPubKey argument,Jeff Garzik
rather than a key. CreateNewBlockWithKey() helper is added to restore existing functionality, making this an equivalent-transformation change.
2013-07-31Move internal miner/block creation to separate miner.cpp module.Jeff Garzik
Public functions referenced elsewhere are added to miner.h.
2013-06-24main.h->core.h include dependency improvements.Jeff Garzik
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-05Moved UpdateTime out of CBlockHeader and moved CBlockHeader into core.Eric Lombrozo
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-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-02-07Do not use C++11 std::vector.data()Gavin Andresen
std::vector.data() is a C++11 feature that makes my OSX build machine unhappy.
2013-01-30CValidationState frameworkPieter Wuille
2013-01-03moved "index_in_template" to a separate variable to clarify what it isForrest Voight
2012-12-19use fee/sigop data in BlockTemplate struct instead of (not always correctly) ↵Forrest Voight
calculating it ourselves
2012-12-19changed CreateNewBlock to return a CBlockTemplate object, which includes ↵Forrest Voight
per-tx fee and sigop count data
2012-10-24Don't force getblocktemplate to have a parameter.Gregory Maxwell
This looks like it was just a munged merge when ultraprune was committed.
2012-10-20Batch block connection during IBDPieter Wuille
During the initial block download (or -loadblock), delay connection of new blocks a bit, and perform them in a single action. This reduces the load on the database engine, as subsequent blocks often update an earlier block's transaction already.
2012-10-20UltraprunePieter Wuille
This switches bitcoin's transaction/block verification logic to use a "coin database", which contains all unredeemed transaction output scripts, amounts and heights. The name ultraprune comes from the fact that instead of a full transaction index, we only (need to) keep an index with unspent outputs. For now, the blocks themselves are kept as usual, although they are only necessary for serving, rescanning and reorganizing. The basic datastructures are CCoins (representing the coins of a single transaction), and CCoinsView (representing a state of the coins database). There are several implementations for CCoinsView. A dummy, one backed by the coins database (coins.dat), one backed by the memory pool, and one that adds a cache on top of it. FetchInputs, ConnectInputs, ConnectBlock, DisconnectBlock, ... now operate on a generic CCoinsView. The block switching logic now builds a single cached CCoinsView with changes to be committed to the database before any changes are made. This means no uncommitted changes are ever read from the database, and should ease the transition to another database layer which does not support transactions (but does support atomic writes), like LevelDB. For the getrawtransaction() RPC call, access to a txid-to-disk index would be preferable. As this index is not necessary or even useful for any other part of the implementation, it is not provided. Instead, getrawtransaction() uses the coin database to find the block height, and then scans that block to find the requested transaction. This is slow, but should suffice for debug purposes.
2012-10-04Document RPC error codesWladimir J. van der Laan
Replace all "magic values" in RPCError(...) by constants.
2012-09-01Merge pull request #1771 from luke-jr/bugfix_bip22_modeJeff Garzik
Bugfix: getblocktemplate: Accept optional "mode" parameter not being provided
2012-09-01Bugfix: getblocktemplate: Accept optional "mode" parameter not being providedLuke Dashjr