Skip to content

Commit ee625f7

Browse files
committed
handle shutdown during incoming block processing in syncer
1 parent 04662e1 commit ee625f7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

binaries/cuprated/src/blockchain/syncer.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ where
125125

126126
tracing::debug!("Got batch, len: {}", batch.blocks.len());
127127
if incoming_block_batch_tx.send((batch, Arc::clone(&sync_permit))).await.is_err() {
128+
if shutdown_token.is_cancelled() {
129+
return Ok(());
130+
}
128131
return Err(SyncerError::IncomingBlockChannelClosed);
129132
}
130133
}

0 commit comments

Comments
 (0)