mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
contractcourt/chain_arbitrator: use chainWatcherConfig
This commit is contained in:
parent
0697510884
commit
a6f0dd72ac
1 changed files with 19 additions and 7 deletions
|
@ -327,11 +327,17 @@ func (c *ChainArbitrator) Start() error {
|
||||||
// First, we'll create an active chainWatcher for this channel
|
// First, we'll create an active chainWatcher for this channel
|
||||||
// to ensure that we detect any relevant on chain events.
|
// to ensure that we detect any relevant on chain events.
|
||||||
chainWatcher, err := newChainWatcher(
|
chainWatcher, err := newChainWatcher(
|
||||||
channel, c.cfg.Notifier, c.cfg.PreimageDB, c.cfg.Signer,
|
chainWatcherConfig{
|
||||||
c.cfg.IsOurAddress, func() error {
|
chanState: channel,
|
||||||
|
notifier: c.cfg.Notifier,
|
||||||
|
pCache: c.cfg.PreimageDB,
|
||||||
|
signer: c.cfg.Signer,
|
||||||
|
isOurAddr: c.cfg.IsOurAddress,
|
||||||
|
markChanClosed: func() error {
|
||||||
// TODO(roasbeef): also need to pass in log?
|
// TODO(roasbeef): also need to pass in log?
|
||||||
return c.resolveContract(chanPoint, nil)
|
return c.resolveContract(chanPoint, nil)
|
||||||
},
|
},
|
||||||
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -654,10 +660,16 @@ func (c *ChainArbitrator) WatchNewChannel(newChan *channeldb.OpenChannel) error
|
||||||
// First, also create an active chainWatcher for this channel to ensure
|
// First, also create an active chainWatcher for this channel to ensure
|
||||||
// that we detect any relevant on chain events.
|
// that we detect any relevant on chain events.
|
||||||
chainWatcher, err := newChainWatcher(
|
chainWatcher, err := newChainWatcher(
|
||||||
newChan, c.cfg.Notifier, c.cfg.PreimageDB, c.cfg.Signer,
|
chainWatcherConfig{
|
||||||
c.cfg.IsOurAddress, func() error {
|
chanState: newChan,
|
||||||
|
notifier: c.cfg.Notifier,
|
||||||
|
pCache: c.cfg.PreimageDB,
|
||||||
|
signer: c.cfg.Signer,
|
||||||
|
isOurAddr: c.cfg.IsOurAddress,
|
||||||
|
markChanClosed: func() error {
|
||||||
return c.resolveContract(chanPoint, nil)
|
return c.resolveContract(chanPoint, nil)
|
||||||
},
|
},
|
||||||
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Add table
Reference in a new issue