mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-12 15:17:32 +01:00
funding: sent channel to breachArbiter as soon as it's open
This commit is contained in:
@@ -1718,6 +1718,16 @@ func (f *fundingManager) handleFundingLocked(fmsg *fundingLockedMsg) {
|
|||||||
fndgLog.Infof("Received duplicate fundingLocked for "+
|
fndgLog.Infof("Received duplicate fundingLocked for "+
|
||||||
"ChannelID(%v), ignoring.", chanID)
|
"ChannelID(%v), ignoring.", chanID)
|
||||||
channel.Stop()
|
channel.Stop()
|
||||||
|
channel.CancelObserver()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// With the channel retrieved, we'll send the breach arbiter the new
|
||||||
|
// channel so it can watch for attempts to breach the channel's
|
||||||
|
// contract by the remote party.
|
||||||
|
select {
|
||||||
|
case f.cfg.ArbiterChan <- channel:
|
||||||
|
case <-f.quit:
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1731,15 +1741,6 @@ func (f *fundingManager) handleFundingLocked(fmsg *fundingLockedMsg) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// With the channel retrieved, we'll send the breach arbiter the new
|
|
||||||
// channel so it can watch for attempts to breach the channel's
|
|
||||||
// contract by the remote party.
|
|
||||||
select {
|
|
||||||
case f.cfg.ArbiterChan <- channel:
|
|
||||||
case <-f.quit:
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Launch a defer so we _ensure_ that the channel barrier is properly
|
// Launch a defer so we _ensure_ that the channel barrier is properly
|
||||||
// closed even if the target peer is not longer online at this point.
|
// closed even if the target peer is not longer online at this point.
|
||||||
defer func() {
|
defer func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user