1
0

Allow user to enable lightning in the GUI. Make it a per-wallet setting.

This commit is contained in:
ThomasV
2019-10-13 20:34:38 +02:00
parent a201ed44df
commit 90ce9f195b
12 changed files with 90 additions and 76 deletions

View File

@@ -4,9 +4,9 @@ set -eu
# alice -> bob -> carol
alice="./run_electrum --regtest --lightning -D /tmp/alice"
bob="./run_electrum --regtest --lightning -D /tmp/bob"
carol="./run_electrum --regtest --lightning -D /tmp/carol"
alice="./run_electrum --regtest -D /tmp/alice"
bob="./run_electrum --regtest -D /tmp/bob"
carol="./run_electrum --regtest -D /tmp/carol"
bitcoin_cli="bitcoin-cli -rpcuser=doggman -rpcpassword=donkey -rpcport=18554 -regtest"
@@ -18,7 +18,7 @@ function new_blocks()
function wait_for_balance()
{
msg="wait until $1's balance reaches $2"
cmd="./run_electrum --regtest --lightning -D /tmp/$1"
cmd="./run_electrum --regtest -D /tmp/$1"
while balance=$($cmd getbalance | jq '[.confirmed, .unconfirmed] | to_entries | map(select(.value != null).value) | map(tonumber) | add ') && (( $(echo "$balance < $2" | bc -l) )); do
sleep 1
msg="$msg."
@@ -30,7 +30,7 @@ function wait_for_balance()
function wait_until_channel_open()
{
msg="wait until $1 sees channel open"
cmd="./run_electrum --regtest --lightning -D /tmp/$1"
cmd="./run_electrum --regtest -D /tmp/$1"
while channel_state=$($cmd list_channels | jq '.[0] | .state' | tr -d '"') && [ $channel_state != "OPEN" ]; do
sleep 1
msg="$msg."
@@ -42,7 +42,7 @@ function wait_until_channel_open()
function wait_until_channel_closed()
{
msg="wait until $1 sees channel closed"
cmd="./run_electrum --regtest --lightning -D /tmp/$1"
cmd="./run_electrum --regtest -D /tmp/$1"
while [[ $($cmd list_channels | jq '.[0].state' | tr -d '"') != "CLOSED" ]]; do
sleep 1
msg="$msg."
@@ -73,6 +73,9 @@ if [[ $1 == "init" ]]; then
$alice create --offline > /dev/null
$bob create --offline > /dev/null
$carol create --offline > /dev/null
$alice -o init_lightning
$bob -o init_lightning
$carol -o init_lightning
$alice setconfig --offline log_to_file True
$bob setconfig --offline log_to_file True
$carol setconfig --offline log_to_file True