diff --git a/lntest/btcd.go b/lntest/btcd.go index 7187befd..603bb3af 100644 --- a/lntest/btcd.go +++ b/lntest/btcd.go @@ -67,7 +67,9 @@ func (b BtcdBackendConfig) Name() string { // NewBackend starts a new rpctest.Harness and returns a BtcdBackendConfig for // that node. miner should be set to the P2P address of the miner to connect // to. -func NewBackend(miner string) (*BtcdBackendConfig, func(), error) { +func NewBackend(miner string, netParams *chaincfg.Params) ( + *BtcdBackendConfig, func(), error) { + args := []string{ "--rejectnonstd", "--txindex", @@ -76,7 +78,6 @@ func NewBackend(miner string) (*BtcdBackendConfig, func(), error) { "--logdir=" + logDir, "--connect=" + miner, } - netParams := &chaincfg.SimNetParams chainBackend, err := rpctest.New(netParams, nil, args) if err != nil { return nil, nil, fmt.Errorf("unable to create btcd node: %v", err) diff --git a/lntest/itest/lnd_test.go b/lntest/itest/lnd_test.go index 4ee67480..90a8523b 100644 --- a/lntest/itest/lnd_test.go +++ b/lntest/itest/lnd_test.go @@ -45,7 +45,7 @@ import ( ) var ( - harnessNetParams = &chaincfg.SimNetParams + harnessNetParams = &chaincfg.RegressionNetParams ) const ( @@ -14415,7 +14415,9 @@ func TestLightningNetworkDaemon(t *testing.T) { }() // Start a chain backend. - chainBackend, cleanUp, err := lntest.NewBackend(miner.P2PAddress()) + chainBackend, cleanUp, err := lntest.NewBackend( + miner.P2PAddress(), harnessNetParams, + ) if err != nil { ht.Fatalf("unable to start backend: %v", err) } @@ -14454,7 +14456,7 @@ func TestLightningNetworkDaemon(t *testing.T) { // Next mine enough blocks in order for segwit and the CSV package // soft-fork to activate on SimNet. - numBlocks := chaincfg.SimNetParams.MinerConfirmationWindow * 2 + numBlocks := harnessNetParams.MinerConfirmationWindow * 2 if _, err := miner.Node.Generate(numBlocks); err != nil { ht.Fatalf("unable to generate blocks: %v", err) } diff --git a/lntest/neutrino.go b/lntest/neutrino.go index d127c0b5..a8275fc6 100644 --- a/lntest/neutrino.go +++ b/lntest/neutrino.go @@ -2,7 +2,11 @@ package lntest -import "fmt" +import ( + "fmt" + + "github.com/btcsuite/btcd/chaincfg" +) // NeutrinoBackendConfig is an implementation of the BackendConfig interface // backed by a neutrino node. @@ -35,7 +39,9 @@ func (b NeutrinoBackendConfig) Name() string { } // NewBackend starts and returns a NeutrinoBackendConfig for the node. -func NewBackend(miner string) (*NeutrinoBackendConfig, func(), error) { +func NewBackend(miner string, _ *chaincfg.Params) ( + *NeutrinoBackendConfig, func(), error) { + bd := &NeutrinoBackendConfig{ minerAddr: miner, }