|
|
@ -2102,6 +2102,36 @@ class LightningDTests(BaseLightningDTests): |
|
|
|
assert [c['active'] for c in l2.rpc.listchannels()['channels']] == [True, True] |
|
|
|
assert [c['public'] for c in l2.rpc.listchannels()['channels']] == [True, True] |
|
|
|
|
|
|
|
def test_gossip_weirdalias(self): |
|
|
|
weird_name = '\t \n \" \n \r \n \\' |
|
|
|
l1 = self.node_factory.get_node(options=['--alias={}' |
|
|
|
.format(weird_name)]) |
|
|
|
weird_name_json = json.encoder.JSONEncoder().encode(weird_name)[1:-1].replace('\\', '\\\\') |
|
|
|
aliasline = l1.daemon.is_in_log('Server started with public key .* alias') |
|
|
|
# FIXME: alias needs json escaping. |
|
|
|
assert weird_name_json not in str(aliasline) |
|
|
|
normal_name = 'Normal name' |
|
|
|
l2 = self.node_factory.get_node(options=['--alias={}' |
|
|
|
.format(normal_name)]) |
|
|
|
assert l2.daemon.is_in_log('Server started with public key .* alias {}' |
|
|
|
.format(normal_name)) |
|
|
|
|
|
|
|
l1.rpc.connect(l2.info['id'], 'localhost', l2.info['port']) |
|
|
|
self.fund_channel(l2, l1, 10**6) |
|
|
|
bitcoind.rpc.generate(6) |
|
|
|
|
|
|
|
# They should gossip together. |
|
|
|
l1.daemon.wait_for_log('Received node_announcement for node {}' |
|
|
|
.format(l2.info['id'])) |
|
|
|
l2.daemon.wait_for_log('Received node_announcement for node {}' |
|
|
|
.format(l1.info['id'])) |
|
|
|
|
|
|
|
node = l1.rpc.listnodes(l1.info['id'])['nodes'][0] |
|
|
|
# FIXME: We get this wrong! |
|
|
|
assert not node['alias'] == weird_name |
|
|
|
node = l2.rpc.listnodes(l1.info['id'])['nodes'][0] |
|
|
|
assert not node['alias'] == weird_name |
|
|
|
|
|
|
|
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1 for --dev-broadcast-interval") |
|
|
|
def test_gossip_pruning(self): |
|
|
|
""" Create channel and see it being updated in time before pruning |
|
|
|