File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -191,8 +191,15 @@ where
191191 * result = Some ( ( header. height , block_res?) ) ;
192192 }
193193 debug_assert ! ( fetched_blocks. iter( ) . take( most_connected_blocks. len( ) ) . all( |r| r. is_some( ) ) ) ;
194- debug_assert ! ( fetched_blocks
195- . is_sorted_by_key( |r| r. as_ref( ) . map( |( height, _) | * height) . unwrap_or( u32 :: MAX ) ) ) ;
194+ // TODO: When our MSRV is 1.82, use is_sorted_by_key
195+ debug_assert ! ( fetched_blocks. windows( 2 ) . all( |blocks| {
196+ if let ( Some ( a) , Some ( b) ) = ( & blocks[ 0 ] , & blocks[ 1 ] ) {
197+ a. 0 < b. 0
198+ } else {
199+ // Any non-None blocks have to come before any None entries
200+ blocks[ 1 ] . is_none( )
201+ }
202+ } ) ) ;
196203
197204 for ( listener_height, listener) in chain_listeners_at_height. iter ( ) {
198205 // Connect blocks for this listener.
You can’t perform that action at this time.
0 commit comments