From 7bdf519a510e7bf5bdfa9028df7a17d14c13d2e2 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 17 Jul 2021 02:27:35 +0200 Subject: [PATCH] check lnd for valid seed --- home.admin/config.scripts/lnd.backup.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/lnd.backup.sh b/home.admin/config.scripts/lnd.backup.sh index 7c91c58b9..00cab9a8f 100755 --- a/home.admin/config.scripts/lnd.backup.sh +++ b/home.admin/config.scripts/lnd.backup.sh @@ -515,8 +515,27 @@ if [ ${mode} = "seed-import-gui" ]; then # check correct number of words wordcount=$(echo "${wordstring}" | wc -w) if [ ${wordcount} -eq 24 ]; then - echo "OK - 24 words" - wordsCorrect=1 + + # check if words are valid seed + source <(python /home/admin/config.scripts/blitz.mnemonic.py test "${wordstring}") + if [ "${valid}" == "0" ]; then + whiptail --title " WARNING " --yes-button "Try Again" --no-button "Cancel" --yesno " +The word list has 24 words BUT its not a +valid seed word list by our test. + +Please check for typos. + +" 52 52 + + if [ $? -eq 1 ]; then + clear + echo "# CANCEL empty results in: ${RESULTFILE}" + exit 1 + fi + else + echo "OK - 24 words" + wordsCorrect=1 + fi else whiptail --title " WARNING " \ --yes-button "Try Again" \