aboutsummaryrefslogtreecommitdiff
path: root/src/policy/policy.cpp
AgeCommit message (Collapse)Author
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-05Merge #13096: [Policy] Fix MAX_STANDARD_TX_WEIGHT checkWladimir J. van der Laan
2f1a30c63 Fix MAX_STANDARD_TX_WEIGHT check (Johnson Lau) Pull request description: As suggested by the constant name and its comment in policy.h, a transaction with a weight of exactly MAX_STANDARD_TX_WEIGHT should be allowed. Users could be confused. Tree-SHA512: af417de1c6a2e6796ebbb39aa0caad8764302ded155cb1bbfbe457e4567c199cc53256189832b17d4aeec369e190b3edd4c6116d5f0b8cf0ede6dfb4ed83bdd3
2018-05-29policy: Treat segwit as always activeMarcoFalke
2018-05-05Fix MAX_STANDARD_TX_WEIGHT checkJohnson Lau
As suggested by the constant name and its comment in policy.h, a transaction with a weight of exactly MAX_STANDARD_TX_WEIGHT should be allowed
2018-04-10Extract consts for WITNESS_V0 hash sizesBen Woosley
2018-03-27Merge #10742: scripted-diff: Use scoped enumerations (C++11, "enum class")Wladimir J. van der Laan
1f45e21 scripted-diff: Convert 11 enums into scoped enums (C++11) (practicalswift) Pull request description: Rationale (from Bjarne Stroustrup's ["C++11 FAQ"](http://www.stroustrup.com/C++11FAQ.html#enum)): > > The enum classes ("new enums", "strong enums") address three problems with traditional C++ enumerations: > > * conventional enums implicitly convert to int, causing errors when someone does not want an enumeration to act as an integer. > * conventional enums export their enumerators to the surrounding scope, causing name clashes. > * the underlying type of an enum cannot be specified, causing confusion, compatibility problems, and makes forward declaration impossible. > > The new enums are "enum class" because they combine aspects of traditional enumerations (names values) with aspects of classes (scoped members and absence of conversions). Tree-SHA512: 9656e1cf4c3cabd4378c7a38d0c2eaf79e4a54d204a3c5762330840e55ee7e141e188a3efb2b4daf0ef3110bbaff80d8b9253abf2a9b015cdc4d60b49ac2b914
2018-03-21Fix typospracticalswift
2018-03-09Calculate and store the number of bytes required to spend an inputAndrew Chow
2018-03-09scripted-diff: Convert 11 enums into scoped enums (C++11)practicalswift
-BEGIN VERIFY SCRIPT- sed -i 's/enum DBErrors/enum class DBErrors/g' src/wallet/walletdb.h git grep -l DB_ | xargs sed -i 's/DB_\(LOAD_OK\|CORRUPT\|NONCRITICAL_ERROR\|TOO_NEW\|LOAD_FAIL\|NEED_REWRITE\)/DBErrors::\1/g' sed -i 's/^ DBErrors::/ /g' src/wallet/walletdb.h sed -i 's/enum VerifyResult/enum class VerifyResult/g' src/wallet/db.h sed -i 's/\(VERIFY_OK\|RECOVER_OK\|RECOVER_FAIL\)/VerifyResult::\1/g' src/wallet/db.cpp sed -i 's/enum ThresholdState/enum class ThresholdState/g' src/versionbits.h git grep -l THRESHOLD_ | xargs sed -i 's/THRESHOLD_\(DEFINED\|STARTED\|LOCKED_IN\|ACTIVE\|FAILED\)/ThresholdState::\1/g' sed -i 's/^ ThresholdState::/ /g' src/versionbits.h sed -i 's/enum SigVersion/enum class SigVersion/g' src/script/interpreter.h git grep -l SIGVERSION_ | xargs sed -i 's/SIGVERSION_\(BASE\|WITNESS_V0\)/SigVersion::\1/g' sed -i 's/^ SigVersion::/ /g' src/script/interpreter.h sed -i 's/enum RetFormat {/enum class RetFormat {/g' src/rest.cpp sed -i 's/RF_\(UNDEF\|BINARY\|HEX\|JSON\)/RetFormat::\1/g' src/rest.cpp sed -i 's/^ RetFormat::/ /g' src/rest.cpp sed -i 's/enum HelpMessageMode {/enum class HelpMessageMode {/g' src/init.h git grep -l HMM_ | xargs sed -i 's/HMM_BITCOIN/HelpMessageMode::BITCOIN/g' sed -i 's/^ HelpMessageMode::/ /g' src/init.h sed -i 's/enum FeeEstimateHorizon/enum class FeeEstimateHorizon/g' src/policy/fees.h sed -i 's/enum RBFTransactionState/enum class RBFTransactionState/g' src/policy/rbf.h git grep -l RBF_ | xargs sed -i 's/RBF_TRANSACTIONSTATE_\(UNKNOWN\|REPLACEABLE_BIP125\|FINAL\)/RBFTransactionState::\1/g' sed -i 's/^ RBFTransactionState::/ /g' src/policy/rbf.h sed -i 's/enum BlockSource {/enum class BlockSource {/g' src/qt/clientmodel.h git grep -l BLOCK_SOURCE_ | xargs sed -i 's/BLOCK_SOURCE_\(NONE\|REINDEX\|DISK\|NETWORK\)/BlockSource::\1/g' sed -i 's/^ BlockSource::/ /g' src/qt/clientmodel.h sed -i 's/enum FlushStateMode {/enum class FlushStateMode {/g' src/validation.cpp sed -i 's/FLUSH_STATE_\(NONE\|IF_NEEDED\|PERIODIC\|ALWAYS\)/FlushStateMode::\1/g' src/validation.cpp sed -i 's/^ FlushStateMode::/ /g' src/validation.cpp sed -i 's/enum WitnessMode {/enum class WitnessMode {/g' src/test/script_tests.cpp sed -i 's/WITNESS_\(NONE\|PKH\|SH\)/WitnessMode::\1/g' src/test/script_tests.cpp sed -i 's/^ WitnessMode::/ /g' src/test/script_tests.cpp -END VERIFY SCRIPT-
2018-01-03Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa
2017-11-16scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider
-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-
2017-09-28Implement BIP173 addresses and testsPieter Wuille
2017-09-06Merge #10682: Trivial: Move the AreInputsStandard documentation next to its ↵MarcoFalke
implementation ca67ddf0b Move the AreInputsStandard documentation next to its implementation (esneider) Pull request description: The documentation (and rationale) for `AreInputsStandard` somehow got separated from its implementation, and creates a bit of confusion: it's in the middle of the file, next to the implementation of `IsStandard`, which actually checks the "standardness" of outputs, not inputs. Tree-SHA512: 71281cbcbc5a5701cc11e812a3e90669dda3d92dc2176b512b7832d79b08b34307999c984516bb0c56b01db9b03a12ee4755f662efc1158f4e126de5ca421999
2017-07-17Remove factor of 3 from definition of dust.Alex Morcos
This redefines dust to be the value of an output such that it would cost that value in fees to (create and) spend the output at the dust relay rate. The previous definition was that it would cost 1/3 of the value. The default dust relay rate is correspondingly increased to 3000 sat/kB so the actual default dust output value of 546 satoshis for a non-segwit output remains unchanged. This commit is a refactor only unless a dustrelayfee is passed on the commandline in which case that number now needs to be increased by a factor of 3 to get the same behavior. -dustrelayfee is a hidden command line option. Note: It's not exactly a refactor due to edge case changes in rounding as evidenced by the required change to the unit test.
2017-07-14Remove confusing MAX_BLOCK_BASE_SIZE.Gregory Maxwell
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.
2017-06-27Move the AreInputsStandard documentation next to its implementationesneider
2017-06-22scripted-diff: Remove #include <boost/foreach.hpp>Jorge Timón
-BEGIN VERIFY SCRIPT- sed -i ':a;N;$!ba;s/#include <boost\/foreach.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp -END VERIFY SCRIPT-
2017-06-05scripted-diff: Fully remove BOOST_FOREACHJorge Timón
-BEGIN VERIFY SCRIPT- sed -i 's/BOOST_FOREACH *(\(.*\),/for (\1 :/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ; -END VERIFY SCRIPT-
2017-06-01Merge CCoinsViewCache's GetOutputFor and AccessCoinPieter Wuille
They're doing the same thing now.
2017-05-19Prevent shadowing the global dustRelayFee.Pavel Janík
2017-05-03Consensus: Minimal way to move dust out of consensusJorge Timón
2017-04-13Missing includesJorge Timón
2017-01-16Introduce -dustrelayfeeAlex Morcos
2017-01-16Introduce -incrementalrelayfeeAlex Morcos
2016-12-04Move CTxInWitness inside CTxInPieter Wuille
2016-12-02Rename the remaining main.{h,cpp} to validation.{h,cpp}Matt Corallo
2016-11-14update comments for tx weightBrian Deery
2016-11-06[copyright] copyright header style uniformisle2983
Three categories of modifications: 1) 1 instance of 'The Bitcoin Core developers \n', 1 instance of 'the Bitcoin Core developers\n', 3 instances of 'Bitcoin Core Developers\n', and 12 instances of 'The Bitcoin developers\n' are made uniform with the 443 instances of 'The Bitcoin Core developers\n' 2) 3 instances of 'BitPay, Inc\.\n' are made uniform with the other 6 instances of 'BitPay Inc\.\n' 3) 4 instances where there was no '(c)' between the 'Copyright' and the year where it deviates from the style of the local directory.
2016-10-16Add standard limits for P2WSH with testsJohnson Lau
2016-07-26Merge #8381: Make witness v0 outputs non-standardWladimir J. van der Laan
c59c434 qa: Add test for standardness of segwit v0 outputs (Suhas Daftuar) 1ffaff2 Make witness v0 outputs non-standard before segwit activation (Johnson Lau)
2016-07-23qa: Add test for standardness of segwit v0 outputsSuhas Daftuar
2016-07-22Make witness v0 outputs non-standard before segwit activationJohnson Lau
2016-07-19Treat high-sigop transactions as larger rather than rejecting themPieter Wuille
2016-07-18Rename "block cost" to "block weight"Suhas Daftuar
2016-06-22BIP141: Other consensus critical limits, and BIP145Pieter Wuille
Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
2016-06-22BIP143: Verification logicPieter Wuille
Includes simplifications by Eric Lombrozo.
2016-04-08Doc: Update isStandardTx commentMatthew English
2016-03-18Policy: allow transaction version 2 relay policy.BtcDrak
This commit introduces a way to gracefully bump the default transaction version in a two step process.
2016-02-01Get rid of inaccurate ScriptSigArgsExpectedPieter Wuille
(cherry picked from commit 52b29dca7670c3f6d2ab918c0fff1d17c4e494ad)
2016-01-07Merge pull request #7266Wladimir J. van der Laan
6cd198f Removed comment about IsStandard for P2SH scripts (Marcel Krüger)
2015-12-30Removed comment about IsStandard for P2SH scriptsMarcel Krüger
Since #4365 (62599373883a66a958136f48ab0e2b826e3d5bf8) P2SH scripts do not have to be IsStandard scripts.
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-11-28Constrain constant values to a single location in codeLuke Dashjr
2015-10-01Accept any sequence of PUSHDATAs in OP_RETURN outputsPeter Todd
Previously only one PUSHDATA was allowed, needlessly limiting applications such as matching OP_RETURN contents with bloom filters that operate on a per-PUSHDATA level. Now any combination that passes IsPushOnly() is allowed, so long as the total size of the scriptPubKey is less than 42 bytes. (unchanged modulo non-minimal PUSHDATA encodings) Also, this fixes the odd bug where previously the PUSHDATA could be replaced by any single opcode, even sigops consuming opcodes such as CHECKMULTISIG. (20 sigops!)
2015-06-26Policy: MOVEONLY: 3 functions to policy.o:Luke Dashjr
- [script/standard.o] IsStandard - [main.o] IsStandardTx - [main.o] AreInputsStandard Also, don't use namespace std in policy.cpp