diff --git a/contractcourt/chain_watcher.go b/contractcourt/chain_watcher.go index 8126d37d..04fc8647 100644 --- a/contractcourt/chain_watcher.go +++ b/contractcourt/chain_watcher.go @@ -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 diff --git a/contractcourt/chain_watcher_test.go b/contractcourt/chain_watcher_test.go index 5928be66..ab0b8f39 100644 --- a/contractcourt/chain_watcher_test.go +++ b/contractcourt/chain_watcher_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" + "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/btcsuite/btcd/wire" "github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwire" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" ) type mockNotifier struct { @@ -35,7 +35,7 @@ func (m *mockNotifier) Start() error { func (m *mockNotifier) Stop() error { return nil } -func (m *mockNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint, +func (m *mockNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint, _ []byte, heightHint uint32) (*chainntnfs.SpendEvent, error) { return &chainntnfs.SpendEvent{ Spend: m.spendChan,