diff --git a/lnwallet/wallet.go b/lnwallet/wallet.go index 0dcc4cc39..8a2d9b1f2 100644 --- a/lnwallet/wallet.go +++ b/lnwallet/wallet.go @@ -8,20 +8,20 @@ import ( "sync" "sync/atomic" + "github.com/btcsuite/btcd/blockchain" + "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/btcsuite/btcutil/hdkeychain" "github.com/davecgh/go-spew/spew" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/keychain" "github.com/lightningnetwork/lnd/lnwire" - "github.com/btcsuite/btcd/blockchain" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcutil/hdkeychain" - "github.com/lightningnetwork/lnd/shachain" "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" "github.com/btcsuite/btcutil/txsort" + "github.com/lightningnetwork/lnd/shachain" ) const ( @@ -262,15 +262,15 @@ type LightningWallet struct { // is removed from limbo. Each reservation is tracked by a unique // monotonically integer. All requests concerning the channel MUST // carry a valid, active funding ID. - fundingLimbo map[uint64]*ChannelReservation - limboMtx sync.RWMutex + fundingLimbo map[uint64]*ChannelReservation + limboMtx sync.RWMutex // lockedOutPoints is a set of the currently locked outpoint. This // information is kept in order to provide an easy way to unlock all // the currently locked outpoints. lockedOutPoints map[wire.OutPoint]struct{} - quit chan struct{} + quit chan struct{} wg sync.WaitGroup @@ -971,8 +971,18 @@ func (l *LightningWallet) handleFundingCounterPartySigs(msg *addCounterPartySigs // Fetch the alleged previous output along with the // pkscript referenced by this input. - // TODO(roasbeef): when dual funder pass actual height-hint - output, err := l.Cfg.ChainIO.GetUtxo(&txin.PreviousOutPoint, 0) + // + // TODO(roasbeef): when dual funder pass actual + // height-hint + pkScript, err := WitnessScriptHash( + txin.Witness[len(txin.Witness)-1], + ) + if err != nil { + } + output, err := l.Cfg.ChainIO.GetUtxo( + &txin.PreviousOutPoint, + pkScript, 0, + ) if output == nil { msg.err <- fmt.Errorf("input to funding tx "+ "does not exist: %v", err)