Skip to content

Commit cb1ff8c

Browse files
committed
fix: clear out intersect result channel when getting tip to prevent hangs
Fixes #253
1 parent 2281362 commit cb1ff8c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

protocol/chainsync/client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ func (c *Client) GetCurrentTip() (*Tip, error) {
121121
return nil, err
122122
}
123123
tip := <-c.currentTipChan
124+
// Clear out intersect result channel to prevent blocking
125+
<-c.intersectResultChan
124126
c.wantCurrentTip = false
125127
return &tip, nil
126128
}

0 commit comments

Comments
 (0)