lnwallet: delegate all channel funding logic to the new chanfunding package

In this commit, we begin to integrate the new channel funding package
into the existing codebase. With this set of changes, we'll no longer
construct and sign the funding transaction within this package, instead
delegating it to the new chanfunding package. We use the new
chanfunding.WalletAssembler to carry out all channel funding, providing
it with an implementation of all its interfaces backed by the wallet.
This commit is contained in:
Olaoluwa Osuntokun committed 2019-12-02 17:11:36 -06:00
1 parent d422ebbc66
commit 7a64a7d3a4
5 files changed
+292 -309

No files matched your search

+6 -1
View File
@@ -1,6 +1,7 @@
package lnd
import (
"encoding/hex"
"fmt"
"sync"
"sync/atomic"
@@ -20,6 +21,10 @@ import (
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
)
var (
coinPkScript, _ = hex.DecodeString("001431df1bde03c074d0cf21ea2529427e1499b8f1de")
)
// The block height returned by the mock BlockChainIO's GetBestBlock.
const fundingBroadcastHeight = 123
@@ -297,7 +302,7 @@ func (m *mockWalletController) ListUnspentWitness(minconfirms,
utxo := &lnwallet.Utxo{
AddressType: lnwallet.WitnessPubKey,
Value: btcutil.Amount(10 * btcutil.SatoshiPerBitcoin),
PkScript: make([]byte, 22),
PkScript: coinPkScript,
OutPoint: wire.OutPoint{
Hash: chainhash.Hash{},
Index: m.index,