mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-19 03:57:40 +02:00
multi: thread thru the AuxLeafStore everywhere
This commit is contained in:
@@ -193,6 +193,9 @@ type chainWatcherConfig struct {
|
||||
// obfuscater. This is used by the chain watcher to identify which
|
||||
// state was broadcast and confirmed on-chain.
|
||||
extractStateNumHint func(*wire.MsgTx, [lnwallet.StateHintSize]byte) uint64
|
||||
|
||||
// auxLeafStore can be used to fetch information for custom channels.
|
||||
auxLeafStore fn.Option[lnwallet.AuxLeafStore]
|
||||
}
|
||||
|
||||
// chainWatcher is a system that's assigned to every active channel. The duty
|
||||
@@ -867,7 +870,7 @@ func (c *chainWatcher) handlePossibleBreach(commitSpend *chainntnfs.SpendDetail,
|
||||
spendHeight := uint32(commitSpend.SpendingHeight)
|
||||
retribution, err := lnwallet.NewBreachRetribution(
|
||||
c.cfg.chanState, broadcastStateNum, spendHeight,
|
||||
commitSpend.SpendingTx,
|
||||
commitSpend.SpendingTx, c.cfg.auxLeafStore,
|
||||
)
|
||||
|
||||
switch {
|
||||
@@ -1117,8 +1120,8 @@ func (c *chainWatcher) dispatchLocalForceClose(
|
||||
"detected", c.cfg.chanState.FundingOutpoint)
|
||||
|
||||
forceClose, err := lnwallet.NewLocalForceCloseSummary(
|
||||
c.cfg.chanState, c.cfg.signer,
|
||||
commitSpend.SpendingTx, stateNum,
|
||||
c.cfg.chanState, c.cfg.signer, commitSpend.SpendingTx, stateNum,
|
||||
c.cfg.auxLeafStore,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -1211,7 +1214,7 @@ func (c *chainWatcher) dispatchRemoteForceClose(
|
||||
// channel on-chain.
|
||||
uniClose, err := lnwallet.NewUnilateralCloseSummary(
|
||||
c.cfg.chanState, c.cfg.signer, commitSpend,
|
||||
remoteCommit, commitPoint,
|
||||
remoteCommit, commitPoint, c.cfg.auxLeafStore,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user