aboutsummaryrefslogtreecommitdiff
path: root/src/miner.cpp
AgeCommit message (Collapse)Author
2014-12-16Remove references to X11 licenceMichael Ford
2014-12-03MOVEONLY: core/ -> primitives/Luke Dashjr
2014-11-24Merge pull request #1816Wladimir J. van der Laan
b867e40 CreateNewBlock: Stick height in coinbase so we pass template sanity check (Luke Dashjr) 60755db submitblock: Check for duplicate submissions explicitly (Luke Dashjr) bc6cb41 QA RPC tests: Add tests block block proposals (Luke Dashjr) 9765a50 Implement BIP 23 Block Proposal (Luke Dashjr) 3dcbb9b Abstract DecodeHexBlk and BIP22ValidationResult functions out of submitblock (Luke Dashjr) 132ea9b miner_tests: Disable checkpoints so they don't fail the subsidy-change test (Luke Dashjr) df08a62 TestBlockValidity function for CBlock proposals (used by CreateNewBlock) (Luke Dashjr) 4ea1be7 CreateNewBlock and miner_tests: Also check generated template is valid by CheckBlockHeader, ContextualCheckBlockHeader, CheckBlock, and ContextualCheckBlock (Luke Dashjr) a48f2d6 Abstract context-dependent block checking from acceptance (Luke Dashjr)
2014-11-21Merge pull request #5170Wladimir J. van der Laan
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)
2014-11-20CreateNewBlock: Stick height in coinbase so we pass template sanity checkLuke Dashjr
2014-11-18TestBlockValidity function for CBlock proposals (used by CreateNewBlock)Luke Dashjr
2014-11-18CreateNewBlock and miner_tests: Also check generated template is valid by ↵Luke Dashjr
CheckBlockHeader, ContextualCheckBlockHeader, CheckBlock, and ContextualCheckBlock
2014-11-03Merge pull request #5106Wladimir J. van der Laan
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)
2014-10-29MOVEONLY: Move void UpdateTime() from pow.o to miner.o (plus fix include ↵jtimon
main.h -> chain.h)
2014-10-28Rename ProcessBlock to ProcessNewBlock to indicate change of behaviour, and ↵Luke Dashjr
document it
2014-10-27MOVEONLY: core.o -> core/block.ojtimon
2014-10-27MOVEONLY: Separate CTransaction and dependencies from corejtimon
2014-10-27MOVEONLY: Move CFeeRate and Amount constants to amount.ojtimon
2014-10-22Merge pull request #4981Wladimir J. van der Laan
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)
2014-10-21Fixes for missing boost tuple.hpp header include.randy-waterhouse
2014-10-17script: add ToByteVector() for converting anything with begin/endCory Fields
This should move to a util header once their dependencies are cleaned up.
2014-10-09Merge pull request #5059Gavin Andresen
dbca89b Trigger -alertnotify if network is upgrading without you (Gavin Andresen) e01a793 Refactor -alertnotify code (Gavin Andresen) Signed-off-by: Gavin Andresen <gavinandresen@gmail.com>
2014-10-09Trigger -alertnotify if network is upgrading without youGavin Andresen
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
2014-10-08Merge pull request #4834Pieter Wuille
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)
2014-10-02Replace SCRIPT_VERIFY_NOCACHE by flag directly to checkerPieter Wuille
2014-09-26Use a typedef for monetary valuesMark Friedenbach
2014-09-24Get rid of the dummy CCoinsViewCache constructor argPieter Wuille
2014-09-03Combine CCoinsViewCache's HaveCoins and const GetCoins into AccessCoins.Pieter Wuille
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.
2014-08-27Merge pull request #4377Pieter Wuille
654871d replace ComputeMinWork with CheckMinWork (jtimon) b343c1a Move CBlockIndex::GetBlockWork() to pow::GetProofIncrement(nBits) (jtimon) c2c02f3 Move UpdateTime to pow (jtimon)
2014-08-26Split up util.cpp/hWladimir J. van der Laan
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.
2014-08-23Move UpdateTime to powjtimon
2014-08-20Remove all other print() methodsWladimir J. van der Laan
All unused.
2014-08-20Remove print() from core functionsWladimir J. van der Laan
Break dependency on util.
2014-07-30Simplify and rename CheckWork to ProcessBlockFoundjtimon
2014-07-11`getrawchangeaddress` should fail when keypool exhaustedWladimir J. van der Laan
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.
2014-07-03Move fee policy out of coreGavin Andresen
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-25Merge pull request #3839Wladimir J. van der Laan
fd704c7 move pow constants to chainparams (jtimon) df852d2 Refactor proof of work related functions out of main (jtimon)
2014-06-24Merge pull request #4169Wladimir J. van der Laan
0655fac miner: indentation fixes, remove for (;;) (Philip Kaufmann)
2014-06-23Refactor proof of work related functions out of mainjtimon
2014-06-22miner: indentation fixes, remove for (;;)Philip Kaufmann
- change a for (;;) into while (true), as we nowhere else use the first - init nNonceFound to 0 - fix indentation in BitcoinMiner try/catch block
2014-06-22Code simplifications after CTransaction::GetHash() cachingPieter Wuille
2014-06-21Add CMutableTransaction and make CTransaction immutable.Pieter Wuille
In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
2014-06-21Switch miner.cpp to use sha2 instead of OpenSSL.Pieter Wuille
2014-06-21Switch script.cpp and hash.cpp to use sha2.cpp instead of OpenSSL.Pieter Wuille
2014-06-16Remove `using namespace std` from header fileWladimir J. van der Laan
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.
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-09Push cs_mains down in ProcessBlockPieter Wuille
2014-06-07Fix compiler warningsDrak
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) ```
2014-06-06Type-safe CFeeRate classGavin Andresen
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.
2014-06-04Add AllowMinDifficultyBlocks chain parameterjtimon
2014-06-04Add DefaultMinerThreads chain parameterjtimon
2014-06-04Add MineBlocksOnDemand chain parameterjtimon
2014-06-04Add MiningRequiresPeers chain parameterjtimon