. #25085

issue Raulnori77 opened this issue on May 8, 2022
  1. Raulnori77 commented at 10:41 AM on May 8, 2022: none

    Concept ACK

    <details><summary>A few suggestions regarding filter_checked</summary><p>

    diff --git a/src/blockfilter.cpp b/src/blockfilter.cpp
    index 59f34bc54e..0ab89fdbdb 100644
    --- a/src/blockfilter.cpp
    +++ b/src/blockfilter.cpp
    @@ -47,7 +47,7 @@ GCSFilter::GCSFilter(const Params& params)
         : m_params(params), m_N(0), m_F(0), m_encoded{0}
     {}
     
    -GCSFilter::GCSFilter(const Params& params, std::vector<unsigned char> encoded_filter, const bool filter_checked)
    +GCSFilter::GCSFilter(const Params& params, std::vector<unsigned char> encoded_filter, bool filter_checked)
         : m_params(params), m_encoded(std::move(encoded_filter))
     {
         SpanReader stream{GCS_SER_TYPE, GCS_SER_VERSION, m_encoded};
    @@ -221,7 +221,7 @@ static GCSFilter::ElementSet BasicFilterElements(const CBlock& block,
     }
     
     BlockFilter::BlockFilter(BlockFilterType filter_type, const uint256& block_hash,
    -                         std::vector<unsigned char> filter, const bool filter_checked)
    +                         std::vector<unsigned char> filter, bool filter_checked)
         : m_filter_type(filter_type), m_block_hash(block_hash)
     {
         GCSFilter::Params params;
    diff --git a/src/blockfilter.h b/src/blockfilter.h
    index af054dbf34..5de5679834 100644
    --- a/src/blockfilter.h
    +++ b/src/blockfilter.h
    @@ -59,7 +59,7 @@ public:
         explicit GCSFilter(const Params& params = Params());
     
         /** Reconstructs an already-created filter from an encoding. */
    -    GCSFilter(const Params& params, std::vector<unsigned char> encoded_filter, const bool filter_checked=false);
    +    GCSFilter(const Params& params, std::vector<unsigned char> encoded_filter, bool filter_checked = false);
     
         /** Builds a new filter from the params and set of elements. */
         GCSFilter(const Params& params, const ElementSet& elements);
    @@ -122,7 +122,7 @@ public:
     
         //! Reconstruct a BlockFilter from parts.
         BlockFilter(BlockFilterType filter_type, const uint256& block_hash,
    -                std::vector<unsigned char> filter, const bool filter_checked=false);
    +                std::vector<unsigned char> filter, bool filter_checked = false);
     
         //! Construct a new BlockFilter of the specified type from a block.
         BlockFilter(BlockFilterType filter_type, const CBlock& block, const CBlockUndo& block_undo);
    diff --git a/src/index/blockfilterindex.cpp b/src/index/blockfilterindex.cpp
    index bad766ebe1..0a4728f571 100644
    --- a/src/index/blockfilterindex.cpp
    +++ b/src/index/blockfilterindex.cpp
    @@ -159,7 +159,7 @@ bool BlockFilterIndex::ReadFilterFromDisk(const FlatFilePos& pos, BlockFilter& f
             uint256 result;
             CHash256().Write(encoded_filter).Finalize(result);
             if (result != hash) return error("Checksum mismatch in filter decode.");
    -        filter = BlockFilter(GetFilterType(), block_hash, std::move(encoded_filter), true);
    +        filter = BlockFilter(GetFilterType(), block_hash, std::move(encoded_filter), /*filter_checked=*/true);
         }
    

    </p></details>

    Originally posted by @jonatack in #24832#pullrequestreview-939386764

  2. fanquake closed this on May 8, 2022

  3. fanquake locked this on May 8, 2022
  4. fanquake renamed this:
    Raulnori77
    .
    on May 8, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 09:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me