aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
Commit message (Collapse)AuthorAgeFilesLines
* really s/Doge/Dis/g this timeTomo Ueda2021-09-021-11/+11
|
* really s/doge/dis/g this timeTomo Ueda2021-09-021-3/+3
|
* Remove relay-only roundingRoss Nicoll2021-08-171-4/+4
| | | | | Remove rounding of transaction sizes when calculating fee minimums for relaying, to simplify fee logic.
* [ #2297 ] Implemented suggestions: camel casing as suggested and printing ↵Escanor Liones2021-08-161-14/+23
| | | | debug messages for invalidated blocks.
* fix: A newly appended block header should not build on an invalid chainp-j012021-08-161-8/+66
|
* consensus: Fix a rare crash bugRoss Nicoll2021-08-041-1/+5
| | | | | Fix a rare crash bug where no best chain can be activated, and therefore when trying to find the height of the best chain via the last block triggers a null pointer dereference.
* bugfix: break ActivateBestChain() differently on shutdownPatrick Lodder2021-08-041-3/+9
| | | | | | | | Moves the break in ActivateBestChain() when a node is being shut down from the beginning of the loop block to the end, allowing pindexNewTip to be populated with chainActive.Tip() rather than its initial NULL value. Solves issues when shutting down nodes while inside the ActivateBestChain loop.
* Initial back end framework to separate wallet and relay fees + dust.Michi Lumin2021-07-301-3/+5
|
* Refactor: fix typo in validation.cppIkko Ashimine2021-04-271-1/+1
| | | inadvertantly -> inadvertently
* Merge pull request #1676 from shibe2/skipcheckpowRoss Nicoll2021-02-151-10/+10
|\ | | | | Don't recompute AuxPoW when serving peer requests
| * Don't re-check AuxPoW when sending data to peersShibe2021-02-081-10/+10
| | | | | | | | | | | | Checking scrypt PoW is expensive and needless in this case. All block headers are already checked when they are accepted, and they will be checked again on the receiving end.
* | Merge pull request #1655 from John-Gee/1.14.3-devMax K2021-02-141-2/+7
|\ \ | | | | | | Build on recent Linux
| * | Fix for Boost 1.74John-Gee2021-02-021-2/+7
| |/
* / Fixate BIP65 softfork heightsPatrick Lodder2021-02-131-9/+4
|/ | | | | | | | | - Re-introduce Params.BIP65Height - Fixate block 1854705 for testnet - Fixate block 3464751 for mainnet - Fixate block 1351 for regtest - Stop using IsSuperMajority() in validation for BIP65 - Simplify RPC SoftForkMajorityDesc
* [backport] [rpc] getblockchaininfo: add size_on_disk, prune_target_size, ↵Daniel Edgecumbe2020-07-241-0/+6
| | | | | | | | | | automatic_pruning Fix pruneheight help text. Move fPruneMode block to match output ordering with help text. Add functional tests for new fields in getblockchaininfo. Rebase-from: bitcoin#b7dfc6c4
* Introduce basic Dogecoin brandingRoss Nicoll2019-03-251-3/+3
|
* Re-introduce alert functionality (#1470)Ross Nicoll2018-09-191-13/+3
| | | Re-introduce alert functionality removed from Bitcoin upstream
* Clean up RPC tests (#1465)Ross Nicoll2018-09-191-9/+9
| | | | | | | | | | * Enable full block tests * Fix invalidblocktest * Move watch only address funding to immediately before it's used, so node 0 doesn't spend the output before it checks it later. * Fix `fundrawtransaction` tests and sanitize fee calculation at the same time * Correct resolution of chain parameters when validating tx inputs, especially from previous coinbase transactions * Set block versions on full block tests so that the generated blocks are AuxPoW compatible
* Enforce minor Dogecoin parameters (#1427)Ross Nicoll2018-09-191-8/+7
| | | | | | * Minimum number of blocks and blockchain size are increased for pruning. In comparison to Bitcoin this uses 24 hours as a minimum, rather than 48, although given blocks are rarely full this likely reflects a lot longer in reality. * Multiply fork detection parameters by 5. The wall clock time elapsed for "long" forks is therefore half that of Bitcoin, but IMHO those figures are excessive for a chain with 1 minute block times. * BIP16 and BIP30 have both been enabled on Dogecoin since inception and should not be conditional.
* Always use parameters at block 0 to get genesis block hash (#1416)Ross Nicoll2018-09-191-2/+2
| | | This doesn't actually change behaviour, but stylistically is more correct.
* Move COINBASE_MATURITY to the consensus parameters (#1426)Ross Nicoll2018-09-191-3/+1
|
* 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
* Add Dogecoin current fee calculation logic (#1413)Ross Nicoll2018-09-191-1/+1
| | | Introduces 1 COIN/kb fees, rounded up to the next 1 COIN.
* Modify chain consensus parameters to be height aware (#1396)Ross Nicoll2018-09-191-51/+72
| | | | | | | | | * 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
* Change BIP65/66 enforcement to match Dogecoin (#1403)Ross Nicoll2018-09-191-4/+26
| | | | | | | | | | | | | | | | | | * Introduce first estimates at BIP lock-in blocks * Introduce Dogecoin BIP parameters * Re-introduce supermajority rules for BIP65 * Add BIP65 supermajority rules * Tighten v3 block constraints * Don't enforce coinbase in v2 blocks * Correct testnet majority params * Change to using base version when checking supermajority
* Merge AuxPoW support from NamecoreRoss Nicoll2018-09-191-9/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Litecoin: Scrypt n=1024 Pow hash based upon Colin Percival's Tarnsnap (2009) ↵Warren Togami2018-09-191-2/+2
| | | | Modified by Artforz, coblee, pooler, wtogami, Nikolay Belikov, Adrian Gallagher
* Add Dogecoin block subsidy calculations.Ross Nicoll2018-09-191-1/+2
|
* Replace consensus values with Dogecoin equivalentsRoss Nicoll2018-09-191-3/+7
| | | | | | | * Replace chain parameters with Dogecoin values * Update maximum coins to match Dogecoin * Disable version 2 block requirement * Update coinbase maturity to match Dogecoin
* Fix crash bug with duplicate inputs within a transactionSuhas Daftuar2018-09-181-1/+1
| | | | | | | | Introduced by #9049 Github-Pull: #14247 Tree-SHA512: 54ccf896e4c816ba8532644affc984a091ed801d8387bb01a836953c9ec4a345359d98fb58dd5f929617afd42bce0cc40293fecf943a1584207c82dd78da0ea5
* Make threshold for flushing more conservative.Alex Morcos2017-04-051-2/+3
| | | | | | | Always leave a reasonable buffer of 50MB for usage from newly connected block (once over 50%) and increase the high water mark buffer to 200MB. Github-Pull: #10133 Rebased-From: 1b55e07b7a61a9e6c299cf4c40fde80fa715d440
* Make pcoinsTip memory calculations consistentAlex Morcos2017-04-051-2/+2
| | | | | | | | Since we are more accurately measuring pcoinsTip peak usage at twice the current in dynamic usage, it makes sense to double the default (this will lead to the same effective usage and peak usage as previously). We should also double the buffer used to avoid flushing if above 90% but still sufficient space remaining. Github-Pull: #10133 Rebased-From: 5b95a190e8d7059039ce61e808d494dcf89ebb3b
* Make GetWitnessCommitmentIndex callable on blocks without a coinbase txn.Gregory Maxwell2017-04-041-3/+5
| | | | | | | This isn't actually needed anywhere, but it's less brittle. Github-Pull: #10146 Rebased-From: ada0caa165905b50db351a56ec124518c922085a
* Compensate for memory peak at flush timePieter Wuille2017-03-311-1/+1
| | | | | Github-Pull: #10126 Rebased-From: 7228ce853de5670d559d752f04a7db79578990ea
* Return errors from importmulti if complete rescans are not successfulRussell Yanofsky2017-02-221-1/+6
| | | | | Github-Pull: #9773 Rebased-From: e2e2f4c856363bbb0e3b5ba4df225f3754c3db39
* Read/write mempool.dat as a binary.Pavel Janík2017-02-211-2/+2
| | | | | | | | | mempool.dat is a binary file and thus it should be read/written as such. Fixes #9810. Github-Pull: #9813 Rebased-From: 171fc91f061d4a980eedfa522e302b8598408cc5
* Harden against mistakes handling invalid blocksSuhas Daftuar2017-02-151-5/+11
| | | | | | | | Fixes a bug in AcceptBlock() in invoking CheckBlock() with incorrect arguments, and restores a call to CheckBlock() from ProcessNewBlock() as belt-and-suspenders. Updates the (overspecified) tests to match behavior.
* Merge #9644: [refactor] Remove using namespace <xxx> from src/MarcoFalke2017-01-301-24/+22
|\ | | | | | | b7b48c8 Refactor: Remove using namespace <xxx> from src/*.cpp. (Karl-Johan Alm)
| * Refactor: Remove using namespace <xxx> from src/*.cpp.Karl-Johan Alm2017-01-271-24/+22
| |
* | Merge #9615: Wallet incremental feeWladimir J. van der Laan2017-01-301-2/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | 4b189c1 Change bumpfee result value from 'oldfee' to 'origfee'. (Alex Morcos) 0c0c63f Introduce WALLET_INCREMENTAL_RELAY_FEE (Alex Morcos) e8021ec Use CWallet::GetMinimumFee in bumpfee (Alex Morcos) ae9719a Refactor GetMinimumFee to give option of providing targetFee (Alex Morcos) fe8e8ef [rpc] Add incremental relay fee to getnetworkinfo (Alex Morcos) 6b331e6 Fix to have miner test aware of new separate block min tx fee (Alex Morcos) de6400d Fix missing use of dustRelayFee (Alex Morcos) 5b15870 Use incrementalRelayFee for BIP 125 replacement (Alex Morcos)
| * Use incrementalRelayFee for BIP 125 replacementAlex Morcos2017-01-191-2/+2
| |
* | Merge #9519: Exclude RBF replacement txs from fee estimationWladimir J. van der Laan2017-01-261-5/+7
|\ \ | | | | | | | | | de1ae32 Exclude RBF txs from fee estimation (Alex Morcos)
| * | Exclude RBF txs from fee estimationAlex Morcos2017-01-201-5/+7
| | |
* | | [Trivial] fix logging typo in FlushStateToDisk()John Newbery2017-01-241-1/+1
| | |
* | | Introduce MemPoolConflictRemovalTrackerAlex Morcos2017-01-231-0/+45
| | | | | | | | | | | | Analogue to ConnectTrace that tracks transactions that have been removed from the mempool due to conflicts and then passes them through SyncTransaction at the end of its scope.
* | | mempool: add notification for added/removed entriesWladimir J. van der Laan2017-01-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add notification signals to make it possible to subscribe to mempool changes: - NotifyEntryAdded(CTransactionRef)> - NotifyEntryRemoved(CTransactionRef, MemPoolRemovalReason)> Also add a mempool removal reason enumeration, which is passed to the removed notification based on why the transaction was removed from the mempool.
* | | Merge #9596: [bugfix] save feeDelta instead of priorityDelta in DumpMempoolPieter Wuille2017-01-231-1/+1
|\ \ \ | | | | | | | | | | | | bd92f24 [bugfix] save feeDelta instead of priorityDelta in DumpMempool (Alex Morcos)
| * | | [bugfix] save feeDelta instead of priorityDelta in DumpMempoolAlex Morcos2017-01-191-1/+1
| | |/ | |/|
* | | Merge #9511: Don't overwrite validation state with corruption checkWladimir J. van der Laan2017-01-231-3/+4
|\ \ \ | | | | | | | | | | | | 116419e Don't overwrite validation state with corruption check (Alex Morcos)
| * | | Don't overwrite validation state with corruption checkAlex Morcos2017-01-101-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AcceptToMemoryPool has several classes of return false statements. - return state.Invalid or state.DoS directly itself - return false and set fMissingInputs (state is valid) - return false and state is set by failed CheckTransaction - return false and state is set by failed CheckInputs. This commit patches the last case where the state variable was reused for additional calls to CheckInputs to identify witness stripping as cause of validation failure. After this commit, it should be the case that if !fMissingInputs, state is always Invalid if AcceptToMemoryPool returns false.