Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3882,7 +3882,7 @@ def test_htlc_no_force_close(node_factory, bitcoind, anchors):
for opt in opts:
opt['dev-force-features'] = "-23"

l1, l2, l3 = node_factory.line_graph(3, opts=opts)
l1, l2, l3 = node_factory.line_graph(3, opts=opts, wait_for_announce=True)

MSATS = 12300000
inv = l3.rpc.invoice(MSATS, 'label', 'description')
Expand Down Expand Up @@ -3911,11 +3911,11 @@ def censoring_sendrawtx(r):
# l3 gets upset, drops to chain when there are < 4 blocks remaining.
# But tx doesn't get mined...
bitcoind.generate_block(8)
l3.daemon.wait_for_log("Peer permanent failure in CHANNELD_NORMAL: Fulfilled HTLC 0 SENT_REMOVE_.* cltv 114 hit deadline")
l3.daemon.wait_for_log("Peer permanent failure in CHANNELD_NORMAL: Fulfilled HTLC 0 SENT_REMOVE_.* cltv 119 hit deadline")

# l2 closes drops the commitment tx at block 115 (one block after timeout)
bitcoind.generate_block(4)
l2.daemon.wait_for_log("Peer permanent failure in CHANNELD_NORMAL: Offered HTLC 0 SENT_ADD_ACK_REVOCATION cltv 114 hit deadline")
l2.daemon.wait_for_log("Peer permanent failure in CHANNELD_NORMAL: Offered HTLC 0 SENT_ADD_ACK_REVOCATION cltv 119 hit deadline")
l1.set_feerates((15000, 15000, 15000, 15000))

# Two more blocks, with no htlc tx.
Expand All @@ -3926,7 +3926,7 @@ def censoring_sendrawtx(r):
bitcoind.generate_block(1, needfeerate=9999999)

# l2 will have abandoned l2->l3 HTLC to close l1->l2.
l2.daemon.wait_for_log(r'Abandoning unresolved onchain HTLC at block 117 \(expired at 114\) to avoid peer closing incoming HTLC at block 120')
l2.daemon.wait_for_log(r'Abandoning unresolved onchain HTLC at block 122 \(expired at 119\) to avoid peer closing incoming HTLC at block 125')

# l1 should not have force-closed, htlc should be finished by l2.
assert not l1.daemon.is_in_log('Peer permanent failure in CHANNELD_NORMAL')
Expand Down Expand Up @@ -4056,6 +4056,7 @@ def test_peer_anchor_push(node_factory, bitcoind, executor, chainparams):
l2.daemon.wait_for_log("sendrawtx exit 0")
# Check feerate for entire package (commitment tx + anchor) is ~ correct
details = bitcoind.rpc.getrawmempool(True).values()
print(f"mempool = {details}")
total_weight = sum([d['weight'] for d in details])
total_fees = sum([float(d['fees']['base']) * 100_000_000 for d in details])
total_feerate_perkw = total_fees / total_weight * 1000
Expand Down
11 changes: 6 additions & 5 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,12 +654,13 @@ def test_disconnect_half_signed_v2(node_factory):
@pytest.mark.openchannel('v2')
def test_reconnect_signed(node_factory):
# This will fail *after* both sides consider channel opening.
disconnects = ['<WIRE_FUNDING_SIGNED']
if EXPERIMENTAL_DUAL_FUND:
disconnects = ['<WIRE_COMMITMENT_SIGNED']

l1 = node_factory.get_node(may_reconnect=True, disconnect=disconnects)
l2 = node_factory.get_node(may_reconnect=True)
# Definitely in DUALOPEND_OPEN_COMMITTED once it's trying to send this.
l1 = node_factory.get_node(may_reconnect=True)
l2 = node_factory.get_node(may_reconnect=True, disconnect=['-WIRE_TX_SIGNATURES'])
else:
l1 = node_factory.get_node(may_reconnect=True, disconnect=['<WIRE_FUNDING_SIGNED'])
l2 = node_factory.get_node(may_reconnect=True)

l1.fundwallet(2000000)

Expand Down
3 changes: 3 additions & 0 deletions tests/test_splicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def test_splice_rbf(node_factory, bitcoind):
inv = l2.rpc.invoice(10**2, '2', 'no_2')
l1.rpc.pay(inv['bolt11'])

# Make sure l1 doesn't unilateral close if HTLC hasn't completely settled before deadline.
wait_for(lambda: only_one(l1.rpc.listpeerchannels()['channels'])['htlcs'] == [])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool didn't know we had a way to do this 👍


bitcoind.generate_block(6, wait_for_mempool=1)

l2.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL')
Expand Down