Skip to content

Commit 1ec9160

Browse files
cdeckerrustyrussell
authored andcommitted
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 <[email protected]>
1 parent da0792e commit 1ec9160

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/test_lightningd.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,13 +1266,18 @@ def test_permfail_htlc_out(self):
12661266
l2.daemon.wait_for_log('onchaind complete, forgetting peer')
12671267

12681268
def test_gossip_jsonrpc(self):
1269-
l1,l2 = self.connect()
1270-
1271-
self.fund_channel(l1,l2,10**5)
1269+
l1, l2 = self.line_graph(n=2)
12721270

12731271
# Shouldn't send announce signatures until 6 deep.
12741272
assert not l1.daemon.is_in_log('peer_out WIRE_ANNOUNCEMENT_SIGNATURES')
12751273

1274+
# Channels should be activated locally
1275+
wait_for(lambda: [c['active'] for c in l1.rpc.getchannels()['channels']] == [True])
1276+
1277+
# Make sure we can route through the channel, will raise on failure
1278+
l1.rpc.getroute(l2.info['id'], 100, 1)
1279+
1280+
# Now proceed to funding-depth and do a full gossip round
12761281
l1.bitcoin.generate_block(5)
12771282
# Could happen in either order.
12781283
l1.daemon.wait_for_logs(['peer_out WIRE_ANNOUNCEMENT_SIGNATURES',

0 commit comments

Comments
 (0)