Qt: add closing warning if we have an unconfirmed local commitment tx with htlcs
add htlc direction (offered, received) to the htlc sweep_info name regtest: add test_reedeem_received_htlcs
This commit is contained in:
@@ -70,8 +70,11 @@ class TestLightningAB(TestLightning):
|
||||
def test_extract_preimage(self):
|
||||
self.run_shell(['extract_preimage'])
|
||||
|
||||
def test_redeem_htlcs(self):
|
||||
self.run_shell(['redeem_htlcs'])
|
||||
def test_redeem_received_htlcs(self):
|
||||
self.run_shell(['redeem_received_htlcs'])
|
||||
|
||||
def test_redeem_offered_htlcs(self):
|
||||
self.run_shell(['redeem_offered_htlcs'])
|
||||
|
||||
def test_breach_with_unspent_htlc(self):
|
||||
self.run_shell(['breach_with_unspent_htlc'])
|
||||
|
||||
@@ -342,7 +342,8 @@ if [[ $1 == "extract_preimage" ]]; then
|
||||
fi
|
||||
|
||||
|
||||
if [[ $1 == "redeem_htlcs" ]]; then
|
||||
if [[ $1 == "redeem_offered_htlcs" ]]; then
|
||||
# alice force closes and redeems using htlc timeout
|
||||
$bob enable_htlc_settle false
|
||||
wait_for_balance alice 1
|
||||
echo "alice opens channel"
|
||||
@@ -384,6 +385,32 @@ if [[ $1 == "redeem_htlcs" ]]; then
|
||||
fi
|
||||
|
||||
|
||||
if [[ $1 == "redeem_received_htlcs" ]]; then
|
||||
# bob force closes and redeems with the preimage
|
||||
$bob enable_htlc_settle false
|
||||
wait_for_balance alice 1
|
||||
echo "alice opens channel"
|
||||
bob_node=$($bob nodeid)
|
||||
$alice open_channel $bob_node 0.15 --password=''
|
||||
new_blocks 3
|
||||
wait_until_channel_open alice
|
||||
# alice pays bob
|
||||
invoice=$($bob add_request 0.04 --lightning --memo "test" | jq -r ".lightning_invoice")
|
||||
$alice lnpay $invoice --timeout=1 || true
|
||||
unsettled=$($alice list_channels | jq '.[] | .local_unsettled_sent')
|
||||
if [[ "$unsettled" == "0" ]]; then
|
||||
echo 'enable_htlc_settle did not work'
|
||||
exit 1
|
||||
fi
|
||||
$alice stop
|
||||
chan_id=$($bob list_channels | jq -r ".[0].channel_point")
|
||||
$bob close_channel $chan_id --force
|
||||
# if we exit here, bob GUI will show a warning
|
||||
new_blocks 1
|
||||
wait_for_balance bob 1.039
|
||||
fi
|
||||
|
||||
|
||||
if [[ $1 == "breach_with_unspent_htlc" ]]; then
|
||||
$bob enable_htlc_settle false
|
||||
wait_for_balance alice 1
|
||||
|
||||
Reference in New Issue
Block a user