File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -632,8 +632,8 @@ impl NakamotoBlockBuilder {
632
632
) )
633
633
} ) ?;
634
634
635
- if naka_tip_header. anchored_header . height ( ) + 1
636
- <= naka_tip_tenure_start_header. anchored_header . height ( )
635
+ if naka_tip_header. anchored_header . height ( )
636
+ < naka_tip_tenure_start_header. anchored_header . height ( )
637
637
{
638
638
return Err ( Error :: InvalidStacksBlock (
639
639
"Nakamoto tip is lower than its tenure-start block" . into ( ) ,
Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ impl Trie {
378
378
// append the new leaf and the end of the file.
379
379
let new_leaf_disk_ptr = storage. last_ptr ( ) ?;
380
380
let new_leaf_chr = cursor. path [ cursor. tell ( ) ] ; // NOTE: this is safe because !cursor.eop()
381
- let new_leaf_path = cursor. path [ ( if cursor. tell ( ) + 1 <= cursor. path . len ( ) {
381
+ let new_leaf_path = cursor. path [ ( if cursor. tell ( ) < cursor. path . len ( ) {
382
382
cursor. tell ( ) + 1
383
383
} else {
384
384
cursor. path . len ( )
Original file line number Diff line number Diff line change @@ -2327,7 +2327,7 @@ fn test_build_anchored_blocks_invalid() {
2327
2327
2328
2328
eprintln ! ( "\n \n at resume parent tenure:\n last_parent: {:?}\n last_parent_tip: {:?}\n \n " , & last_parent, & last_parent_tip) ;
2329
2329
}
2330
- else if tenure_id >= bad_block_tenure + 1 {
2330
+ else if tenure_id > bad_block_tenure {
2331
2331
last_parent = None ;
2332
2332
last_parent_tip = None ;
2333
2333
}
Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ impl RelayerStats {
286
286
let mut to_remove = vec ! [ ] ;
287
287
for ( ts, old_addr) in self . relay_updates . iter ( ) {
288
288
self . relay_stats . remove ( old_addr) ;
289
- if self . relay_stats . len ( ) <= MAX_RELAYER_STATS - 1 {
289
+ if self . relay_stats . len ( ) < MAX_RELAYER_STATS {
290
290
break ;
291
291
}
292
292
to_remove. push ( * ts) ;
@@ -342,7 +342,7 @@ impl RelayerStats {
342
342
let mut to_remove = vec ! [ ] ;
343
343
for ( ts, old_nk) in self . recent_updates . iter ( ) {
344
344
self . recent_messages . remove ( old_nk) ;
345
- if self . recent_messages . len ( ) <= ( MAX_RELAYER_STATS as usize ) - 1 {
345
+ if self . recent_messages . len ( ) < MAX_RELAYER_STATS {
346
346
break ;
347
347
}
348
348
to_remove. push ( * ts) ;
You can’t perform that action at this time.
0 commit comments