File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ impl SigVerifyStage {
194
194
. iter_mut ( )
195
195
. rev ( )
196
196
. flat_map ( |batch| batch. packets . iter_mut ( ) . rev ( ) )
197
+ . filter ( |packet| !packet. meta . discard )
197
198
. map ( |packet| ( packet. meta . addr , packet) )
198
199
. into_group_map ( ) ;
199
200
// Allocate max_packets evenly across addresses.
@@ -370,11 +371,14 @@ mod tests {
370
371
let mut batch = PacketBatch :: default ( ) ;
371
372
batch. packets . resize ( 10 , Packet :: default ( ) ) ;
372
373
batch. packets [ 3 ] . meta . addr = [ 1u16 ; 8 ] ;
374
+ batch. packets [ 3 ] . meta . discard = true ;
375
+ batch. packets [ 4 ] . meta . addr = [ 2u16 ; 8 ] ;
373
376
let mut batches = vec ! [ batch] ;
374
377
let max = 3 ;
375
378
SigVerifyStage :: discard_excess_packets ( & mut batches, max) ;
376
379
assert_eq ! ( count_non_discard( & batches) , max) ;
377
380
assert ! ( !batches[ 0 ] . packets[ 0 ] . meta. discard) ;
378
- assert ! ( !batches[ 0 ] . packets[ 3 ] . meta. discard) ;
381
+ assert ! ( batches[ 0 ] . packets[ 3 ] . meta. discard) ;
382
+ assert ! ( !batches[ 0 ] . packets[ 4 ] . meta. discard) ;
379
383
}
380
384
}
You can’t perform that action at this time.
0 commit comments