Skip to content

Commit e7d992a

Browse files
committed
bip158: Return no match for empty query
Perhaps this is up for debate, but considering the use case of checking for inclusions in a block, an empty query should not return `true` for any element, as no elements exist in the query. If the user happens to have no scripts to query for whatever reason, they will think every block is relevant.
1 parent c2cce97 commit e7d992a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bitcoin/src/bip158.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl GcsFilterReader {
306306
// sort
307307
mapped.sort_unstable();
308308
if mapped.is_empty() {
309-
return Ok(true);
309+
return Ok(false);
310310
}
311311
if n_elements == 0 {
312312
return Ok(false);

0 commit comments

Comments
 (0)