Skip to content

Commit 184db05

Browse files
authored
Merge pull request #256 from blinklabs-io/fix/chainsync-stop-hang
fix: return immediately when stopping sync process to prevent hang
2 parents 89dd6d7 + 07fcd67 commit 184db05

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
@@ -290,6 +290,7 @@ func (c *Client) handleRollForward(msgGeneric protocol.Message) error {
290290
if callbackErr == StopSyncProcessError {
291291
// Signal that we're cancelling the sync
292292
c.readyForNextBlockChan <- false
293+
return nil
293294
} else {
294295
return callbackErr
295296
}
@@ -310,6 +311,7 @@ func (c *Client) handleRollBackward(msgGeneric protocol.Message) error {
310311
if callbackErr == StopSyncProcessError {
311312
// Signal that we're cancelling the sync
312313
c.readyForNextBlockChan <- false
314+
return nil
313315
} else {
314316
return callbackErr
315317
}

0 commit comments

Comments
 (0)