Refactor and add tests for BlockFilter construction#14172
Merged
maflcko merged 3 commits intobitcoin:masterfrom Dec 22, 2018
Merged
Refactor and add tests for BlockFilter construction#14172maflcko merged 3 commits intobitcoin:masterfrom
maflcko merged 3 commits intobitcoin:masterfrom
Conversation
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
a3d9b90 to
22fd588
Compare
22fd588 to
c306209
Compare
jamesob
approved these changes
Dec 11, 2018
|
|
||
| /** Constructs an empty filter. */ | ||
| GCSFilter(uint64_t siphash_k0 = 0, uint64_t siphash_k1 = 0, uint8_t P = 0, uint32_t M = 0); | ||
| explicit GCSFilter(const Params& params = Params()); |
Contributor
There was a problem hiding this comment.
Confused about why this is marked explicit...
Contributor
Author
There was a problem hiding this comment.
Developer notes: "By default, declare single-argument constructors explicit"
maflcko
approved these changes
Dec 11, 2018
src/blockfilter.cpp
Outdated
| params.m_M = BASIC_FILTER_M; | ||
| break; | ||
|
|
||
| default: |
Member
There was a problem hiding this comment.
nit: Could remove the default case (which is a failure) to make it a compile time warning instead of a run time exception
Suggested change
| default: | |
| // no default case, so the compiler can warn about missing cases |
Example:
blockfilter.cpp:247:13: warning: enumeration value 'BASIC' not handled in switch [-Wswitch]
switch (m_filter_type) {
^
Contributor
Author
There was a problem hiding this comment.
Oh, cool. Didn't realize C++ compilers did that analysis on switch statements.
Now the compiler will warn if not all enums are handled in the switch.
maflcko
pushed a commit
that referenced
this pull request
Dec 22, 2018
e4ed8ce blockfilter: Remove default clause in switch statement. (Jim Posen) c306209 blockfilter: Additional constructors for BlockFilter. (Jim Posen) 20b8129 blockfilter: Refactor GCS params into struct. (Jim Posen) Pull request description: These commits have been split out of #14121 because they are fairly independent and that PR is very large. Tree-SHA512: b9643b159e114df50a295f433e807afe6082db55a2a3a17401c1509b850c71bf5011ab3638863b46663709726be4445be6fde1dec514aec7696135497a9f0183
kwvg
added a commit
to kwvg/dash
that referenced
this pull request
Aug 2, 2021
UdjinM6
pushed a commit
to UdjinM6/dash
that referenced
this pull request
Aug 11, 2021
kwvg
added a commit
to kwvg/dash
that referenced
this pull request
Aug 12, 2021
UdjinM6
added a commit
to dashpay/dash
that referenced
this pull request
Aug 13, 2021
merge bitcoin#15118, bitcoin#14172, bitcoin#15623, bitcoin#14121, partial bitcoin#13743, partial bitcoin#15280: block filters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These commits have been split out of #14121 because they are fairly independent and that PR is very large.