Skip to content

Commit 6054d8e

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 8aec240 commit 6054d8e

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
@@ -290,7 +290,7 @@ impl GcsFilterReader {
290290
// sort
291291
mapped.sort_unstable();
292292
if mapped.is_empty() {
293-
return Ok(true);
293+
return Ok(false);
294294
}
295295
if n_elements.0 == 0 {
296296
return Ok(false);

0 commit comments

Comments
 (0)