aboutsummaryrefslogtreecommitdiff
path: root/src/bloom.cpp
Commit message (Collapse)AuthorAgeFilesLines
* scripted-diff: TxoutType C++11 scoped enum classMarcoFalke2020-06-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- # General rename helper: $1 -> $2 rename_global() { sed -i "s/\<$1\>/$2/g" $(git grep -l "$1"); } # Helper to rename TxoutType $1 rename_value() { sed -i "s/ TX_$1,/ $1,/g" src/script/standard.h; # First strip the prefix in the definition (header) rename_global TX_$1 "TxoutType::$1"; # Then replace globally } # Change the type globally to bring it in line with the style-guide # (clsses are UpperCamelCase) rename_global 'enum txnouttype' 'enum class TxoutType' rename_global 'txnouttype' 'TxoutType' # Now rename each enum value rename_value 'NONSTANDARD' rename_value 'PUBKEY' rename_value 'PUBKEYHASH' rename_value 'SCRIPTHASH' rename_value 'MULTISIG' rename_value 'NULL_DATA' rename_value 'WITNESS_V0_KEYHASH' rename_value 'WITNESS_V0_SCRIPTHASH' rename_value 'WITNESS_UNKNOWN' -END VERIFY SCRIPT-
* net: remove is{Empty,Full} flags from CBloomFilter, clarify CVE fixSebastian Falbesoner2020-04-281-23/+3
|
* refactor: Remove unused methods CBloomFilter::reset()/clear()Sebastian Falbesoner2020-04-171-13/+0
| | | | Co-authored-by: MarcoFalke <[email protected]>
* scripted-diff: Bump copyright of files changed in 2019MarcoFalke2019-12-301-1/+1
| | | | | | -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
* refactor: Improve CRollingBloomFilter::reset by using std::fillJoão Barbosa2019-05-221-3/+2
|
* Merge #13429: Return the script type from SolverWladimir J. van der Laan2018-08-251-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 984d72ec659361d8c1a6f3c6864e839a807817a7 Return the script type from Solver (Ben Woosley) Pull request description: Because false is synonymous with TX_NONSTANDARD, this conveys the same information and makes the handling explicitly based on script type, simplifying each call site. Prior to this change it was common for the return value to be ignored, or for the return value and TX_NONSTANDARD to be redundantly handled. Tree-SHA512: 31864f856b8cb75f4b782d12678070e8b1cfe9665c6f57cfb25e7ac8bcea8a22f9a78d7c8cf0101c841f2a612400666fb91798bffe88de856e98b873703b0965
| * Return the script type from SolverBen Woosley2018-07-221-3/+3
| | | | | | | | | | | | | | | | | | Because false is synonymous with TX_NONSTANDARD, this conveys the same information and makes the handling explicitly based on script type, simplifying each call site. Prior to this change it was common for the return value to be ignored, or for the return value and TX_NONSTANDARD to be redundantly handled.
* | Removes unsed `CBloomFilter` constructor.2512018-08-131-11/+0
| | | | | | | | This commit removes the `CBloomFilter::CBloomFilter(const unsigned int, const double, const unsigned int)` constructor, which became obsolete with 086ee67.
* | Update copyright headers to 2018DrahtBot2018-07-271-1/+1
| |
* | 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-
* replace modulus with FastModMartin Ankerl2018-05-061-2/+11
| | | | | | | | | | | | Replaces the slow modulo operation with a much faster 32bit multiplication & shift. This works because the hash should be uniformly distributed between 0 and 2^32-1. This speeds up the benchmark by a factor of about 1.3: RollingBloom, 5, 1500000, 3.73733, 4.97569e-07, 4.99002e-07, 4.98372e-07 # before RollingBloom, 5, 1500000, 2.86842, 3.81630e-07, 3.83730e-07, 3.82473e-07 # FastMod Be aware that this changes the position of the bits that are toggled, so this should probably not be used for CBloomFilter which is serialized.
* Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
|
* scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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-
* scripted-diff: Remove #include <boost/foreach.hpp>Jorge Timón2017-06-221-1/+0
| | | | | | -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-
* scripted-diff: Fully remove BOOST_FOREACHJorge Timón2017-06-051-1/+1
| | | | | | -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-
* Merge #9750: Bloomfilter: parameter variables made constantWladimir J. van der Laan2017-05-181-4/+4
|\ | | | | | | | | | | 64aa36e param variables made const (ロハン ダル) Tree-SHA512: 7c19f9e7dd574c8ce8a9468555f27196735b583efe349c1309c90e1e5d2949daf6891574b4bea7122d6c6aca0c7ee4a782fe3d24918d889f7bf89227084a51cd
| * param variables made constロハン ダル2017-02-131-4/+4
| |
* | Fix msvc compiler error C4146 (minus operator applied to unsigned type)kobake2017-03-071-2/+2
|/ | | | | On msvc14, the compiler error C4146 (unary minus operator applied to unsigned type, result still unsigned) had been occured. Use '0 - x' styled formula instead of '-x' so as to fix the error.
* Refactor: Remove using namespace <xxx> from src/*.cpp.Karl-Johan Alm2017-01-271-15/+13
|
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* trivial: fix bloom filter init to isEmpty = trueRobert McLaughlin2016-11-011-1/+1
| | | | | | | Fixes newly initialized bloom filters being constructed with isEmpty(false), which still works but loses the possible speedup when checking for key membership in an empty filter.
* Do not shadow variablesPavel Janík2016-09-271-4/+4
|
* More efficient bitsliced rolling Bloom filterPieter Wuille2016-04-281-13/+27
| | | | | | | This patch changes the implementation from one that stores 16 2-bit integers in one uint32_t's, to one that stores the first bit of 64 2-bit integers in one uint64_t and the second bit in another. This allows for 450x faster refreshing and 2.2x faster average speed.
* Merge pull request #7205Wladimir J. van der Laan2016-01-051-1/+1
|\ | | | | | | | | | | fa71669 [devtools] Use git pretty-format for year parsing (MarcoFalke) fa24439 Bump copyright headers to 2015 (MarcoFalke) fa6ad85 [devtools] Rewrite fix-copyright-headers.py (MarcoFalke)
| * Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
| |
* | Switch to a more efficient rolling Bloom filterPieter Wuille2015-11-281-24/+53
|/ | | | | | | | | | | | | | | | For each 'bit' in the filter we really maintain 2 bits, which store either: 0: not set 1-3: set in generation N After (nElements / 2) insertions, we switch to a new generation, and wipe entries which already had the new generation number, effectively switching from the last 1.5 * nElements set to the last 1.0 * nElements set. This is 25% more space efficient than the previous implementation, and can (at peak) store 1.5 times the requested amount of history (though only 1.0 times the requested history is guaranteed). The existing unit tests should be sufficient.
* Only use randomly created nonces in CRollingBloomFilter.Pieter Wuille2015-07-271-7/+6
|
* Make CRollingBloomFilter set nTweak for youPeter Todd2015-07-271-4/+15
| | | | | | | | | | | | While CBloomFilter is usually used with an explicitly set nTweak, CRollingBloomFilter is only used internally. Requiring every caller to set nTweak is error-prone and redundant; better to have the class handle that for you with a high-quality randomness source. Additionally when clearing the filter it makes sense to change nTweak as well to recover from a bad setting, e.g. due to insufficient randomness at initialization, so the clear() method is replaced by a reset() method that sets a new, random, nTweak value.
* Reuse vector hashing code for uint256Pieter Wuille2015-07-271-14/+4
|
* Add uint256 support to CRollingBloomFilterPeter Todd2015-07-271-0/+22
|
* Rolling bloom filter classGavin Andresen2015-04-301-16/+67
| | | | | | | For when you need to keep track of the last N items you've seen, and can tolerate some false-positives. Rebased-by: Pieter Wuille <[email protected]>
* Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* MOVEONLY: core/ -> primitives/Luke Dashjr2014-12-031-1/+1
|
* Convert remaining comments in /src to doxygen formatMichael Ford2014-11-211-8/+12
| | | | | | | | | | - Update comments in checkpoints to be doxygen compatible - Update comments in checkqueue to be doxygen compatible - Update coins to be doxygen compatible - Fix comment typo in crypter.h - Update licenses/copyright dates Closes #5325 #5184 #5183 #5182
* boost: moveonly: split CPubKey and friends to new filesCory Fields2014-10-311-0/+1
|
* MOVEONLY: Separate CTransaction and dependencies from corejtimon2014-10-271-1/+1
|
* boost: split stream classes out of serialize.hCory Fields2014-10-221-0/+1
| | | | serialization now has no dependencies.
* Separate script/standardjtimon2014-09-081-1/+2
|
* Rename script.h/.cpp to scriptutils.h/.cpp (plus remove duplicated includes)jtimon2014-09-081-1/+1
|
* Discover some missing includesjtimon2014-09-021-0/+2
|
* CBloomFilter::clear() methodTom Harding2014-07-211-0/+7
|
* Revert "CBloomFilter::clear() method"Wladimir J. van der Laan2014-07-211-7/+0
| | | | This reverts commit 8fbf03995df9a2003be603be1a930bc3373d56e0.
* CBloomFilter::clear() methodTom Harding2014-06-271-0/+7
|
* Code simplifications after CTransaction::GetHash() cachingPieter Wuille2014-06-221-1/+2
|
* Fix bloom filter not to use bit_maskperyaudo2014-03-201-4/+2
|
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-2/+4
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Performance optimization for bloom filters.Gregory Maxwell2013-08-201-2/+24
| | | | | | | | This reduces a peer's ability to attack network resources by using a full bloom filter, but without reducing the usability of bloom filters. It sets a default match everything filter for peers and it generalizes a prior optimization to cover more cases.
* main.h->core.h include dependency improvements.Jeff Garzik2013-06-241-1/+1
|
* Short-circuit bloom checking if we will always return true.Matt Corallo2013-02-241-0/+4
| | | | This allows full nodes to use bloom filters as an optimization.
* Add nFlags to CBloomFilter to make filter updating optional.Matt Corallo2013-01-161-3/+13
|