From 39a7cc64346b26082d308dbfbf5c0f4457cc7efb Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Tue, 8 Aug 2023 14:09:57 +0800 Subject: [PATCH] sweep: rename `waitForSpend` to `monitorSpend` to avoid confusion The method `waitForSpend` makes it sounding like it's blocking while it's not, thus it's renamed to avoid confusion. --- sweep/sweeper.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sweep/sweeper.go b/sweep/sweeper.go index 7347c37a8..9d3731dee 100644 --- a/sweep/sweeper.go +++ b/sweep/sweeper.go @@ -1348,9 +1348,9 @@ func (s *UtxoSweeper) sweep(inputs inputSet, feeRate chainfee.SatPerKWeight, return nil } -// waitForSpend registers a spend notification with the chain notifier. It +// monitorSpend registers a spend notification with the chain notifier. It // returns a cancel function that can be used to cancel the registration. -func (s *UtxoSweeper) waitForSpend(outpoint wire.OutPoint, +func (s *UtxoSweeper) monitorSpend(outpoint wire.OutPoint, script []byte, heightHint uint32) (func(), error) { log.Tracef("Wait for spend of %v at heightHint=%v", @@ -1611,7 +1611,7 @@ func (s *UtxoSweeper) handleNewInput(input *sweepInputMessage, // Start watching for spend of this input, either by us or the remote // party. - cancel, err := s.waitForSpend( + cancel, err := s.monitorSpend( outpoint, input.input.SignDesc().Output.PkScript, input.input.HeightHint(), )