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 <decker.christian@gmail.com>
This commit is contained in:
parent
da0792e69c
commit
1ec916076f
|
@ -1266,13 +1266,18 @@ class LightningDTests(BaseLightningDTests):
|
||||||
l2.daemon.wait_for_log('onchaind complete, forgetting peer')
|
l2.daemon.wait_for_log('onchaind complete, forgetting peer')
|
||||||
|
|
||||||
def test_gossip_jsonrpc(self):
|
def test_gossip_jsonrpc(self):
|
||||||
l1,l2 = self.connect()
|
l1, l2 = self.line_graph(n=2)
|
||||||
|
|
||||||
self.fund_channel(l1,l2,10**5)
|
|
||||||
|
|
||||||
# Shouldn't send announce signatures until 6 deep.
|
# Shouldn't send announce signatures until 6 deep.
|
||||||
assert not l1.daemon.is_in_log('peer_out WIRE_ANNOUNCEMENT_SIGNATURES')
|
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)
|
l1.bitcoin.generate_block(5)
|
||||||
# Could happen in either order.
|
# Could happen in either order.
|
||||||
l1.daemon.wait_for_logs(['peer_out WIRE_ANNOUNCEMENT_SIGNATURES',
|
l1.daemon.wait_for_logs(['peer_out WIRE_ANNOUNCEMENT_SIGNATURES',
|
||||||
|
|
Loading…
Reference in New Issue