contractcourt/chain_arbitrator: use chainWatcherConfig
This commit is contained in:
parent
0697510884
commit
a6f0dd72ac
@ -327,10 +327,16 @@ 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,
|
||||||
// TODO(roasbeef): also need to pass in log?
|
notifier: c.cfg.Notifier,
|
||||||
return c.resolveContract(chanPoint, nil)
|
pCache: c.cfg.PreimageDB,
|
||||||
|
signer: c.cfg.Signer,
|
||||||
|
isOurAddr: c.cfg.IsOurAddress,
|
||||||
|
markChanClosed: func() error {
|
||||||
|
// TODO(roasbeef): also need to pass in log?
|
||||||
|
return c.resolveContract(chanPoint, nil)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -654,9 +660,15 @@ 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,
|
||||||
return c.resolveContract(chanPoint, nil)
|
notifier: c.cfg.Notifier,
|
||||||
|
pCache: c.cfg.PreimageDB,
|
||||||
|
signer: c.cfg.Signer,
|
||||||
|
isOurAddr: c.cfg.IsOurAddress,
|
||||||
|
markChanClosed: func() error {
|
||||||
|
return c.resolveContract(chanPoint, nil)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user