aboutsummaryrefslogtreecommitdiff
path: root/src/test/miner_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix compact block handling to not ban if block is invalidSuhas Daftuar2016-11-031-1/+1
|
* Make removed and conflicted arguments optional to removePieter Wuille2016-10-211-2/+1
|
* Merge #8865: Decouple peer-processing-logic from block-connection-logicWladimir J. van der Laan2016-10-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | a9aec5c Use BlockChecked signal to send reject messages from mapBlockSource (Matt Corallo) 7565e03 Remove SyncWithWallets wrapper function (Matt Corallo) 12ee1fe Always call UpdatedBlockTip, even if blocks were only disconnected (Matt Corallo) f5efa28 Remove CConnman parameter from ProcessNewBlock/ActivateBestChain (Matt Corallo) fef1010 Use CValidationInterface from chain logic to notify peer logic (Matt Corallo) aefcb7b Move net-processing logic definitions together in main.h (Matt Corallo) 0278fb5 Remove duplicate nBlocksEstimate cmp (we already checked IsIBD()) (Matt Corallo) 87e7d72 Make validationinterface.UpdatedBlockTip more verbose (Matt Corallo)
| * Remove CConnman parameter from ProcessNewBlock/ActivateBestChainMatt Corallo2016-10-041-1/+1
| |
* | Merge #8223: [c++11] Use std::unique_ptr for block creation.Wladimir J. van der Laan2016-10-181-11/+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-11/+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.
* | net: Pass CConnman around as neededCory Fields2016-09-081-1/+1
| |
* | Enable size accounting in mining unit testsSuhas Daftuar2016-07-281-3/+1
| |
* | BIP141: Other consensus critical limits, and BIP145Pieter Wuille2016-06-221-1/+4
|/ | | | Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
* Add unit tests for ancestor feerate miningSuhas Daftuar2016-06-161-0/+109
|
* Merge #7598: Refactor CreateNewBlock to be a method of the BlockAssembler classWladimir J. van der Laan2016-06-131-14/+14
|\ | | | | | | | | | | c2dd5a3 FIX: correctly measure size of priority block (Alex Morcos) a278764 FIX: Account for txs already added to block in addPriorityTxs (Alex Morcos) 4dc94d1 Refactor CreateNewBlock to be a method of the BlockAssembler class (Alex Morcos)
| * Refactor CreateNewBlock to be a method of the BlockAssembler classAlex Morcos2016-05-181-14/+14
| |
* | Do not shadow local variablesPavel Janík2016-06-071-2/+2
|/
* Corrected valuesinstagibbs2016-04-071-2/+2
|
* Gave miner test values constants for less error-prone values.instagibbs2016-04-071-24/+29
|
* BIP9 ImplementationPieter Wuille2016-03-151-3/+30
| | | | | Inspired by former implementations by Eric Lombrozo and Rusty Russell, and based on code by Jorge Timon.
* Merge #7184: Implement SequenceLocks functions for BIP 68Wladimir J. van der Laan2016-02-121-31/+95
|\ | | | | | | | | | | | | b043c4b fix sdaftuar's nits again (Alex Morcos) a51c79b Bug fix to RPC test (Alex Morcos) da6ad5f Add RPC test exercising BIP68 (mempool only) (Suhas Daftuar) c6c2f0f Implement SequenceLocks functions (Alex Morcos)
| * Implement SequenceLocks functionsAlex Morcos2016-02-101-31/+95
| | | | | | | | | | | | | | SequenceLocks functions are used to evaluate sequence lock times or heights per BIP 68. The majority of this code is copied from maaku in #6312 Further credit: btcdrak, sipa, NicolasDorier
* | Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|/
* Rewrite CreateNewBlockAlex Morcos2015-12-011-24/+36
| | | | | | | | | | 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 #6915Wladimir J. van der Laan2015-12-011-11/+13
|\ | | | | | | | | | | | | | | | | | | | | 2d8860e Fix removeForReorg to use MedianTimePast (Suhas Daftuar) b7fa4aa Don't call removeForReorg if DisconnectTip fails (Suhas Daftuar) 7e49f5f Track coinbase spends in CTxMemPoolEntry (Suhas Daftuar) bb8ea1f removeForReorg calls once-per-disconnect-> once-per-reorg (Matt Corallo) 474b84a Make indentation in ActivateBestChainStep readable (Matt Corallo) b0a064c Fix comment in removeForReorg (Matt Corallo) 9b060e5 Fix removal of time-locked transactions during reorg (Matt Corallo) 0c9959a Add failing test checking timelocked-txn removal during reorg (Matt Corallo)
| * Track coinbase spends in CTxMemPoolEntrySuhas Daftuar2015-11-301-11/+13
| | | | | | | | This allows us to optimize CTxMemPool::removeForReorg.
* | Merge pull request #6914Wladimir J. van der Laan2015-12-011-1/+1
|\ \ | |/ |/| | | 114b581 Prevector type (Pieter Wuille)
| * Prevector typePieter Wuille2015-11-131-1/+1
| |
* | 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.
* | Implement helper class for CTxMemPoolEntry constructorAlex Morcos2015-11-161-12/+16
| | | | | | | | This is only for unit tests.
* | Chainparams: Explicit CChainParams arg for miner:Jorge Timón2015-11-111-13/+13
| | | | | | | | | | | | | | -BitcoinMiner -CreateNewBlock -GenerateBitcoins -ProcessBlockFound
* | Chainparams: Explicit CChainParams arg for main (pre miner):Jorge Timón2015-11-111-1/+2
|/ | | | | -ProcessNewBlock -TestBlockValidity
* Revert "Revert "Enable policy enforcing GetMedianTimePast as the end point ↵Gregory Maxwell2015-11-031-3/+4
| | | | | | of lock-time constraints"" This reverts commit 8537ecdfc40181249ec37556015a99cfae4b21fd.
* Revert "Enable policy enforcing GetMedianTimePast as the end point of ↵Gregory Maxwell2015-11-011-4/+3
| | | | | | lock-time constraints" This reverts commit dea8d21fc63e9f442299c97010e4740558f4f037.
* Enable policy enforcing GetMedianTimePast as the end point of lock-time ↵Mark Friedenbach2015-10-231-3/+4
| | | | | | constraints Transactions are not allowed in the memory pool or selected for inclusion in a block until their lock times exceed chainActive.Tip()->GetMedianTimePast(). However blocks including transactions which are only mature under the old rules are still accepted; this is *not* the soft-fork required to actually rely on the new constraint in production.
* Do not store Merkle branches in the wallet.Pieter Wuille2015-09-221-1/+1
| | | | | | | | | | Assume that when a wallet transaction has a valid block hash and transaction position in it, the transaction is actually there. We're already trusting wallet data in a much more fundamental way anyway. To prevent backward compatibility issues, a new record is used for storing the block locator in the wallet. Old wallets will see a wallet file synchronized up to the genesis block, and rescan automatically.
* TRIVIAL: Missing includesJorge Timón2015-07-231-0/+5
|
* Merge pull request #6222Wladimir J. van der Laan2015-06-101-0/+1
|\ | | | | | | efd4444 Explicitly set tx.nVersion for the genesis block and mining tests (Mark Friedenbach)
| * Explicitly set tx.nVersion for the genesis block and mining testsMark Friedenbach2015-06-021-0/+1
| | | | | | | | If/when CTransaction::CURRENT_VERSION is incremented, this will break CChainParams and the miner tests. This fix sets the transaction version explicitly where we depend on the hash value (genesis block, proof of work checks).
* | Be stricter in processing unrequested blocksSuhas Daftuar2015-06-021-1/+1
|/ | | | | AcceptBlock will no longer process an unrequested block, unless it has not been previously processed and has more work than chainActive.Tip()
* Merge pull request #6183Wladimir J. van der Laan2015-06-011-4/+6
|\ | | | | | | 28bf062 Fix off-by-one error w/ nLockTime in the wallet (Peter Todd)
| * Fix off-by-one error w/ nLockTime in the walletPeter Todd2015-05-271-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously due to an off-by-one error the wallet ignored nLockTime-by-height transactions that would be valid in the next block even though they are accepted into the mempool. The transactions wouldn't show up until confirmed, nor would they be included in the unconfirmed balance. Similar to the mempool behavior fix in 665bdd3b, the wallet code was calling IsFinalTx() directly without taking into account the fact that doing so tells you if the transaction could have been mined in the *current* block, rather than the next block. To fix this we strip IsFinalTx() of non-consensus-critical functionality, removing the default arguments, and add CheckFinalTx() to check if a transaction will be final in the next block.
* | Consensus: MOVEONLY: Move CValidationState from main consensus/validationjtimon2015-05-151-0/+1
|/
* checkpoints: move the checkpoints enable boolean into mainCory Fields2015-04-301-2/+2
| | | | | This pertains to app-state, so it doesn't make sense to handle inside the checkpoint functions.
* Revert mining changes in #5957Wladimir J. van der Laan2015-04-101-14/+13
| | | | | | | This reverts commit e2edf95cd3f43331843676e49a82830128a95050 6b04508e37c5dd18cec1cd61cc4356bd208aa991 0df67f1f7ab4adfe9f0b3ba6276e737b37826464, except the changes to the RPC tests. A `generate` RPC call is introduced based on the old code.
* Bugfix: make CreateNewBlock return pindexPrevPieter Wuille2015-04-011-13/+14
|
* Reinitialize state in between individual unit tests.Pieter Wuille2015-03-031-1/+3
| | | | | This changes the TestingSetup fixture to be per-unit-test rather than global. Most tests don't need it, so it's only invoked in a few.
* Remove references to X11 licenceMichael Ford2014-12-161-1/+1
|
* Merge pull request #1816Wladimir J. van der Laan2014-11-241-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | 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)
| * miner_tests: Disable checkpoints so they don't fail the subsidy-change testLuke Dashjr2014-11-181-0/+2
| |
* | Merge pull request #5162Wladimir J. van der Laan2014-11-041-0/+1
|\ \ | |/ |/| | | | | | | d2e74c5 boost: moveonly: split CPubKey and friends to new files (Cory Fields) 78c228c boost: moveonly: move BIP32Hash to hash.h (Cory Fields) 900078a boost: moveonly: create eccryptoverify.h|cpp and move helper functions there (Cory Fields)
| * boost: moveonly: split CPubKey and friends to new filesCory Fields2014-10-311-0/+1
| |
* | Merge pull request #5106Wladimir J. van der Laan2014-11-031-1/+1
|\ \ | |/ |/| | | | | | | | | 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-1/+1
| | | | | | | | document it