mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-11-18 18:07:45 +01:00
new cashout
This commit is contained in:
@@ -41,25 +41,6 @@ if [ ${maxAmount} -eq 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# let user enter the amount
|
|
||||||
#l1="Enter the amount of funds you want to send/remove:"
|
|
||||||
#l2="You have max available: ${maxAmount} sat"
|
|
||||||
#l3="If you enter nothing, all funds available will be send."
|
|
||||||
#dialog --title "Remove Funds from RaspiBlitz" \
|
|
||||||
#--inputbox "$l1\n$l2\n$l3" 10 60 2>$_temp
|
|
||||||
#if test $? -eq 0
|
|
||||||
#then
|
|
||||||
# echo "ok pressed"
|
|
||||||
#else
|
|
||||||
# echo "cancel pressed"
|
|
||||||
# exit 1
|
|
||||||
#fi
|
|
||||||
#amount=$(cat $_temp | xargs)
|
|
||||||
#shred $_temp
|
|
||||||
#if [ ${#amount} -eq 0 ]; then
|
|
||||||
amount=${maxAmount}
|
|
||||||
#fi
|
|
||||||
|
|
||||||
# let user enter the address
|
# let user enter the address
|
||||||
l1="Enter on-chain address to send confirmed funds to:"
|
l1="Enter on-chain address to send confirmed funds to:"
|
||||||
l2="You will send: ${amount}"
|
l2="You will send: ${amount}"
|
||||||
@@ -90,18 +71,20 @@ tryAgain=1
|
|||||||
count=1
|
count=1
|
||||||
while [ ${tryAgain} -eq 1 ]
|
while [ ${tryAgain} -eq 1 ]
|
||||||
do
|
do
|
||||||
|
sleep 1
|
||||||
fee=$(($count * 1000))
|
fee=$(($count * 1000))
|
||||||
amount=$(($maxAmount - $fee))
|
amount=$(($maxAmount - $fee))
|
||||||
echo ""
|
echo ""
|
||||||
echo "TRY #${count} ---> with max fee ${fee} sat:"
|
echo "TRY #${count} ---> with max fee ${fee} sat:"
|
||||||
echo "$command"
|
|
||||||
|
# execute command
|
||||||
command="lncli --chain=${network} sendcoins --addr ${address} --amt ${amount} --conf_target 3"
|
command="lncli --chain=${network} sendcoins --addr ${address} --amt ${amount} --conf_target 3"
|
||||||
#result=$($command 2>$_error)
|
echo "$command"
|
||||||
#error=`cat ${_error}`
|
result=$($command 2>$_error)
|
||||||
error="sim error: insufficient funds available to construct transaction"
|
error=`cat ${_error}`
|
||||||
result=1
|
#error="sim error: insufficient funds available to construct transaction"
|
||||||
# on no result
|
#result=""
|
||||||
|
|
||||||
if [ ${#result} -eq 0 ]; then
|
if [ ${#result} -eq 0 ]; then
|
||||||
# fail - retry on 'insufficient funds available to construct transaction'
|
# fail - retry on 'insufficient funds available to construct transaction'
|
||||||
echo "FAIL: $error"
|
echo "FAIL: $error"
|
||||||
|
|||||||
Reference in New Issue
Block a user