mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-26 22:17:51 +01:00
breacharbiter: utilize new channel on-chain event stream to watch for breaches
In this commit, we modify the breach arbiter to no longer require holding a channel object directly in order to receive new notifications about possible breaches. Instead, we’ll contact the chain arbiter to request a new channel event subscription. As a result of the new architecture, we no longer need to receive a handoff once the new channel comes online, as the chainWatcher will always be active and watching the channel until it’s been closed.
This commit is contained in:
19
server.go
19
server.go
@@ -409,20 +409,11 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
|
||||
GenSweepScript: func() ([]byte, error) {
|
||||
return newSweepPkScript(cc.wallet)
|
||||
},
|
||||
Notifier: cc.chainNotifier,
|
||||
PublishTransaction: cc.wallet.PublishTransaction,
|
||||
Signer: cc.wallet.Cfg.Signer,
|
||||
Store: newRetributionStore(chanDB),
|
||||
UpdateCloseSignal: func(op *wire.OutPoint,
|
||||
ucs chan *lnwallet.UnilateralCloseSummary) error {
|
||||
|
||||
signals := &contractcourt.ContractSignals{
|
||||
HtlcUpdates: make(chan []channeldb.HTLC),
|
||||
UniCloseSignal: ucs,
|
||||
}
|
||||
|
||||
return s.chainArb.UpdateContractSignals(*op, signals)
|
||||
},
|
||||
Notifier: cc.chainNotifier,
|
||||
PublishTransaction: cc.wallet.PublishTransaction,
|
||||
SubscribeChannelEvents: s.chainArb.SubscribeChannelEvents,
|
||||
Signer: cc.wallet.Cfg.Signer,
|
||||
Store: newRetributionStore(chanDB),
|
||||
})
|
||||
|
||||
// Create the connection manager which will be responsible for
|
||||
|
||||
Reference in New Issue
Block a user