aboutsummaryrefslogtreecommitdiff
path: root/src/miner.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4377Pieter Wuille2014-08-271-2/+2
|\ | | | | | | | | | | 654871d replace ComputeMinWork with CheckMinWork (jtimon) b343c1a Move CBlockIndex::GetBlockWork() to pow::GetProofIncrement(nBits) (jtimon) c2c02f3 Move UpdateTime to pow (jtimon)
| * Move UpdateTime to powjtimon2014-08-231-2/+2
| |
* | Split up util.cpp/hWladimir J. van der Laan2014-08-261-2/+4
|/ | | | | | | | | | | | | | | | Split up util.cpp/h into: - string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach) - money utilities (parsesmoney, formatmoney) - time utilities (gettime*, sleep, format date): - and the rest (logging, argument parsing, config file parsing) The latter is basically the environment and OS handling, and is stripped of all utility functions, so we may want to rename it to something else than util.cpp/h for clarity (Matt suggested osinterface). Breaks dependency of sha256.cpp on all the things pulled in by util.
* Remove all other print() methodsWladimir J. van der Laan2014-08-201-8/+0
| | | | All unused.
* Remove print() from core functionsWladimir J. van der Laan2014-08-201-1/+1
| | | | Break dependency on util.
* Simplify and rename CheckWork to ProcessBlockFoundjtimon2014-07-301-11/+4
|
* `getrawchangeaddress` should fail when keypool exhaustedWladimir J. van der Laan2014-07-111-0/+3
| | | | | | | | | | | | An user on IRC reported an issue where `getrawchangeaddress` keeps returning a single address when the keypool is exhausted. In my opinion this is strange behaviour. - Change CReserveKey to fail when running out of keys in the keypool. - Make `getrawchangeaddress` return RPC_WALLET_KEYPOOL_RAN_OUT when unable to create an address. - Add a Python RPC test for checking the keypool behaviour in combination with encrypted wallets.
* Move fee policy out of coreGavin Andresen2014-07-031-1/+1
|
* JSON-RPC method: prioritisetransaction <txid> <priority delta> <priority tx fee>Luke Dashjr2014-06-261-3/+11
| | | | Accepts the transaction into mined blocks at a higher (or lower) priority
* Merge pull request #3839Wladimir J. van der Laan2014-06-251-0/+1
|\ | | | | | | | | fd704c7 move pow constants to chainparams (jtimon) df852d2 Refactor proof of work related functions out of main (jtimon)
| * Refactor proof of work related functions out of mainjtimon2014-06-231-0/+1
| |
* | Merge pull request #4169Wladimir J. van der Laan2014-06-241-98/+101
|\ \ | |/ |/| | | 0655fac miner: indentation fixes, remove for (;;) (Philip Kaufmann)
| * miner: indentation fixes, remove for (;;)Philip Kaufmann2014-06-221-98/+101
| | | | | | | | | | | | - change a for (;;) into while (true), as we nowhere else use the first - init nNonceFound to 0 - fix indentation in BitcoinMiner try/catch block
* | Code simplifications after CTransaction::GetHash() cachingPieter Wuille2014-06-221-2/+2
| |
* | Add CMutableTransaction and make CTransaction immutable.Pieter Wuille2014-06-211-7/+11
|/ | | | | In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
* Switch miner.cpp to use sha2 instead of OpenSSL.Pieter Wuille2014-06-211-133/+29
|
* Switch script.cpp and hash.cpp to use sha2.cpp instead of OpenSSL.Pieter Wuille2014-06-211-0/+3
|
* Remove `using namespace std` from header fileWladimir J. van der Laan2014-06-161-0/+2
| | | | | It's considered bad form to import things into the global namespace in a header. Put it in the cpp files where it is needed instead.
* small formatting, indentation and comment fixesPhilip Kaufmann2014-06-101-1/+0
| | | | - contains zero code changes
* Merge pull request #3824Wladimir J. van der Laan2014-06-091-8/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * Add AllowMinDifficultyBlocks chain parameterjtimon2014-06-041-1/+1
| |
| * Add DefaultMinerThreads chain parameterjtimon2014-06-041-2/+3
| |
| * Add MineBlocksOnDemand chain parameterjtimon2014-06-041-3/+2
| |
| * Add MiningRequiresPeers chain parameterjtimon2014-06-041-2/+3
| |
* | Push cs_mains down in ProcessBlockPieter Wuille2014-06-091-12/+12
| |
* | Fix compiler warningsDrak2014-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following compiler warning ``` miner.cpp: In constructor ‘COrphan::COrphan(const CTransaction*)’: miner.cpp:69:14: warning: ‘COrphan::feeRate’ will be initialized after [-Wreorder] CFeeRate feeRate; ^ miner.cpp:68:12: warning: ‘double COrphan::dPriority’ [-Wreorder] double dPriority; ^ miner.cpp:71:5: warning: when initialized here [-Wreorder] COrphan(const CTransaction* ptxIn) : ptx(ptxIn), feeRate(0), dPriority(0) ```
* | Type-safe CFeeRate classGavin Andresen2014-06-061-20/+22
|/ | | | | | | | Use CFeeRate instead of an int64_t for quantities that are fee-per-size. Helps prevent unit-conversion mismatches between the wallet, relaying, and mining code.
* Merge pull request #4138Wladimir J. van der Laan2014-05-121-1/+1
|\ | | | | | | 783b182 Remove dummy PRIszX macros for formatting (Wladimir J. van der Laan)
| * Remove dummy PRIszX macros for formattingWladimir J. van der Laan2014-05-061-1/+1
| | | | | | | | | | | | | | | | | | Size specifiers are no longer needed now that we use typesafe tinyformat for string formatting, instead of the system's sprintf. No functional changes. This continues the work in #3735.
* | Move {Get,Set}Compact from bignum to uint256Pieter Wuille2014-05-091-3/+3
| |
* | Merge pull request #3843Wladimir J. van der Laan2014-05-091-1/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 787ee0c Check redeemScript size does not exceed 520 byte limit (Peter Todd) 4d79098 Increase IsStandard() scriptSig length (Peter Todd) f80cffa Do not trigger a DoS ban if SCRIPT_VERIFY_NULLDUMMY fails (Peter Todd) 6380180 Add rejection of non-null CHECKMULTISIG dummy values (Peter Todd) 29c1749 Let tx (in)valid tests use any SCRIPT_VERIFY flag (Peter Todd) 68f7d1d Create (MANDATORY|STANDARD)_SCRIPT_VERIFY_FLAGS constants (Peter Todd)
| * | Create (MANDATORY|STANDARD)_SCRIPT_VERIFY_FLAGS constantsPeter Todd2014-05-051-1/+4
| |/
* / script: switch outside users to CScriptNumCory Fields2014-04-221-1/+1
|/
* Make mining fee policy match relay fee policy.Mike Hearn2014-03-101-2/+2
| | | | | | This resolves a case in which a mismatch could be used to bloat up the mempool by sending transactions that pay enough fee to relay, but not to be mined, with the default policies.
* Get rid of C99 PRI?64 usage in source filesWladimir J. van der Laan2014-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Amend to d5f1e72. It turns out that BerkelyDB was including inttypes.h indirectly, so we cannot fix this with just macros. Trivial commit: apply the following script to all .cpp and .h files: # Middle sed -i 's/"PRIx64"/x/g' "$1" sed -i 's/"PRIu64"/u/g' "$1" sed -i 's/"PRId64"/d/g' "$1" # Initial sed -i 's/PRIx64"/"x/g' "$1" sed -i 's/PRIu64"/"u/g' "$1" sed -i 's/PRId64"/"d/g' "$1" # Trailing sed -i 's/"PRIx64/x"/g' "$1" sed -i 's/"PRIu64/u"/g' "$1" sed -i 's/"PRId64/d"/g' "$1" After this commit, `git grep` for PRI.64 should turn up nothing except the defines in util.h.
* Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron2014-02-091-1/+1
| | | | | | in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
* Fix off-by-one errors in use of IsFinalTx()Peter Todd2014-01-261-1/+1
| | | | | | | | | | | | | | Previously CreateNewBlock() didn't take into account the fact that IsFinalTx() without any arguments tests if the transaction is considered final in the *current* block, when both those functions really needed to know if the transaction would be final in the *next* block. Additionally the UI had a similar misunderstanding. Also adds some basic tests to check that CreateNewBlock() is in fact mining nLockTime-using transactions correctly. Thanks to Wladimir J. van der Laan for rebase.
* Remove redundant .c_str()sWladimir J. van der Laan2014-01-231-5/+5
| | | | | | | After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
* Make bitcoin compile without wallet if "db_cxx.h" is not presentThomas Holenstein2013-12-191-1/+2
| | | | | Moved includes of "db.h" into #ifdef ENABLE_WALLET blocks or remove them.
* Merge pull request #3326Wladimir J. van der Laan2013-12-131-1/+1
|\ | | | | | | ad898b4 Increase default -blockmaxsize/prioritysize to 750K/50K (Gavin Andresen)
| * Increase default -blockmaxsize/prioritysize to 750K/50KGavin Andresen2013-11-301-1/+1
| |
* | Move internal miner functionality togetherWladimir J. van der Laan2013-12-091-53/+52
| |
* | Allow mining RPCs with --disable-walletWladimir J. van der Laan2013-12-091-2/+7
| | | | | | | | | | | | | | | | | | | | | | The following mining-related RPC calls don't use the wallet: - getnetworkhashps - getmininginfo - getblocktemplate - submitblock Enable them when compiling with --disable-wallet.
* | Add verbose boolean to getrawmempoolGavin Andresen2013-11-301-21/+10
| | | | | | | | | | Also changes mempool to store CTxMemPoolEntries to keep track of when they enter/exit the pool.
* | Refactor: move GetValueIn(tx) to tx.GetValueIn()Gavin Andresen2013-11-301-2/+2
|/ | | | GetValueIn makes more sense as a CTransaction member.
* setgenerate creates multiple blocks in -regtest modeGavin Andresen2013-11-221-2/+1
| | | | | | | | | | | | | | | 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.
* core: remove includes in .cpp, if header is already in .hPhilip Kaufmann2013-11-151-2/+0
| | | | | - example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-13/+19
| | | | | | | | | 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.
* Refactor: CTxMempool class to its own txmempool.{cpp,h}Gavin Andresen2013-11-041-2/+2
|
* Merge pull request #3119Pieter Wuille2013-10-201-1/+1
|\ | | | | | | db0e8cc Bump Year Number to 2013 (super3)