(node_factory, bitcoind, executor)
| 622 | @pytest.mark.openchannel('v2') |
| 623 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') |
| 624 | def test_splice_stuck_htlc(node_factory, bitcoind, executor): |
| 625 | l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True) |
| 626 | |
| 627 | l3.rpc.dev_ignore_htlcs(id=l2.info['id'], ignore=True) |
| 628 | |
| 629 | inv = l3.rpc.invoice(10000000, '1', 'no_1') |
| 630 | executor.submit(l1.rpc.xpay, inv['bolt11']) |
| 631 | l3.daemon.wait_for_log('their htlc 0 dev_ignore_htlcs') |
| 632 | |
| 633 | # Now we should have a stuck invoice between l1 -> l2 |
| 634 | |
| 635 | chan_id = l1.get_channel_id(l2) |
| 636 | |
| 637 | # add extra sats to pay fee |
| 638 | funds_result = l1.rpc.fundpsbt("111722sat", 0, 0, excess_as_change=True) |
| 639 | |
| 640 | result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt']) |
| 641 | result = l1.rpc.splice_update(chan_id, result['psbt']) |
| 642 | assert(result['commitments_secured'] is False) |
| 643 | result = l1.rpc.splice_update(chan_id, result['psbt']) |
| 644 | assert(result['commitments_secured'] is True) |
| 645 | result = l1.rpc.signpsbt(result['psbt']) |
| 646 | result = l1.rpc.splice_signed(chan_id, result['signed_psbt']) |
| 647 | |
| 648 | l2.daemon.wait_for_log(r'CHANNELD_NORMAL to CHANNELD_AWAITING_SPLICE') |
| 649 | l1.daemon.wait_for_log(r'CHANNELD_NORMAL to CHANNELD_AWAITING_SPLICE') |
| 650 | |
| 651 | wait_for(lambda: len(list(bitcoind.rpc.getrawmempool(True).keys())) == 1) |
| 652 | mempool = bitcoind.rpc.getrawmempool(True) |
| 653 | assert result['txid'] in list(mempool.keys()) |
| 654 | |
| 655 | bitcoind.generate_block(1, wait_for_mempool=1) |
| 656 | # Don't have l2, l3 reject channel_announcement as too far in future. |
| 657 | sync_blockheight(bitcoind, [l1, l2, l3]) |
| 658 | bitcoind.generate_block(5) |
| 659 | |
| 660 | l2.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL') |
| 661 | l1.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL') |
| 662 | |
| 663 | # Check that the splice doesn't generate a unilateral close transaction |
| 664 | time.sleep(5) |
| 665 | assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0 |
| 666 | |
| 667 | |
| 668 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') |
nothing calls this directly
no test coverage detected