Skip to content

Commit 1981e1d

Browse files
committed
adapt tools to remote RPC connection
1 parent 4a37336 commit 1981e1d

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

scripts/menu.tools.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ function getQRstring {
4848
openMenuIfCancelled $?
4949
}
5050

51+
isLocalBitcoinCLI=$(sudo -u bitcoin bitcoin-cli -version|grep -c "Bitcoin Core RPC client")
52+
5153
# BASIC MENU INFO
52-
HEIGHT=13
54+
HEIGHT=11
5355
WIDTH=55
54-
CHOICE_HEIGHT=7
56+
CHOICE_HEIGHT=5
5557
TITLE="Tools"
5658
MENU=""
5759
OPTIONS=()
@@ -67,12 +69,20 @@ fi
6769
OPTIONS+=(
6870
QR "Display a QR code from any text"
6971
CUSTOMRPC "Run a custom bitcoin RPC with curl"
70-
SCANJM "Scan blocks for JoinMarket coinjoins"
71-
CHECKTXN "CLI transaction explorer"
72+
SCANJM "Scan blocks for JoinMarket coinjoins")
73+
if [ $isLocalBitcoinCLI -gt 0 ];then
74+
OPTIONS+=(
75+
CHECKTXN "CLI transaction explorer")
76+
HEIGHT=$((HEIGHT+1))
77+
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
78+
fi
79+
OPTIONS+=(
7280
BOLTZMANN "Analyze the entropy of a transaction")
7381
if [ "${runningEnv}" != mynode ]; then
7482
OPTIONS+=(
7583
PASSWORD "Change the ssh password")
84+
HEIGHT=$((HEIGHT+1))
85+
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
7686
fi
7787
OPTIONS+=(
7888
LOGS "Show the bitcoind logs on $network")
@@ -143,7 +153,7 @@ case $CHOICE in
143153
echo "Press ENTER to return to the menu..."
144154
read key;;
145155
SCANJM)
146-
BLOCKHEIGHT=$(sudo -u bitcoin bitcoin-cli getblockchaininfo\
156+
BLOCKHEIGHT=$(customRPC "" "getblockchaininfo" ""\
147157
|grep blocks|awk '{print $2}'|cut -d, -f1)
148158
dialog_inputbox "snicker-finder.py" \
149159
"\nUsing: https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/\

0 commit comments

Comments
 (0)