contractcourt: extend the ChainArbitratorConfig with IsOurAddress closure

In this commit, we add the IsOurAddress field into the config of the
chain arb. With this new function closure, the chain arb is able to
detect co-op on chain closes automatically.
This commit is contained in:
Olaoluwa Osuntokun committed 2018-01-22 19:19:53 -08:00
1 parent bdbb33344a
commit bbca53507f
2 files changed
+17 -1

No files matched your search

+4
View File
@@ -400,6 +400,10 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
chanID := lnwire.NewChanIDFromOutPoint(&chanPoint)
return s.htlcSwitch.RemoveLink(chanID)
},
IsOurAddress: func(addr btcutil.Address) bool {
_, err := cc.wallet.GetPrivKey(addr)
return err == nil
},
}, chanDB)
s.breachArbiter = newBreachArbiter(&BreachConfig{