diff --git a/contractcourt/chain_arbitrator.go b/contractcourt/chain_arbitrator.go index f13f65fd..6656ef22 100644 --- a/contractcourt/chain_arbitrator.go +++ b/contractcourt/chain_arbitrator.go @@ -5,13 +5,13 @@ import ( "sync" "sync/atomic" + "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/btcsuite/btcd/wire" + "github.com/btcsuite/btcutil" "github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwire" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcutil" ) // ResolutionMsg is a message sent by resolvers to outside sub-systems once an diff --git a/contractcourt/chain_watcher_test.go b/contractcourt/chain_watcher_test.go index a99fcd31..5928be66 100644 --- a/contractcourt/chain_watcher_test.go +++ b/contractcourt/chain_watcher_test.go @@ -17,7 +17,7 @@ type mockNotifier struct { spendChan chan *chainntnfs.SpendDetail } -func (m *mockNotifier) RegisterConfirmationsNtfn(txid *chainhash.Hash, numConfs, +func (m *mockNotifier) RegisterConfirmationsNtfn(txid *chainhash.Hash, _ []byte, numConfs, heightHint uint32) (*chainntnfs.ConfirmationEvent, error) { return nil, nil } diff --git a/contractcourt/contract_resolvers.go b/contractcourt/contract_resolvers.go index f81e050d..541b40fb 100644 --- a/contractcourt/contract_resolvers.go +++ b/contractcourt/contract_resolvers.go @@ -211,8 +211,9 @@ func (h *htlcTimeoutResolver) Resolve() (ContractResolver, error) { // Otherwise, this is our commitment, so we'll watch for the // second-level transaction to be sufficiently confirmed. secondLevelTXID := h.htlcResolution.SignedTimeoutTx.TxHash() + sweepScript := h.htlcResolution.SignedTimeoutTx.TxOut[0].PkScript confNtfn, err := h.Notifier.RegisterConfirmationsNtfn( - &secondLevelTXID, 1, h.broadcastHeight, + &secondLevelTXID, sweepScript, 1, h.broadcastHeight, ) if err != nil { return nil, err @@ -521,8 +522,9 @@ func (h *htlcSuccessResolver) Resolve() (ContractResolver, error) { // With the sweep transaction broadcast, we'll wait for its // confirmation. sweepTXID := h.sweepTx.TxHash() + sweepScript := h.sweepTx.TxOut[0].PkScript confNtfn, err := h.Notifier.RegisterConfirmationsNtfn( - &sweepTXID, 1, h.broadcastHeight, + &sweepTXID, sweepScript, 1, h.broadcastHeight, ) if err != nil { return nil, err @@ -1193,8 +1195,9 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) { // // TODO(roasbeef): instead sweep asap if remote commit? yeh commitTXID := c.commitResolution.SelfOutPoint.Hash + sweepScript := c.commitResolution.SelfOutputSignDesc.Output.PkScript confNtfn, err := c.Notifier.RegisterConfirmationsNtfn( - &commitTXID, 1, c.broadcastHeight, + &commitTXID, sweepScript, 1, c.broadcastHeight, ) if err != nil { return nil, err @@ -1329,8 +1332,9 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) { // Now we'll wait until the sweeping transaction has been fully // confirmed. Once it's confirmed, we can mark this contract resolved. sweepTXID := c.sweepTx.TxHash() + sweepingScript := c.sweepTx.TxOut[0].PkScript confNtfn, err = c.Notifier.RegisterConfirmationsNtfn( - &sweepTXID, 1, c.broadcastHeight, + &sweepTXID, sweepingScript, 1, c.broadcastHeight, ) if err != nil { return nil, err