mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-04 18:26:18 +02:00
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:
@@ -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
|
||||||
|
Reference in New Issue
Block a user