Skip to content

Commit 83930c6

Browse files
committed
bitcoin: update to v0.21.1 from bitcoincore.org
1 parent 19440e9 commit 83930c6

1 file changed

Lines changed: 12 additions & 29 deletions

File tree

scripts/_functions.bitcoincore.sh

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,20 @@
44
function downloadBitcoinCore() {
55
# set version
66
# https://bitcoincore.org/en/download/
7-
bitcoinVersion="0.21.0"
7+
bitcoinVersion="0.21.1"
88

99
# needed to check code signing
1010
laanwjPGP="01EA5486DE18A882D4C2684590C8019E36C2E964"
1111

12-
echo "# Detecting CPU architecture ..."
13-
isARM=$(uname -m | grep -c 'arm')
14-
isAARCH64=$(uname -m | grep -c 'aarch64')
15-
isX86_64=$(uname -m | grep -c 'x86_64')
16-
if [ ${isARM} -eq 0 ] && [ ${isAARCH64} -eq 0 ] && [ ${isX86_64} -eq 0 ]; then
17-
echo "# !!! FAIL !!!"
18-
echo "# Can only build on ARM, aarch64, x86_64 not on:"
19-
uname -m
20-
exit 1
21-
else
22-
echo "# OK running on $(uname -m) architecture."
12+
# detect CPU architecture & fitting download link
13+
if [ $(uname -m | grep -c 'arm') -eq 1 ] ; then
14+
bitcoinOSversion="arm-linux-gnueabihf"
15+
fi
16+
if [ $(uname -m | grep -c 'aarch64') -eq 1 ] ; then
17+
bitcoinOSversion="aarch64-linux-gnu"
18+
fi
19+
if [ $(uname -m | grep -c 'x86_64') -eq 1 ] ; then
20+
bitcoinOSversion="x86_64-linux-gnu"
2321
fi
2422

2523
echo
@@ -49,7 +47,7 @@ function downloadBitcoinCore() {
4947

5048
# download signed binary sha256 hash sum file and check
5149
if [ ! -f "SHA256SUMS.asc" ];then
52-
sudo -u joinmarket wget https://bitcoin.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc
50+
sudo -u joinmarket wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/SHA256SUMS.asc
5351
else
5452
echo "SHA256SUMS.asc is already present"
5553
fi
@@ -66,31 +64,16 @@ function downloadBitcoinCore() {
6664
exit 1
6765
else
6866
echo
69-
echo "# ****************************************"
7067
echo "# OK --> BITCOIN MANIFEST IS CORRECT"
71-
echo "# ****************************************"
7268
echo
7369
fi
74-
75-
# get the sha256 value for the corresponding platform from signed hash sum file
76-
if [ ${isARM} -eq 1 ] ; then
77-
bitcoinOSversion="arm-linux-gnueabihf"
78-
fi
79-
if [ ${isAARCH64} -eq 1 ] ; then
80-
bitcoinOSversion="aarch64-linux-gnu"
81-
fi
82-
if [ ${isX86_64} -eq 1 ] ; then
83-
bitcoinOSversion="x86_64-linux-gnu"
84-
fi
85-
bitcoinSHA256=$(grep -i "$bitcoinOSversion" SHA256SUMS.asc | cut -d " " -f1)
86-
8770
echo
8871
echo "# BITCOIN v${bitcoinVersion} for ${bitcoinOSversion}"
8972

9073
# download resources
9174
binaryName="bitcoin-${bitcoinVersion}-${bitcoinOSversion}.tar.gz"
9275
if [ ! -f "./${binaryName}" ];then
93-
sudo -u joinmarket wget https://bitcoin.org/bin/bitcoin-core-${bitcoinVersion}/${binaryName}
76+
sudo -u joinmarket wget https://bitcoincore.org/bin/bitcoin-core-${bitcoinVersion}/${binaryName}
9477
else
9578
echo "# ${binaryName} was already downloaded"
9679
fi

0 commit comments

Comments
 (0)