Rather than have peer reject our shutdown, we should refuse to shutdown toa v1+ address if they don't support it
(node_factory, bitcoind)
| 3989 | |
| 3990 | @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Uses regtest addresses") |
| 3991 | def test_anysegwit_close_needs_feature(node_factory, bitcoind): |
| 3992 | """Rather than have peer reject our shutdown, we should refuse to shutdown toa v1+ address if they don't support it""" |
| 3993 | # L2 says "no option_shutdown_anysegwit" |
| 3994 | l1, l2 = node_factory.line_graph(2, opts=[{'may_reconnect': True}, |
| 3995 | {'may_reconnect': True, |
| 3996 | 'dev-force-features': -27}]) |
| 3997 | |
| 3998 | with pytest.raises(RpcError, match=r'Peer does not allow v1\+ shutdown addresses'): |
| 3999 | l1.rpc.close(l2.info['id'], destination='bcrt1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0ylj56') |
| 4000 | |
| 4001 | # From TFM: "Tell your friends to upgrade!" |
| 4002 | l2.stop() |
| 4003 | del l2.daemon.opts['dev-force-features'] |
| 4004 | l2.start() |
| 4005 | |
| 4006 | # Now it will work! |
| 4007 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 4008 | l1.rpc.close(l2.info['id'], destination='bcrt1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0ylj56') |
| 4009 | wait_for(lambda: only_one(l1.rpc.listpeerchannels()['channels'])['state'] == 'CLOSINGD_COMPLETE') |
| 4010 | bitcoind.generate_block(1, wait_for_mempool=1) |
| 4011 | |
| 4012 | |
| 4013 | def test_close_feerate_range(node_factory, bitcoind, chainparams): |
nothing calls this directly
no test coverage detected