testing: allow patch versions of bitcoin core
What changed, and why it matters
This commit updates a helper shell script used only for installing Bitcoin Core during testing. It changes how the script maps Docker image tags (like '29' or '30') to the directory names inside the container (like '/opt/bitcoin-29.0' or '/opt/bitcoin-30.0'), so patch releases such as '29.1' work correctly. There is no change to LND's runtime code, no user-facing behavior change, and no security relevance.
No security action needed. Treat as a normal testing-infrastructure maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies scripts/install_bitcoind.sh to derive BITCOIND_DIR_VERSION from BITCOIND_VERSION: if the supplied version already contains a dot, it is used verbatim; otherwise ‘.0’ is appended. This fixes path mismatches when pulling patch-version Docker tags (e.g., 29.1) and removes the hardcoded DIR_SUFFIX=.0 default. The script remains a test/CI utility; no LND node logic, RPC handling, or cryptography is touched.
Changed components
scripts/install_bitcoind.shInspect captured patch +18 / −3
diff --git a/scripts/install_bitcoind.sh b/scripts/install_bitcoind.sh
index 8f74efa..0fdf576 100755
--- a/scripts/install_bitcoind.sh
+++ b/scripts/install_bitcoind.sh
@@ -4,9 +4,24 @@ set -ev
BITCOIND_VERSION=$1
-# Useful for testing RCs: e.g. TAG_SUFFIX=.0rc1, DIR_SUFFIX=.0rc1
+# The docker image tag and the install directory version don't always use the
+# same format. Major-only tags like `29` or `30` install into
+# `/opt/bitcoin-29.0` and `/opt/bitcoin-30.0`, while tags that already carry a
+# dot (patch releases like `29.1` or release candidates like `30.0rc1`) install
+# into a directory that matches the tag verbatim (`/opt/bitcoin-29.1`,
+# `/opt/bitcoin-30.0rc1`). Testing an RC therefore just means passing the full
+# version string as the first argument, e.g. `install_bitcoind.sh 30.0rc1`.
+if [[ "$BITCOIND_VERSION" == *.* ]]; then
+ BITCOIND_DIR_VERSION="$BITCOIND_VERSION"
+else
+ BITCOIND_DIR_VERSION="${BITCOIND_VERSION}.0"
+fi
+
+# TAG_SUFFIX and DIR_SUFFIX are kept as escape hatches for one-off images that
+# diverge from the conventions above (e.g. a privately pushed build); they are
+# empty by default and should stay that way for normal releases.
TAG_SUFFIX=
-DIR_SUFFIX=.0
+DIR_SUFFIX=
# Useful for testing against an image pushed to a different Docker repo.
REPO=lightninglabs/bitcoin-core
@@ -19,5 +34,5 @@ fi
docker pull ${REPO}:${BITCOIND_VERSION}${TAG_SUFFIX}
CONTAINER_ID=$(docker create ${REPO}:${BITCOIND_VERSION}${TAG_SUFFIX})
-sudo docker cp $CONTAINER_ID:/opt/bitcoin-${BITCOIND_VERSION}${DIR_SUFFIX}/bin/bitcoind /usr/local/bin/bitcoind
+sudo docker cp $CONTAINER_ID:/opt/bitcoin-${BITCOIND_DIR_VERSION}${DIR_SUFFIX}/bin/bitcoind /usr/local/bin/bitcoind
docker rm $CONTAINER_ID
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.