From 3e3618ae9a4f9c6361c7a0541fe2dfd0dcd8c5b3 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Fri, 9 Oct 2020 13:35:04 +0200 Subject: [PATCH] lntest: add build flag for disabling txindex on bitcoind We create a new build flag for running the bitcoind tests without the txindex enabled. We don't want this to be the default so we use a negated build flag. --- lntest/bitcoind.go | 1 + lntest/bitcoind_notxindex.go | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 lntest/bitcoind_notxindex.go diff --git a/lntest/bitcoind.go b/lntest/bitcoind.go index 3eb07a5e..e730b707 100644 --- a/lntest/bitcoind.go +++ b/lntest/bitcoind.go @@ -1,4 +1,5 @@ // +build bitcoind +// +build !notxindex package lntest diff --git a/lntest/bitcoind_notxindex.go b/lntest/bitcoind_notxindex.go new file mode 100644 index 00000000..1d565d8c --- /dev/null +++ b/lntest/bitcoind_notxindex.go @@ -0,0 +1,22 @@ +// +build bitcoind +// +build notxindex + +package lntest + +import ( + "github.com/btcsuite/btcd/chaincfg" +) + +// NewBackend starts a bitcoind node without the txindex enabled and returns a +// BitoindBackendConfig for that node. +func NewBackend(miner string, netParams *chaincfg.Params) ( + *BitcoindBackendConfig, func() error, error) { + + extraArgs := []string{ + "-debug", + "-regtest", + "-disablewallet", + } + + return newBackend(miner, netParams, extraArgs) +}