5
5
from pyln .client import RpcError , Millisatoshi
6
6
from utils import (
7
7
DEVELOPER , wait_for , TIMEOUT , only_one , sync_blockheight ,
8
- expected_node_features ,
8
+ expected_node_features , COMPAT , EXPERIMENTAL_FEATURES ,
9
9
mine_funding_to_announce , default_ln_port
10
10
)
11
11
@@ -124,6 +124,13 @@ def test_announce_address(node_factory, bitcoind):
124
124
'::' ],
125
125
'log-level' : 'io' ,
126
126
'dev-allow-localhost' : None }
127
+ if not EXPERIMENTAL_FEATURES : # BOLT7 DNS RFC #911
128
+ opts = {'disable-dns' : None , 'announce-addr' :
129
+ ['4acth47i6kxnvkewtm6q7ib2s3ufpo5sqbsnzjpbi7utijcltosqemad.onion' ,
130
+ '1.2.3.4:1234' ,
131
+ '::' ],
132
+ 'log-level' : 'io' ,
133
+ 'dev-allow-localhost' : None }
127
134
l1 , l2 = node_factory .get_nodes (2 , opts = [opts , {}])
128
135
129
136
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -133,6 +140,14 @@ def test_announce_address(node_factory, bitcoind):
133
140
l1 .wait_channel_active (scid )
134
141
l2 .wait_channel_active (scid )
135
142
143
+ if not EXPERIMENTAL_FEATURES : # BOLT7 DNS RFC #911
144
+ l1 .daemon .wait_for_log (r"\[OUT\] 0101.*47"
145
+ "010102030404d2"
146
+ "017f000001...."
147
+ "0200000000000000000000000000000000...."
148
+ "04e00533f3e8f2aedaa8969b3d0fa03a96e857bbb28064dca5e147e934244b9ba5023003...." )
149
+ return
150
+
136
151
# We should see it send node announce with all addresses (257 = 0x0101)
137
152
# Note: local ephemeral port is masked out.
138
153
# Note: Since we `disable-dns` it should not announce a resolved IPv4
@@ -158,6 +173,7 @@ def test_announce_address(node_factory, bitcoind):
158
173
assert addresses_dns [0 ]['port' ] == 1236
159
174
160
175
176
+ @unittest .skipIf (not EXPERIMENTAL_FEATURES , "BOLT7 DNS RFC #911" )
161
177
@pytest .mark .developer ("gossip without DEVELOPER=1 is slow" )
162
178
def test_announce_and_connect_via_dns (node_factory , bitcoind ):
163
179
""" Test that DNS annoucements propagate and can be used when connecting.
@@ -222,6 +238,7 @@ def test_announce_and_connect_via_dns(node_factory, bitcoind):
222
238
l4 .rpc .connect (l1 .info ['id' ])
223
239
224
240
241
+ @unittest .skipIf (not EXPERIMENTAL_FEATURES , "BOLT7 DNS RFC #911" )
225
242
def test_only_announce_one_dns (node_factory , bitcoind ):
226
243
# and test that we can't announce more than one DNS address
227
244
l1 = node_factory .get_node (expect_fail = True , start = False ,
@@ -230,6 +247,7 @@ def test_only_announce_one_dns(node_factory, bitcoind):
230
247
wait_for (lambda : l1 .daemon .is_in_stderr ("Only one DNS can be announced" ))
231
248
232
249
250
+ @unittest .skipIf (not EXPERIMENTAL_FEATURES , "BOLT7 DNS RFC #911" )
233
251
def test_announce_dns_without_port (node_factory , bitcoind ):
234
252
""" Checks that the port of a DNS announcement is set to the corresponding
235
253
network port. In this case regtest 19846
0 commit comments