|
@ -110,10 +110,10 @@ if [[ $1 == "forwarding" ]]; then |
|
|
echo "mining 3 blocks" |
|
|
echo "mining 3 blocks" |
|
|
new_blocks 3 |
|
|
new_blocks 3 |
|
|
sleep 10 # time for channelDB |
|
|
sleep 10 # time for channelDB |
|
|
request=$($carol add_lightning_request 0.0001 -m "blah") |
|
|
request=$($carol add_lightning_request 0.0001 -m "blah" | jq -r ".invoice") |
|
|
$carol setconfig test_fail_malformed_htlc true |
|
|
$carol setconfig test_fail_malformed_htlc true |
|
|
$alice lnpay $request |
|
|
$alice lnpay $request |
|
|
request2=$($carol add_lightning_request 0.0001 -m "blah") |
|
|
request2=$($carol add_lightning_request 0.0001 -m "blah" | jq -r ".invoice") |
|
|
$carol setconfig test_fail_malformed_htlc false |
|
|
$carol setconfig test_fail_malformed_htlc false |
|
|
$alice lnpay $request2 |
|
|
$alice lnpay $request2 |
|
|
carol_balance=$($carol list_channels | jq -r '.[0].local_balance') |
|
|
carol_balance=$($carol list_channels | jq -r '.[0].local_balance') |
|
@ -138,12 +138,12 @@ if [[ $1 == "breach" ]]; then |
|
|
channel=$($alice open_channel $bob_node 0.15) |
|
|
channel=$($alice open_channel $bob_node 0.15) |
|
|
new_blocks 3 |
|
|
new_blocks 3 |
|
|
wait_until_channel_open alice |
|
|
wait_until_channel_open alice |
|
|
request=$($bob add_lightning_request 0.01 -m "blah") |
|
|
request=$($bob add_lightning_request 0.01 -m "blah" | jq -r ".invoice") |
|
|
echo "alice pays" |
|
|
echo "alice pays" |
|
|
$alice lnpay $request |
|
|
$alice lnpay $request |
|
|
sleep 2 |
|
|
sleep 2 |
|
|
ctx=$($alice get_channel_ctx $channel --iknowwhatimdoing) |
|
|
ctx=$($alice get_channel_ctx $channel --iknowwhatimdoing) |
|
|
request=$($bob add_lightning_request 0.01 -m "blah2") |
|
|
request=$($bob add_lightning_request 0.01 -m "blah2" | jq -r ".invoice") |
|
|
echo "alice pays again" |
|
|
echo "alice pays again" |
|
|
$alice lnpay $request |
|
|
$alice lnpay $request |
|
|
echo "alice broadcasts old ctx" |
|
|
echo "alice broadcasts old ctx" |
|
@ -167,7 +167,7 @@ if [[ $1 == "extract_preimage" ]]; then |
|
|
wait_until_channel_open alice |
|
|
wait_until_channel_open alice |
|
|
chan_id=$($alice list_channels | jq -r ".[0].channel_point") |
|
|
chan_id=$($alice list_channels | jq -r ".[0].channel_point") |
|
|
# alice pays bob |
|
|
# alice pays bob |
|
|
invoice=$($bob add_lightning_request 0.04 -m "test") |
|
|
invoice=$($bob add_lightning_request 0.04 -m "test" | jq -r ".invoice") |
|
|
screen -S alice_payment -dm -L -Logfile /tmp/alice/screen.log $alice lnpay $invoice --timeout=600 |
|
|
screen -S alice_payment -dm -L -Logfile /tmp/alice/screen.log $alice lnpay $invoice --timeout=600 |
|
|
sleep 1 |
|
|
sleep 1 |
|
|
unsettled=$($alice list_channels | jq '.[] | .local_unsettled_sent') |
|
|
unsettled=$($alice list_channels | jq '.[] | .local_unsettled_sent') |
|
@ -197,7 +197,7 @@ if [[ $1 == "redeem_htlcs" ]]; then |
|
|
new_blocks 3 |
|
|
new_blocks 3 |
|
|
wait_until_channel_open alice |
|
|
wait_until_channel_open alice |
|
|
# alice pays bob |
|
|
# alice pays bob |
|
|
invoice=$($bob add_lightning_request 0.04 -m "test") |
|
|
invoice=$($bob add_lightning_request 0.04 -m "test" | jq -r ".invoice") |
|
|
$alice lnpay $invoice --timeout=1 || true |
|
|
$alice lnpay $invoice --timeout=1 || true |
|
|
unsettled=$($alice list_channels | jq '.[] | .local_unsettled_sent') |
|
|
unsettled=$($alice list_channels | jq '.[] | .local_unsettled_sent') |
|
|
if [[ "$unsettled" == "0" ]]; then |
|
|
if [[ "$unsettled" == "0" ]]; then |
|
@ -239,7 +239,7 @@ if [[ $1 == "breach_with_unspent_htlc" ]]; then |
|
|
new_blocks 3 |
|
|
new_blocks 3 |
|
|
wait_until_channel_open alice |
|
|
wait_until_channel_open alice |
|
|
echo "alice pays bob" |
|
|
echo "alice pays bob" |
|
|
invoice=$($bob add_lightning_request 0.04 -m "test") |
|
|
invoice=$($bob add_lightning_request 0.04 -m "test" | jq -r ".invoice") |
|
|
$alice lnpay $invoice --timeout=1 || true |
|
|
$alice lnpay $invoice --timeout=1 || true |
|
|
unsettled=$($alice list_channels | jq '.[] | .local_unsettled_sent') |
|
|
unsettled=$($alice list_channels | jq '.[] | .local_unsettled_sent') |
|
|
if [[ "$unsettled" == "0" ]]; then |
|
|
if [[ "$unsettled" == "0" ]]; then |
|
@ -268,7 +268,7 @@ if [[ $1 == "breach_with_spent_htlc" ]]; then |
|
|
new_blocks 3 |
|
|
new_blocks 3 |
|
|
wait_until_channel_open alice |
|
|
wait_until_channel_open alice |
|
|
echo "alice pays bob" |
|
|
echo "alice pays bob" |
|
|
invoice=$($bob add_lightning_request 0.04 -m "test") |
|
|
invoice=$($bob add_lightning_request 0.04 -m "test" | jq -r ".invoice") |
|
|
$alice lnpay $invoice --timeout=1 || true |
|
|
$alice lnpay $invoice --timeout=1 || true |
|
|
ctx=$($alice get_channel_ctx $channel --iknowwhatimdoing) |
|
|
ctx=$($alice get_channel_ctx $channel --iknowwhatimdoing) |
|
|
unsettled=$($alice list_channels | jq '.[] | .local_unsettled_sent') |
|
|
unsettled=$($alice list_channels | jq '.[] | .local_unsettled_sent') |
|
@ -331,11 +331,11 @@ if [[ $1 == "watchtower" ]]; then |
|
|
new_blocks 3 |
|
|
new_blocks 3 |
|
|
wait_until_channel_open alice |
|
|
wait_until_channel_open alice |
|
|
echo "alice pays bob" |
|
|
echo "alice pays bob" |
|
|
invoice1=$($bob add_lightning_request 0.01 -m "invoice1") |
|
|
invoice1=$($bob add_lightning_request 0.01 -m "invoice1" | jq -r ".invoice") |
|
|
$alice lnpay $invoice1 |
|
|
$alice lnpay $invoice1 |
|
|
ctx=$($alice get_channel_ctx $channel --iknowwhatimdoing) |
|
|
ctx=$($alice get_channel_ctx $channel --iknowwhatimdoing) |
|
|
echo "alice pays bob again" |
|
|
echo "alice pays bob again" |
|
|
invoice2=$($bob add_lightning_request 0.01 -m "invoice2") |
|
|
invoice2=$($bob add_lightning_request 0.01 -m "invoice2" | jq -r ".invoice") |
|
|
$alice lnpay $invoice2 |
|
|
$alice lnpay $invoice2 |
|
|
msg="waiting until watchtower is synchronized" |
|
|
msg="waiting until watchtower is synchronized" |
|
|
while watchtower_ctn=$($carol get_watchtower_ctn $channel) && [ $watchtower_ctn != "3" ]; do |
|
|
while watchtower_ctn=$($carol get_watchtower_ctn $channel) && [ $watchtower_ctn != "3" ]; do |
|
|