Skip to content

Commit

Permalink
remove todo's
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg committed May 28, 2024
1 parent f1befbf commit 42d00c6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion p2p/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func (s *session[H]) verify(headers []H) error {
if trusted.Height() != s.from.Height() {
if trusted.Height()+1 != untrusted.Height() {
// Exchange requires requested ranges to always consist of adjacent headers.
return fmt.Errorf("peer sent valid??? but non-adjacent header. expected:%d, received:%d",
return fmt.Errorf("peer sent valid but non-adjacent header. expected:%d, received:%d",
trusted.Height()+1,
untrusted.Height(),
)
Expand Down
2 changes: 1 addition & 1 deletion store/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (b *batch[H]) Append(headers ...H) {
b.lk.Lock()
defer b.lk.Unlock()
for _, h := range headers {
b.headers = append(b.headers, h) // gap is possible?
b.headers = append(b.headers, h)
b.heights[h.Hash().String()] = h.Height()
}
}
Expand Down
2 changes: 1 addition & 1 deletion store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ func (s *Store[H]) flushLoop() {
// and notify waiters if any + increase current read head height
// it is important to do Pub after updating pending
// so pending is consistent with atomic Height counter on the heightSub
s.heightSub.Pub(headers...) // TODO(oleg): the only place where we mutate heightSub.
s.heightSub.Pub(headers...)
// don't flush and continue if pending batch is not grown enough,
// and Store is not stopping(headers == nil)
if s.pending.Len() < s.Params.WriteBatchSize && headers != nil {
Expand Down

0 comments on commit 42d00c6

Please sign in to comment.