Skip to content

Commit 89dd6d7

Browse files
authored
Merge pull request #255 from blinklabs-io/fix/chainsync-getcurrenttip-hang
fix: clear out intersect result channel when getting tip to prevent hangs
2 parents 2281362 + cb1ff8c commit 89dd6d7

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)