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
2018-04-17 10:08:50 +02:00
parent 097fd50747
commit 7e397067f6

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
@@ -426,7 +425,6 @@ func (c *chainWatcher) closeObserver(spendNtfn *chainntnfs.SpendEvent) {
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
// to a script that the wallet controls. If no outputs pay to us, then we // to a script that the wallet controls. If no outputs pay to us, then we