contractcourt: update chain watcher to make funding pkScript for spend ntfn

This commit is contained in:
Olaoluwa Osuntokun
2018-07-17 19:42:17 -07:00
parent ac9f9bd061
commit 08e11d197d
2 changed files with 17 additions and 4 deletions

View File

@@ -173,8 +173,21 @@ func (c *chainWatcher) Start() error {
heightHint = chanState.FundingBroadcastHeight
}
localKey := chanState.LocalChanCfg.MultiSigKey.PubKey.SerializeCompressed()
remoteKey := chanState.RemoteChanCfg.MultiSigKey.PubKey.SerializeCompressed()
multiSigScript, err := lnwallet.GenMultiSigScript(
localKey, remoteKey,
)
if err != nil {
return err
}
pkScript, err := lnwallet.WitnessScriptHash(multiSigScript)
if err != nil {
return err
}
spendNtfn, err := c.cfg.notifier.RegisterSpendNtfn(
fundingOut, heightHint,
fundingOut, pkScript, heightHint,
)
if err != nil {
return err