gossipd: prune announced-but-not-updated channels eventually.

We currently give them a free pass.  The simplest fix is to give them
an old timestamp on initialization.

We still skip unannounced channels, on the assumption that they're
ours.  And we set the last_update_timestamp to -1 when we convert to
gossip_getchannels_entry to indicate no update.

This breaks the DEVELOPER=1 pruning test, since we hardcode the 1
week timeout.  That's fixed in the next patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-03-02 19:29:17 +10:30
committed by Christian Decker
parent b7ec2c8c9c
commit b7bf414ac4
3 changed files with 6 additions and 5 deletions

View File

@@ -1854,7 +1854,7 @@ 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]
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1 for --dev-broadcast-interval")
@unittest.skip("Temporarily broken for short pruning times")
def test_gossip_pruning(self):
""" Create channel and see it being updated in time before pruning
"""