From 1ec916076fa6e89114fd7809f81138957e352ffa Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 6 Dec 2017 14:54:07 +0100 Subject: [PATCH] pytest: Change test_gossip_jsonrpc to cover local-only gossip Relatively simple: until we reach funding-depth the channels should be known locally, so we can already route through them, but they should not be announced to peers to which the connection is non-local. Signed-off-by: Christian Decker --- tests/test_lightningd.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index 6a76e1740..69601165e 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -1266,13 +1266,18 @@ class LightningDTests(BaseLightningDTests): l2.daemon.wait_for_log('onchaind complete, forgetting peer') def test_gossip_jsonrpc(self): - l1,l2 = self.connect() - - self.fund_channel(l1,l2,10**5) + l1, l2 = self.line_graph(n=2) # Shouldn't send announce signatures until 6 deep. assert not l1.daemon.is_in_log('peer_out WIRE_ANNOUNCEMENT_SIGNATURES') + # Channels should be activated locally + wait_for(lambda: [c['active'] for c in l1.rpc.getchannels()['channels']] == [True]) + + # Make sure we can route through the channel, will raise on failure + l1.rpc.getroute(l2.info['id'], 100, 1) + + # Now proceed to funding-depth and do a full gossip round l1.bitcoin.generate_block(5) # Could happen in either order. l1.daemon.wait_for_logs(['peer_out WIRE_ANNOUNCEMENT_SIGNATURES',