diff --git a/tests/test_gossip.py b/tests/test_gossip.py index a0f37c84f..c7753e4d2 100644 --- a/tests/test_gossip.py +++ b/tests/test_gossip.py @@ -39,7 +39,9 @@ def test_gossip_pruning(node_factory, bitcoind): scid2, _ = l2.fundchannel(l3, 10**6) mine_funding_to_announce(bitcoind, [l1, l2, l3]) + l1_initial_cupdate_timestamp = only_one(l1.rpc.listchannels(source=l1.info['id'])['channels'])['last_update'] + # Get timestamps of initial updates, so we can ensure they change. # Channels should be activated locally wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [True] * 4) wait_for(lambda: [c['active'] for c in l2.rpc.listchannels()['channels']] == [True] * 4) @@ -57,6 +59,10 @@ def test_gossip_pruning(node_factory, bitcoind): 'Sending keepalive channel_update for {}'.format(scid2), ]) + # Everyone should see l1's update change. + for n in (l1, l2, l3): + wait_for(lambda: only_one(n.rpc.listchannels(source=l1.info['id'])['channels'])['last_update'] != l1_initial_cupdate_timestamp) + # Now kill l2, so that l1 and l3 will prune from their view after 60 seconds l2.stop()