sweep: fix handlePendingSweepsReq linter issue

Turns out the param was never used, we now fix it by sending the
response in the method and also catch the quit channel.
This commit is contained in:
yyforyongyu 2024-03-20 15:05:25 +08:00
parent 28df2d7327
commit 1fa8ca72ee
No known key found for this signature in database
GPG key ID: 9BCD95C4FF296868

View file

@ -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
}