aboutsummaryrefslogtreecommitdiff
path: root/src/miner.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge pull request #5170Wladimir J. van der Laan2014-11-211-0/+10
|\ \ | |/ |/| | | | | 092b58d CBlockIndex::GetBlockWork() + GetProofIncrement(nBits) -> GetBlockProof(CBlockIndex) (jtimon) 22c4272 MOVEONLY: Move void UpdateTime() from pow.o to miner.o (plus fix include main.h -> chain.h) (jtimon)
| * MOVEONLY: Move void UpdateTime() from pow.o to miner.o (plus fix include ↵jtimon2014-10-291-0/+10
| | | | | | | | main.h -> chain.h)
* | Merge pull request #5106Wladimir J. van der Laan2014-11-031-2/+2
|\ \ | |/ |/| | | | | | | | | 1bea2bb Rename ProcessBlock to ProcessNewBlock to indicate change of behaviour, and document it (Luke Dashjr) d29a291 Rename RPC_TRANSACTION_* errors to RPC_VERIFY_* and use RPC_VERIFY_ERROR for submitblock (Luke Dashjr) f877aaa Bugfix: submitblock: Use a temporary CValidationState to determine accurately the outcome of ProcessBlock, now that it no longer does the full block validity check (Luke Dashjr) 24e8896 Add CValidationInterface::BlockChecked notification (Luke Dashjr)
| * Rename ProcessBlock to ProcessNewBlock to indicate change of behaviour, and ↵Luke Dashjr2014-10-281-2/+2
| | | | | | | | document it
* | MOVEONLY: core.o -> core/block.ojtimon2014-10-271-1/+1
| |
* | MOVEONLY: Separate CTransaction and dependencies from corejtimon2014-10-271-0/+1
| |
* | MOVEONLY: Move CFeeRate and Amount constants to amount.ojtimon2014-10-271-0/+1
| |
* | Merge pull request #4981Wladimir J. van der Laan2014-10-221-1/+1
|\ \ | | | | | | | | | | | | | | | | | | 85c579e script: add a slew of includes all around and drop includes from script.h (Cory Fields) db8eb54 script: move ToString and ValueString out of the header (Cory Fields) e9ca428 script: add ToByteVector() for converting anything with begin/end (Cory Fields) 066e2a1 script: move CScriptID to standard.h and add a ctor for creating them from CScripts (Cory Fields)
| * | script: add ToByteVector() for converting anything with begin/endCory Fields2014-10-171-1/+1
| |/ | | | | | | This should move to a util header once their dependencies are cleaned up.
* / Fixes for missing boost tuple.hpp header include.randy-waterhouse2014-10-211-0/+1
|/
* Merge pull request #5059Gavin Andresen2014-10-091-0/+5
|\ | | | | | | | | | | | | dbca89b Trigger -alertnotify if network is upgrading without you (Gavin Andresen) e01a793 Refactor -alertnotify code (Gavin Andresen) Signed-off-by: Gavin Andresen <[email protected]>
| * Trigger -alertnotify if network is upgrading without youGavin Andresen2014-10-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a -regetest-only undocumented (for regression testing only) command-line option -blockversion=N to set block.nVersion. Adds to the "has the rest of the network upgraded to a block.nVersion we don't understand" code so it calls -alertnotify when 51 of the last 100 blocks are up-version. But it only alerts once, not with every subsequent new, upversion block. And adds a forknotify.py regression test to make sure it works. Tested using forknotify.py: Before adding CAlert::Notify, get: Assertion failed: -alertnotify did not warn of up-version blocks Before adding code to only alert once: Assertion failed: -alertnotify excessive warning of up-version blocks After final code in this pull: Tests successful
* | Merge pull request #4834Pieter Wuille2014-10-081-2/+2
|\ \ | |/ |/| | | | | | | | | | | 7c70438 Get rid of the dummy CCoinsViewCache constructor arg (Pieter Wuille) ed27e53 Add coins_tests with a large randomized CCoinViewCache test. (Pieter Wuille) 058b08c Do not keep fully spent but unwritten CCoins entries cached. (Pieter Wuille) c9d1a81 Get rid of CCoinsView's SetCoins and SetBestBlock. (Pieter Wuille) f28aec0 Use ModifyCoins instead of mutable GetCoins. (Pieter Wuille)
| * Get rid of the dummy CCoinsViewCache constructor argPieter Wuille2014-09-241-2/+2
| |
* | Replace SCRIPT_VERIFY_NOCACHE by flag directly to checkerPieter Wuille2014-10-021-1/+1
| |
* | Use a typedef for monetary valuesMark Friedenbach2014-09-261-5/+5
|/
* Combine CCoinsViewCache's HaveCoins and const GetCoins into AccessCoins.Pieter Wuille2014-09-031-3/+4
| | | | | | | | | | | | The efficient version of CCoinsViewCache::GetCoins only works for known-to-exist cache entries, requiring a separate HaveCoins call beforehand. This is inefficient as both perform a hashtable lookup. Replace the non-mutable GetCoins with AccessCoins, which returns a potentially-NULL pointer. This also decreases the overloading of GetCoins. Also replace some copying (inefficient) GetCoins calls with equivalent AccessCoins, decreasing the copying.
* 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
|/