We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 761083c commit 6a6e3f5Copy full SHA for 6a6e3f5
1 file changed
client/rpc-core/src/types/filter.rs
@@ -272,8 +272,18 @@ impl FilteredParams {
272
}
273
274
},
275
- VariadicValue::Multiple(_) => {
276
- let replaced: Option<Vec<H256>> = self.replace(log, topic);
+ VariadicValue::Multiple(multi) => {
+ // Shrink the topics until the last item is Some.
277
+ let mut new_multi = multi;
278
+ while new_multi.iter().last().unwrap_or(&Some(H256::default())).is_none() {
279
+ new_multi.pop();
280
+ }
281
+ // We can discard right away any logs with lesser topics than the filter.
282
+ if new_multi.len() > log.topics.len() {
283
+ out = false;
284
+ break;
285
286
+ let replaced: Option<Vec<H256>> = self.replace(log, VariadicValue::Multiple(new_multi));
287
if let Some(replaced) = replaced {
288
out = false;
289
if log.topics.starts_with(
0 commit comments