mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 11:09:23 +01:00
lnwallet: update dual funder verification code to use pkscript in GetUtxo
This commit is contained in:
parent
8c0a151cec
commit
21451bf251
1 changed files with 19 additions and 9 deletions
|
@ -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 (
|
||||
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue