multi: reliable hand-off from htlcswitch to contractcourt

This is achieved by changing the 1-way handoff to a 2-way handoff
with a done channel.
This commit is contained in:
eugene committed 2022-02-24 13:35:15 -05:00
1 parent e7505c3e6b
commit 8607e8c28a
7 files changed
+193 -75

No files matched your search

+5
View File
@@ -815,6 +815,10 @@ func (p *Brontide) addLink(chanPoint *wire.OutPoint,
return p.cfg.ChainArb.UpdateContractSignals(*chanPoint, signals)
}
notifyContractUpdate := func(update *contractcourt.ContractUpdate) error {
return p.cfg.ChainArb.NotifyContractUpdate(*chanPoint, update)
}
chanType := lnChan.State().ChanType
// Select the appropriate tower client based on the channel type. It's
@@ -842,6 +846,7 @@ func (p *Brontide) addLink(chanPoint *wire.OutPoint,
PreimageCache: p.cfg.WitnessBeacon,
ChainEvents: chainEvents,
UpdateContractSignals: updateContractSignals,
NotifyContractUpdate: notifyContractUpdate,
OnChannelFailure: onChannelFailure,
SyncStates: syncStates,
BatchTicker: ticker.New(p.cfg.ChannelCommitInterval),