Skip to main content

match_filter

Function match_filter 

Source
pub fn match_filter(filter: &CompactBlockFilter, script: &[u8]) -> bool
Expand description

Match a script against a compact block filter

Returns true if the script (or its hash) is likely in the filter

Algorithm:

  1. Hash the script to get a value in range [0, N*M)
  2. Decode the filter to reconstruct the sorted set of hashed values
  3. Check if the script’s hash value is in the set