Skip to content

Commit 07fcd67

Browse files
committed
fix: return immediately when stopping sync process to prevent hang
Fixes #254
1 parent 2281362 commit 07fcd67

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
@@ -288,6 +288,7 @@ func (c *Client) handleRollForward(msgGeneric protocol.Message) error {
288288
if callbackErr == StopSyncProcessError {
289289
// Signal that we're cancelling the sync
290290
c.readyForNextBlockChan <- false
291+
return nil
291292
} else {
292293
return callbackErr
293294
}
@@ -308,6 +309,7 @@ func (c *Client) handleRollBackward(msgGeneric protocol.Message) error {
308309
if callbackErr == StopSyncProcessError {
309310
// Signal that we're cancelling the sync
310311
c.readyForNextBlockChan <- false
312+
return nil
311313
} else {
312314
return callbackErr
313315
}

0 commit comments

Comments
 (0)