aboutsummaryrefslogtreecommitdiff
path: root/src/miner.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove relay-only roundingRoss Nicoll2021-08-171-1/+1
| | | | | Remove rounding of transaction sizes when calculating fee minimums for relaying, to simplify fee logic.
* Check only the base block version (#1411)Ross Nicoll2018-09-191-2/+2
| | | Check only the base block version when looking for unexpected version numbers
* Modify chain consensus parameters to be height aware (#1396)Ross Nicoll2018-09-191-7/+8
| | | | | | | | | * 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
* Sync mining code from Namecore to resolve unit test failures (#1385)Ross Nicoll2018-09-191-1/+4
|
* Merge AuxPoW support from NamecoreRoss Nicoll2018-09-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add Dogecoin block subsidy calculations.Ross Nicoll2018-09-191-1/+3
|
* Update benchmarking with package statisticsSuhas Daftuar2017-03-301-5/+12
| | | | | Github-Pull: #9959 Rebased-From: 011124a2b278c5a60bad5f1b0b4abbf7ebc95aa0
* Add benchmarking for CreateNewBlockSuhas Daftuar2017-03-301-0/+7
| | | | | Github-Pull: #9959 Rebased-From: 42cd8c890fb2d65274f26edf95b6d52ac41fcab8
* Mining: return early when block is almost fullSuhas Daftuar2017-03-301-0/+18
| | | | | Github-Pull: #9959 Rebased-From: eed816af6c68c0c67f5fc05472a3927db62f8a18
* Don't require segwit in getblocktemplate for segwit signalling or miningSuhas Daftuar2017-03-161-2/+2
| | | | | | | | | Segwit's version bit will be signalled for all invocations of CreateNewBlock, and not specifying segwit only will cause CreateNewBlock to skip transactions with witness from being selected. Github-Pull: #9955 Rebased-From: abe7b3d3abe10e3554b770f40824174b3b217490
* Refactor: Remove using namespace <xxx> from src/*.cpp.Karl-Johan Alm2017-01-271-4/+2
|
* Introduce -blockmintxfeeAlex Morcos2017-01-041-2/+8
|
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Introduce (and use) an IsArgSet accessor methodMatt Corallo2016-12-231-2/+2
|
* Move CTxInWitness inside CTxInPieter Wuille2016-12-041-2/+2
|
* Rename the remaining main.{h,cpp} to validation.{h,cpp}Matt Corallo2016-12-021-1/+1
|
* Introduce convenience type CTransactionRefPieter Wuille2016-11-191-2/+2
|
* Make CBlock::vtx a vector of shared_ptr<CTransaction>Pieter Wuille2016-11-191-6/+6
|
* Merge #8838: Calculate size and weight of block correctly in CreateNewBlock()Wladimir J. van der Laan2016-11-171-1/+3
|\ | | | | | | 5f274a1 log block size and weight correctly. (jnewbery)
| * log block size and weight correctly.jnewbery2016-10-031-1/+3
| |
* | Merge #8223: [c++11] Use std::unique_ptr for block creation.Wladimir J. van der Laan2016-10-181-3/+4
|\ \ | |/ |/| | | 9fce062 [c++11] Use std::unique_ptr for block creation. (Daniel Kraft)
| * [c++11] Use std::unique_ptr for block creation.Daniel Kraft2016-06-181-3/+4
| | | | | | | | | | | | CreateNewBlock returns a pointer for which the caller takes ownership. Use std::unique_ptr to make this explicit and simplify handling of these objects in getblocktemplate.
* | Merge #8362: Scale legacy sigop count in CreateNewBlockWladimir J. van der Laan2016-07-251-1/+1
|\ \ | | | | | | | | | 682aa0f Scale legacy sigop count in CreateNewBlock (Suhas Daftuar)
| * | Scale legacy sigop count in CreateNewBlockSuhas Daftuar2016-07-181-1/+1
| | |
* | | Rename "block cost" to "block weight"Suhas Daftuar2016-07-181-21/+21
|/ /
* | Remove -blockminsize optionSuhas Daftuar2016-06-301-6/+1
| |
* | Remove addScoreTxs()Suhas Daftuar2016-06-301-60/+0
| |
* | Exclude witness transactions in addPackageTxs() pre-segwit activationSuhas Daftuar2016-06-301-4/+9
| |
* | CreateNewBlock: add support for size-accounting to addPackageTxsSuhas Daftuar2016-06-271-10/+15
| | | | | | | | | | Includes a change to not continue to use size-accounting in addScoreTxs or addPackageTxs just because addPriorityTxs() is used.
* | BIP141: Other consensus critical limits, and BIP145Pieter Wuille2016-06-221-26/+75
| | | | | | | | Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
* | BIP141: Commitment structure and deploymentPieter Wuille2016-06-221-0/+18
|/ | | | Includes a fix by Suhas Daftuar and LongShao007
* Use ancestor-feerate based transaction selection for miningSuhas Daftuar2016-06-161-1/+205
| | | | Includes changes by Pieter Wuille
* FIX: correctly measure size of priority blockAlex Morcos2016-06-011-1/+1
|
* FIX: Account for txs already added to block in addPriorityTxsAlex Morcos2016-05-241-1/+6
|
* Refactor CreateNewBlock to be a method of the BlockAssembler classAlex Morcos2016-05-181-188/+256
|
* auto_ptr → unique_ptrWladimir J. van der Laan2016-04-281-1/+1
| | | | | | | Change the few occurrences of the deprecated `auto_ptr` to c++11 `unique_ptr`. Silences the deprecation warnings. Also add a missing `std::` for consistency.
* BIP9 ImplementationPieter Wuille2016-03-151-5/+6
| | | | | Inspired by former implementations by Eric Lombrozo and Rusty Russell, and based on code by Jorge Timon.
* Merge #7507: Remove internal minerWladimir J. van der Laan2016-03-141-203/+0
|\ | | | | | | 8d1de43 Remove internal miner (Leviathn)
| * Remove internal minerLeviathn2016-02-101-203/+0
| | | | | | | | | | This code removes the internal miner which is only useful on Testnet. This leaves the internal miner that is useful on RegTest intact.
* | Add tags to mempool's mapTx indicesSuhas Daftuar2016-02-161-2/+2
|/
* Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|
* Update miner.cpp: Fix typo in commentantonio-fr2015-12-021-1/+1
|
* Rewrite CreateNewBlockAlex Morcos2015-12-011-181/+120
| | | | | | | | | | Use the score index on the mempool to only add sorted txs in order. Remove much of the validation while building the block, relying on mempool to be consistent and only contain txs that can be mined. The mempool is assumed to be consistent as far as not containing txs which spend non-existent outputs or double spends, and scripts are valid. Finality of txs is still checked (except not coinbase maturity, assumed in mempool). Still TestBlockValidity in case mempool consistency breaks and return error state if an invalid block was created. Unit tests are modified to realize that invalid blocks can now be constructed if the mempool breaks its consistency assumptions and also updated to have the right fees, since the cached value is now used for block construction. Conflicts: src/miner.cpp
* Merge pull request #6508Pieter Wuille2015-11-281-1/+2
|\ | | | | | | | | eece63f Switch blocks to a constant-space Merkle root/branch algorithm. (Pieter Wuille) ee60e56 Add merkle.{h,cpp}, generic merkle root/branch algorithm (Pieter Wuille)
| * Switch blocks to a constant-space Merkle root/branch algorithm.Pieter Wuille2015-11-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | This switches the Merkle tree logic for blocks to one that runs in constant (small) space. The old code is moved to tests, and a new test is added that for various combinations of block sizes, transaction positions to compute a branch for, and mutations: * Verifies that the old code and new code agree for the Merkle root. * Verifies that the old code and new code agree for the Merkle branch. * Verifies that the computed Merkle branch is valid. * Verifies that mutations don't change the Merkle root. * Verifies that mutations are correctly detected.
* | Constrain constant values to a single location in codeLuke Dashjr2015-11-281-1/+1
|/
* Chainparams: Explicit CChainParams arg for miner:Jorge Timón2015-11-111-6/+5
| | | | | | | -BitcoinMiner -CreateNewBlock -GenerateBitcoins -ProcessBlockFound
* Chainparams: Explicit CChainParams arg for main (pre miner):Jorge Timón2015-11-111-2/+2
| | | | | -ProcessNewBlock -TestBlockValidity
* Restore MedianTimePast for locktime.Gregory Maxwell2015-11-031-1/+7
| | | | | | | | Revert "Revert "Add rules--presently disabled--for using GetMedianTimePast as endpoint for lock-time calculations"" This reverts commit 40cd32e835092c3158175511da5193193ec54939. After careful analysis it was determined that the change was, in fact, safe and several people were suffering momentary confusion about locktime semantics.
* Revert "Add rules--presently disabled--for using GetMedianTimePast as ↵Gregory Maxwell2015-11-011-7/+1
| | | | | | | | | | | | | endpoint for lock-time calculations" This reverts commit 9d55050773d57c0e12005e524f2e54d9e622c6e2. As noted by Luke-Jr, under some conditions this will accept transactions which are invalid by the network rules. This happens when the current block time is head of the median time past and a transaction's locktime is in the middle. This could be addressed by changing the rule to MAX(this_block_time, MTP+offset) but this solution and the particular offset used deserve some consideration.