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:
Johan T. Halseth committed 2018-05-02 08:43:30 +02:00
1 parent 097fd50747
commit 7e397067f6
1 file changed
-2
-2
View File
@@ -295,7 +295,6 @@ func (c *chainWatcher) closeObserver(spendNtfn *chainntnfs.SpendEvent) {
log.Infof("Close observer for ChannelPoint(%v) active", log.Infof("Close observer for ChannelPoint(%v) active",
c.chanState.FundingOutpoint) c.chanState.FundingOutpoint)
for {
select { select {
// We've detected a spend of the channel onchain! Depending on // We've detected a spend of the channel onchain! Depending on
// the type of spend, we'll act accordingly , so we'll examine // the type of spend, we'll act accordingly , so we'll examine
@@ -425,7 +424,6 @@ func (c *chainWatcher) closeObserver(spendNtfn *chainntnfs.SpendEvent) {
case <-c.quit: case <-c.quit:
return return
} }
}
} }
// toSelfAmount takes a transaction and returns the sum of all outputs that pay // toSelfAmount takes a transaction and returns the sum of all outputs that pay