aboutsummaryrefslogtreecommitdiff
path: root/src/consensus
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright headers to 2018DrahtBot2018-12-291-1/+1
|
* scripted-diff: Move util files to separate directory.Jim Posen2018-11-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- mkdir -p src/util git mv src/util.h src/util/system.h git mv src/util.cpp src/util/system.cpp git mv src/utilmemory.h src/util/memory.h git mv src/utilmoneystr.h src/util/moneystr.h git mv src/utilmoneystr.cpp src/util/moneystr.cpp git mv src/utilstrencodings.h src/util/strencodings.h git mv src/utilstrencodings.cpp src/util/strencodings.cpp git mv src/utiltime.h src/util/time.h git mv src/utiltime.cpp src/util/time.cpp sed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h sed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h sed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h sed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h sed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h sed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am sed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am sed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am sed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am sed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am sed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh sed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh sed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh sed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh sed -i 's/src\\utilstrencodings\.cpp/src\\util\\strencodings\.cpp/' build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj -END VERIFY SCRIPT-
* Drop unused GetType() from CSizeComputerBen Woosley2018-09-112-4/+4
|
* Update copyright headers to 2018DrahtBot2018-07-276-6/+6
|
* scripted-diff: Remove trailing whitespacesJoão Barbosa2018-07-241-1/+1
| | | | | | | | -BEGIN VERIFY SCRIPT- sed --in-place'' --regexp-extended 's/[[:space:]]+$//g' $(git grep -I --files-with-matches --extended-regexp '[[:space:]]+$' -- src test ':!*.svg' ':!src/crypto/sha256_sse4*' ':!src/leveldb' ':!src/qt/locale' ':!src/secp256k1' ':!src/univalue') -END VERIFY SCRIPT-
* [MOVEONLY] Move unused Merkle branch code to testsPieter Wuille2018-05-292-124/+1
|
* Use SHA256D64 in Merkle root computationPieter Wuille2018-05-292-7/+20
|
* Use P2SH consensus rules for all blocksSuhas Daftuar2018-04-131-2/+2
| | | | | | This commit moves P2SH activation back to the genesis block, with a hardcoded exception for the one historical block in the chain that violated this rule.
* Fix missing or inconsistent include guardspracticalswift2018-03-221-3/+3
|
* Fix typospracticalswift2018-03-211-1/+1
|
* Calculate and store the number of bytes required to spend an inputAndrew Chow2018-03-091-0/+5
|
* Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-035-5/+5
|
* scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-166-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* Merge #10749: Use compile-time constants instead of unnamed enumerations ↵MarcoFalke2017-11-111-7/+4
|\ | | | | | | | | | | | | | | | | | | | | | | (remove "enum hack") 1e65f0f33 Use compile-time constants instead of unnamed enumerations (remove "enum hack") (practicalswift) Pull request description: Use compile-time constants instead of unnamed enumerations (remove "enum hack"). Tree-SHA512: 1b6ebb2755398c5ebab6cce125b1dfc39cbd1504d98d55136b32703fe935c4070360ab3b2f52b1da48ba9f3b01082d204f3d87c92ccb5c8c333731f7f972e128
| * Use compile-time constants instead of unnamed enumerations (remove "enum hack")practicalswift2017-07-261-7/+4
| |
* | Always-active versionbits supportPieter Wuille2017-11-061-0/+6
| |
* | [consensus] Pin P2SH activation to block 173805 on mainnetJohn Newbery2017-11-061-0/+2
| |
* | Improve handling of BIP9Deployment limitsAnthony Towns2017-11-061-0/+4
| | | | | | | | Small tweaks by Pieter Wuille.
* | Merge #8498: Near-Bugfix: Optimization: Minimize the number of times it is ↵Wladimir J. van der Laan2017-10-112-39/+42
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | checked that no money... 4e955c5 Near-Bugfix: Reestablish consensus check removed in 8d7849b (Jorge Timón) 3e8c916 Introduce CheckInputsAndUpdateCoins static wrapper in txmempool.cpp (Jorge Timón) 832e074 Optimization: Minimize the number of times it is checked that no money is created (Jorge Timón) 3f0ee3e Proper indentation for CheckTxInputs and other minor fixes (Jorge Timón) Pull request description: ...is created by individual transactions to 2 places (but call only once in each): - ConnectBlock ( before calculated fees per txs twice ) - AcceptToMemoryPoolWorker ( before called CheckTxInputs 4 times and calculated fees per tx one extra time ) Also call tx.GetValueOut() only once per call of CheckTxInputs (instead of 2) For more motivation: ~~https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L1493~~ https://github.com/jtimon/bitcoin/compare/0.13-consensus-inputs...jtimon:0.13-consensus-inputs-comments EDIT: partially replaces #6445 Near-Bugfix as pointed out in https://github.com/bitcoin/bitcoin/pull/8498#discussion_r124346132 Tree-SHA512: c71188e7c7c2425c9170ed7b803896755a92fd22f43b136eedaa6e554106696f0b10271d0ef0d0127c1eaafbc31d12eb19143df4f1b6882feecedf6ef05ea346
| * | Optimization: Minimize the number of times it is checked that no money is ↵Jorge Timón2017-09-202-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | created by individual transactions to 2 places (but call only once in each): - ConnectBlock ( before calculated fees per txs twice ) - AcceptToMemoryPoolWorker ( before called CheckTxInputs 4 times and calculated fees per tx one extra time ) Also call tx.GetValueOut() only once per call of CheckTxInputs (instead of 2)
| * | Proper indentation for CheckTxInputs and other minor fixesJorge Timón2017-09-071-37/+39
| | |
* | | Trivial: Fix validation commentsDan Raviv2017-09-151-6/+5
| | | | | | | | | | | | | | | | | | - Move comment about transaction/block weight calculation so it applies not only to the GetBlockWeight function but also to GetTransactionWeight - Fix comment in validation.cpp referencing future deployment of BIP113. It has already been deployed. - The doc comment for BLOCK_DOWNLOAD_WINDOW wasn't updated since pruning was introduced, so it still refers to pruning as something that might happen in the future. A larger BLOCK_DOWNLOAD_WINDOW window would now, indeed, make pruning harder.
* | | scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal ↵practicalswift2017-08-072-5/+5
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | instead of the macro NULL -BEGIN VERIFY SCRIPT- sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp -END VERIFY SCRIPT-
* | Fix typospracticalswift2017-07-151-1/+1
| |
* | Remove confusing MAX_BLOCK_BASE_SIZE.Gregory Maxwell2017-07-143-9/+25
|/ | | | | | | | | | | | | | | | | | Some people keep thinking that MAX_BLOCK_BASE_SIZE is a separate size limit from the weight limit when it fact it is superfluous, and used in early tests before the witness data has been validated or just to compute worst case sizes. The size checks that use it would not behave any differently consensus wise if they were eliminated completely. Its correct value is not independently settable but is a function of the weight limit and weight formula. This patch just eliminates it and uses the scale factor as required to compute the worse case constants. It also moves the weight factor out of primitives into consensus, which is a more logical place for it.
* Merge #10608: Add a comment explaining the use of MAX_BLOCK_BASE_SIZE.Wladimir J. van der Laan2017-06-241-1/+7
|\ | | | | | | | | | | 1887337 Add a comment explaining the use of MAX_BLOCK_BASE_SIZE. (Gregory Maxwell) Tree-SHA512: 4c643a3696241fbf4eac8d58bb26586f319338b28ee86d20394a8ea362911b467853eb40c43487ede753209a3c7bee2e576d2ca80627e9fc924fabefbcaea34b
| * Add a comment explaining the use of MAX_BLOCK_BASE_SIZE.Gregory Maxwell2017-06-161-1/+7
| |
* | Merge #10537: Few Minor per-utxo assert-semantics re-adds and tweakPieter Wuille2017-06-201-2/+6
|\ \ | |/ |/| | | | | | | | | | | | | 9417d7a33 Be much more agressive in AccessCoin docs. (Matt Corallo) f58349ca8 Restore some assert semantics in sigop cost calculations (Matt Corallo) 3533fb4d3 Return a bool in SpendCoin to restore pre-per-utxo assert semantics (Matt Corallo) ec1271f2b Remove useless mapNextTx lookup in CTxMemPool::TrimToSize. (Matt Corallo) Tree-SHA512: 158a4bce063eac93e1d50709500a10a7cb1fb3271f10ed445d701852fce713e2bf0da3456088e530ab005f194ef4a2adf0c7cb23226b160cecb37a79561f29ca
| * Restore some assert semantics in sigop cost calculationsMatt Corallo2017-06-091-2/+6
| | | | | | | | | | | | | | There are some similar asserts which are left removed in policy and ATMP (policy code being broken isn't a huge deal, but if we fail to verify some consensus rules, we should most definitely crash).
* | Comment out unused constant REJECT_DUSTpracticalswift2017-06-091-1/+1
|/
* scripted-diff: various renames for per-utxo consistencyPieter Wuille2017-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | Thanks to John Newberry for pointing these out. -BEGIN VERIFY SCRIPT- sed -i 's/\<GetCoins\>/GetCoin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<HaveCoins\>/HaveCoin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<HaveCoinsInCache\>/HaveCoinInCache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<IsPruned\>/IsSpent/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<FetchCoins\>/FetchCoin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<CoinsEntry\>/CoinEntry/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<vHashTxnToUncache\>/coins_to_uncache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<vHashTxToUncache\>/coins_to_uncache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<fHadTxInCache\>/had_coin_in_cache/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<coinbaseids\>/coinbase_coins/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<disconnectedids\>/disconnected_coins/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<duplicateids\>/duplicate_coins/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h sed -i 's/\<oldcoins\>/old_coin/g' src/test/coins_tests.cpp sed -i 's/\<origcoins\>/orig_coin/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h -END VERIFY SCRIPT-
* Merge CCoinsViewCache's GetOutputFor and AccessCoinPieter Wuille2017-06-011-2/+2
| | | | They're doing the same thing now.
* Switch from per-tx to per-txout CCoinsViewCache methods in some placesPieter Wuille2017-06-011-7/+7
|
* MOVEONLY: tx functions to consensus/tx_verify.oJorge Timón2017-04-062-0/+324
| | | | Functions related to transaction verification.
* [trivial] Fix typos in commentspracticalswift2017-01-271-1/+1
|
* Introduce assumevalid setting to skip presumed valid scripts.Gregory Maxwell2017-01-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This disentangles the script validation skipping from checkpoints. A new option is introduced "assumevalid" which specifies a block whos ancestors we assume all have valid scriptsigs and so we do not check them when they are also burried under the best header by two weeks worth of work. Unlike checkpoints this has no influence on consensus unless you set it to a block with an invalid history. Because of this it can be easily be updated without risk of influencing the network consensus. This results in a massive IBD speedup. This approach was independently recommended by Peter Todd and Luke-Jr since POW based signature skipping (see PR#9180) does not have the verifiable properties of a specific hash and may create bad incentives. The downside is that, like checkpoints, the defaults bitrot and older releases will sync slower. On the plus side users can provide their own value here, and if they set it to something crazy all that will happen is more time will be spend validating signatures. Checkblocks and checklevel are also moved to the hidden debug options: Especially now that checkblocks has a low default there is little need to change these settings, and users frequently misunderstand them as influencing security or IBD speed. By hiding them we offset the space added by this new option.
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-314-4/+4
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Make CBlock::vtx a vector of shared_ptr<CTransaction>Pieter Wuille2016-11-191-3/+3
|
* IBD check uses minimumchain work instead of checkpoints.Gregory Maxwell2016-11-021-0/+1
| | | | | | | | | | | | | This introduces a 'minimum chain work' chainparam which is intended to be the known amount of work in the chain for the network at the time of software release. If you don't have this much work, you're not yet caught up. This is used instead of the count of blocks test from checkpoints. This criteria is trivial to keep updated as there is no element of subjectivity, trust, or position dependence to it. It is also a more reliable metric of sync status than a block count.
* Define start and end time for segwit deploymentPieter Wuille2016-10-171-1/+1
|
* Merge #8607: [doc] Fix doxygen off-by-one comments, fix typosWladimir J. van der Laan2016-08-281-3/+3
|\ | | | | | | | | | | | | fafe7b3 contrib: Make fix-copyright-headers.py more portable (MarcoFalke) fa27c0a [doc] Fix typos in comments, doxygen: Fix comment syntax (MarcoFalke) fabfd5d [qa] pull-tester: Don't mute zmq ImportError (MarcoFalke) 67a5502 init: Fix typo in help message for -whitelistforcerelay (Wladimir J. van der Laan)
| * [doc] Fix typos in comments, doxygen: Fix comment syntaxMarcoFalke2016-08-221-3/+3
| |
* | Consensus: Remove ISMNicolasDorier2016-07-231-4/+4
| |
* | Rename "block cost" to "block weight"Suhas Daftuar2016-07-181-2/+2
|/
* BIP141: Other consensus critical limits, and BIP145Pieter Wuille2016-06-221-3/+9
| | | | Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
* BIP141: Commitment structure and deploymentPieter Wuille2016-06-224-0/+21
| | | | Includes a fix by Suhas Daftuar and LongShao007
* Implement BIP 9 GBT changesLuke Dashjr2016-06-061-0/+1
| | | | | | | - BIP9DeploymentInfo struct for static deployment info - VersionBitsDeploymentInfo: Avoid C++11ism by commenting parameter names - getblocktemplate: Make sure to set deployments in the version if it is LOCKED_IN - In this commit, all rules are considered required for clients to support
* Add CHECKSEQUENCEVERIFY softfork through BIP9Pieter Wuille2016-03-181-0/+1
|
* Add testing of ComputeBlockVersionSuhas Daftuar2016-03-151-1/+2
|
* BIP9 ImplementationPieter Wuille2016-03-151-0/+28
| | | | | Inspired by former implementations by Eric Lombrozo and Rusty Russell, and based on code by Jorge Timon.