contractcourt/chainwatcher: remove close observer for loop
This commit removes the for loop in the closeObserver, as it wasn't serving any purpose. After receiving a spend notification we would return, breaking out of the loop. When getting a quit signal we would also return, making the loop only do one iteration in any case.
This commit is contained in:
parent
097fd50747
commit
7e397067f6
@ -295,7 +295,6 @@ func (c *chainWatcher) closeObserver(spendNtfn *chainntnfs.SpendEvent) {
|
||||
log.Infof("Close observer for ChannelPoint(%v) active",
|
||||
c.chanState.FundingOutpoint)
|
||||
|
||||
for {
|
||||
select {
|
||||
// We've detected a spend of the channel onchain! Depending on
|
||||
// the type of spend, we'll act accordingly , so we'll examine
|
||||
@ -426,7 +425,6 @@ func (c *chainWatcher) closeObserver(spendNtfn *chainntnfs.SpendEvent) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// toSelfAmount takes a transaction and returns the sum of all outputs that pay
|
||||
// to a script that the wallet controls. If no outputs pay to us, then we
|
||||
|
Loading…
Reference in New Issue
Block a user