Skip to content

Commit 28d25a1

Browse files
committed
ld: Enable anchor outputs on liquid and liquid-regtest
Changelog-Changed: liquid: Added support for anchor outputs for liquid channels
1 parent 459c756 commit 28d25a1

File tree

4 files changed

+11
-30
lines changed

4 files changed

+11
-30
lines changed

lightningd/options.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,13 +1784,6 @@ void handle_early_opts(struct lightningd *ld, int argc, char *argv[])
17841784
else
17851785
ld->config = mainnet_config;
17861786

1787-
/* No anchors if we're elements */
1788-
if (chainparams->is_elements) {
1789-
feature_set_sub(ld->our_features,
1790-
feature_set_for_feature(tmpctx,
1791-
OPTIONAL_FEATURE(OPT_ANCHORS_ZERO_FEE_HTLC_TX)));
1792-
}
1793-
17941787
/* Set the ln_port given from chainparams */
17951788
ld->config.ip_discovery_port = chainparams->ln_port;
17961789

tests/test_connection.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3584,17 +3584,11 @@ def test_wumbo_channels(node_factory, bitcoind):
35843584
@pytest.mark.openchannel('v2')
35853585
@pytest.mark.parametrize("anchors", [False, True])
35863586
def test_channel_features(node_factory, bitcoind, anchors):
3587-
if TEST_NETWORK == 'regtest':
3588-
if anchors is False:
3589-
opts = {'dev-force-features': "-23"}
3590-
else:
3591-
opts = {}
3587+
if anchors is False:
3588+
opts = {'dev-force-features': "-23"}
35923589
else:
3593-
# We have to force this ON for elements!
3594-
if anchors is False:
3595-
opts = {}
3596-
else:
3597-
opts = {'dev-force-features': "+23"}
3590+
opts = {}
3591+
35983592
l1, l2 = node_factory.line_graph(2, fundchannel=False, opts=opts)
35993593

36003594
bitcoind.rpc.sendtoaddress(l1.rpc.newaddr()['bech32'], 0.1)

tests/test_opening.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,10 +1642,10 @@ def test_zeroconf_open(bitcoind, node_factory):
16421642
# and use their own mindepth=6, while l3 uses mindepth=2 from the
16431643
# plugin
16441644
ret = l2.rpc.fundchannel(l3.info['id'], 'all', mindepth=0)
1645-
if TEST_NETWORK == 'regtest':
1646-
channel_type = {'bits': [12, 22, 50], 'names': ['static_remotekey/even', 'anchors/even', 'zeroconf/even']}
1647-
else:
1648-
channel_type = {'bits': [12, 50], 'names': ['static_remotekey/even', 'zeroconf/even']}
1645+
channel_type = {
1646+
'bits': [12, 22, 50],
1647+
'names': ['static_remotekey/even', 'anchors/even', 'zeroconf/even']
1648+
}
16491649
assert ret['channel_type'] == channel_type
16501650
assert only_one(l2.rpc.listpeerchannels(l3.info['id'])['channels'])['channel_type'] == channel_type
16511651

@@ -1724,7 +1724,7 @@ def test_zeroconf_public(bitcoind, node_factory, chainparams):
17241724
assert('short_channel_id' not in l2chan)
17251725

17261726
# Channel is "proposed"
1727-
chan_val = 993888000 if chainparams['elements'] else 970073000
1727+
chan_val = 966908000 if chainparams['elements'] else 970073000
17281728
l1_mvts = [
17291729
{'type': 'chain_mvt', 'credit_msat': chan_val, 'debit_msat': 0, 'tags': ['channel_proposed', 'opener']},
17301730
{'type': 'channel_mvt', 'credit_msat': 0, 'debit_msat': 20000000, 'tags': ['pushed'], 'fees_msat': '0msat'},

tests/utils.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,25 @@ def hex_bits(features):
4141

4242
def expected_peer_features(extra=[]):
4343
"""Return the expected peer features hexstring for this configuration"""
44-
features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 35, 39, 45, 47, 51]
44+
features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 23, 25, 27, 35, 39, 45, 47, 51]
4545
if EXPERIMENTAL_DUAL_FUND:
4646
# option_dual_fund
4747
features += [29]
4848
if EXPERIMENTAL_SPLICING:
4949
features += [63] # option_splice
50-
if TEST_NETWORK != 'liquid-regtest':
51-
# Anchors, except for elements
52-
features += [23]
5350
return hex_bits(features + extra)
5451

5552

5653
# With the addition of the keysend plugin, we now send a different set of
5754
# features for the 'node' and the 'peer' feature sets
5855
def expected_node_features(extra=[]):
5956
"""Return the expected node features hexstring for this configuration"""
60-
features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 25, 27, 35, 39, 45, 47, 51, 55]
57+
features = [0, 5, 7, 8, 11, 12, 14, 17, 19, 23, 25, 27, 35, 39, 45, 47, 51, 55]
6158
if EXPERIMENTAL_DUAL_FUND:
6259
# option_dual_fund
6360
features += [29]
6461
if EXPERIMENTAL_SPLICING:
6562
features += [63] # option_splice
66-
if TEST_NETWORK != 'liquid-regtest':
67-
# Anchors, except for elements
68-
features += [23]
6963
return hex_bits(features + extra)
7064

7165

0 commit comments

Comments
 (0)