diff --git a/sweep/sweeper.go b/sweep/sweeper.go index 610bb819b..879e15c13 100644 --- a/sweep/sweeper.go +++ b/sweep/sweeper.go @@ -672,7 +672,7 @@ func (s *UtxoSweeper) collector(blockEpochs <-chan *chainntnfs.BlockEpoch) { // A new external request has been received to retrieve all of // the inputs we're currently attempting to sweep. case req := <-s.pendingSweepsReqs: - req.respChan <- s.handlePendingSweepsReq(req) + s.handlePendingSweepsReq(req) // A new external request has been received to bump the fee rate // of a given input. @@ -1058,6 +1058,13 @@ func (s *UtxoSweeper) handlePendingSweepsReq( } } + select { + case req.respChan <- resps: + case <-s.quit: + log.Debug("Skipped sending pending sweep response due to " + + "UtxoSweeper shutting down") + } + return resps }