Commit Graph

30 Commits

Author SHA1 Message Date
Simon 805344dcf4 Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
Simon 10d2c57c0d Replace calls to GetHash() with GetTxid() for transaction objects.
Where the caller intends to receive a transaction id and not a double
SHA256 hash.
2016-07-26 17:13:03 -07:00
Pieter Wuille 6eed52e05b Only use randomly created nonces in CRollingBloomFilter.
(cherry picked from commit d741371d7d27e228aa64c618c50b23fb5449c3e1)
2015-10-02 12:17:49 +02:00
Peter Todd 83671efe99 Make CRollingBloomFilter set nTweak for you
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.

(cherry picked from commit d2d7ee0e863b286e1c9f9c54659d494fb0a7712d)
2015-10-02 12:17:44 +02:00
Pieter Wuille 25cf1220e6 Reuse vector hashing code for uint256
(cherry picked from commit a3d65fedaa18686f0cc007d0a13dba6545250300)
2015-10-02 12:17:38 +02:00
Peter Todd 2983fe0484 Add uint256 support to CRollingBloomFilter
(cherry picked from commit bbe41088c61f2ad328766e851ffe6169aa80935a)
2015-10-02 12:17:21 +02:00
Gavin Andresen 69a5f8be0a Rolling bloom filter class
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 <pieter.wuille@gmail.com>
2015-04-30 07:58:29 -07:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Luke Dashjr d227011184 MOVEONLY: core/ -> primitives/ 2014-12-03 10:52:58 +00:00
Michael Ford fa94b9d562
Convert remaining comments in /src to doxygen format
- 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
2014-11-21 14:44:21 +01:00
Cory Fields d2e74c55bd boost: moveonly: split CPubKey and friends to new files 2014-10-31 01:19:37 -04:00
jtimon 4a3587d8db MOVEONLY: Separate CTransaction and dependencies from core 2014-10-27 13:54:37 +01:00
Cory Fields fa7361907a boost: split stream classes out of serialize.h
serialization now has no dependencies.
2014-10-22 15:21:06 -04:00
jtimon c4408a6c85 Separate script/standard 2014-09-08 20:21:35 +02:00
jtimon 86dbeea2cd Rename script.h/.cpp to scriptutils.h/.cpp (plus remove duplicated includes) 2014-09-08 20:19:31 +02:00
jtimon 53efb09e4c Discover some missing includes 2014-09-02 02:27:03 +02:00
Tom Harding 9c347313f7 CBloomFilter::clear() method 2014-07-21 11:50:07 -07:00
Wladimir J. van der Laan 8f3f94a470 Revert "CBloomFilter::clear() method"
This reverts commit 8fbf03995d.
2014-07-21 07:46:34 +02:00
Tom Harding 8fbf03995d CBloomFilter::clear() method 2014-06-27 07:54:21 -07:00
Pieter Wuille d38da59bf6 Code simplifications after CTransaction::GetHash() caching 2014-06-22 00:06:17 +02:00
peryaudo b1b9c76262 Fix bloom filter not to use bit_mask 2014-03-20 13:21:23 +09:00
Brandon Dahler 51ed9ec971 Cleanup code using forward declarations.
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.
2013-11-10 09:36:28 -06:00
Gregory Maxwell 37c6389c5a Performance optimization for bloom filters.
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.
2013-08-20 02:27:26 -07:00
Jeff Garzik 79f6925fac main.h->core.h include dependency improvements. 2013-06-24 10:41:16 -04:00
Matt Corallo cbfc77352d Short-circuit bloom checking if we will always return true.
This allows full nodes to use bloom filters as an optimization.
2013-02-24 20:36:59 -05:00
Matt Corallo e1a4f3778c Add nFlags to CBloomFilter to make filter updating optional. 2013-01-16 14:34:06 -05:00
Matt Corallo b1f99bed6f Add a nTweak to bloom filters to tweak the seed. 2013-01-16 12:48:02 -05:00
Matt Corallo d3b26f7077 Automatically add any matching outputs to a filter during matching. 2013-01-16 12:48:02 -05:00
Matt Corallo 269d9c6492 Replace RelayMessage with RelayTransaction. 2013-01-16 12:48:02 -05:00
Matt Corallo bd21612c37 Add a CBloomFilter class for use as a transaction filter. 2013-01-16 12:48:01 -05:00