multi: update to latest btcd version

With this commit we update btcd to the latest version which allows us to
specify the btcd binary we want to use when spinning up a new node.
This commit is contained in:
Oliver Gugger committed 2020-12-03 11:30:22 +01:00
1 parent c58589db3b
commit 2edc3cf98f
9 files changed
+42 -19

No files matched your search

+1 -1
View File
@@ -88,7 +88,7 @@ func NewBackend(miner string, netParams *chaincfg.Params) (
// make sure they stay connected if it happens.
"--nobanning",
}
chainBackend, err := rpctest.New(netParams, nil, args)
chainBackend, err := rpctest.New(netParams, nil, args, GetBtcdBinary())
if err != nil {
return nil, nil, fmt.Errorf("unable to create btcd node: %v", err)
}
+4 -4
View File
@@ -2471,8 +2471,8 @@ func testOpenChannelAfterReorg(net *lntest.NetworkHarness, t *harnessTest) {
tempLogDir := fmt.Sprintf("%s/.tempminerlogs", lntest.GetLogDir())
logFilename := "output-open_channel_reorg-temp_miner.log"
tempMiner, tempMinerCleanUp, err := lntest.NewMiner(
tempLogDir, logFilename,
harnessNetParams, &rpcclient.NotificationHandlers{},
tempLogDir, logFilename, harnessNetParams,
&rpcclient.NotificationHandlers{}, lntest.GetBtcdBinary(),
)
require.NoError(t.t, err, "failed to create temp miner")
defer func() {
@@ -14258,8 +14258,8 @@ func TestLightningNetworkDaemon(t *testing.T) {
// We will also connect it to our chain backend.
minerLogDir := fmt.Sprintf("%s/.minerlogs", logDir)
miner, minerCleanUp, err := lntest.NewMiner(
minerLogDir, "output_btcd_miner.log",
harnessNetParams, &rpcclient.NotificationHandlers{},
minerLogDir, "output_btcd_miner.log", harnessNetParams,
&rpcclient.NotificationHandlers{}, lntest.GetBtcdBinary(),
)
require.NoError(t, err, "failed to create new miner")
defer func() {
+18 -3
View File
@@ -78,6 +78,11 @@ var (
// goroutines of test nodes on failure.
goroutineDump = flag.Bool("goroutinedump", false,
"write goroutine dump from node n to file pprof-n.log")
// btcdExecutable is the full path to the btcd binary.
btcdExecutable = flag.String(
"btcdexec", "", "full path to btcd binary",
)
)
// nextAvailablePort returns the first port that is available for listening by
@@ -123,6 +128,16 @@ func GetLogDir() string {
return "."
}
// GetBtcdBinary returns the full path to the binary of the custom built btcd
// executable or an empty string if none is set.
func GetBtcdBinary() string {
if btcdExecutable != nil {
return *btcdExecutable
}
return ""
}
// generateListeningPorts returns four ints representing ports to listen on
// designated for the current lightning network test. This returns the next
// available ports for the p2p, rpc, rest and profiling services.
@@ -394,8 +409,8 @@ func newNode(cfg NodeConfig) (*HarnessNode, error) {
// miner node's log dir. When tests finished, during clean up, its logs are
// copied to a file specified as logFilename.
func NewMiner(logDir, logFilename string, netParams *chaincfg.Params,
handler *rpcclient.NotificationHandlers) (*rpctest.Harness,
func() error, error) {
handler *rpcclient.NotificationHandlers,
btcdBinary string) (*rpctest.Harness, func() error, error) {
args := []string{
"--rejectnonstd",
@@ -407,7 +422,7 @@ func NewMiner(logDir, logFilename string, netParams *chaincfg.Params,
"--trickleinterval=100ms",
}
miner, err := rpctest.New(netParams, handler, args)
miner, err := rpctest.New(netParams, handler, args, btcdBinary)
if err != nil {
return nil, nil, fmt.Errorf(
"unable to create mining node: %v", err,