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 {
194194 . iter_mut ( )
195195 . rev ( )
196196 . flat_map ( |batch| batch. packets . iter_mut ( ) . rev ( ) )
197+ . filter ( |packet| !packet. meta . discard )
197198 . map ( |packet| ( packet. meta . addr , packet) )
198199 . into_group_map ( ) ;
199200 // Allocate max_packets evenly across addresses.
@@ -370,11 +371,14 @@ mod tests {
370371 let mut batch = PacketBatch :: default ( ) ;
371372 batch. packets . resize ( 10 , Packet :: default ( ) ) ;
372373 batch. packets [ 3 ] . meta . addr = [ 1u16 ; 8 ] ;
374+ batch. packets [ 3 ] . meta . discard = true ;
375+ batch. packets [ 4 ] . meta . addr = [ 2u16 ; 8 ] ;
373376 let mut batches = vec ! [ batch] ;
374377 let max = 3 ;
375378 SigVerifyStage :: discard_excess_packets ( & mut batches, max) ;
376379 assert_eq ! ( count_non_discard( & batches) , max) ;
377380 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) ;
379383 }
380384}
You can’t perform that action at this time.
0 commit comments