routing: update chan pruning test w/ new zombie logic

This commit is contained in:
Olaoluwa Osuntokun 2021-03-23 16:58:55 -07:00
parent e3a8b3b0c4
commit 916059da48
No known key found for this signature in database
GPG Key ID: 3BBD59E99B280306

@ -1946,8 +1946,8 @@ func TestPruneChannelGraphStaleEdges(t *testing.T) {
freshTimestamp := time.Now() freshTimestamp := time.Now()
staleTimestamp := time.Unix(0, 0) staleTimestamp := time.Unix(0, 0)
// We'll create the following test graph so that only the last channel // We'll create the following test graph so that two of the channels
// is pruned. // are pruned.
testChannels := []*testChannel{ testChannels := []*testChannel{
// No edges. // No edges.
{ {
@ -2037,8 +2037,10 @@ func TestPruneChannelGraphStaleEdges(t *testing.T) {
t.Fatalf("unable to prune zombie channels: %v", err) t.Fatalf("unable to prune zombie channels: %v", err)
} }
prunedChannel := testChannels[len(testChannels)-1].ChannelID // We expect channels that have either both edges stale, or one edge
assertChannelsPruned(t, ctx.graph, testChannels, prunedChannel) // stale with both known.
prunedChannels := []uint64{4, 6}
assertChannelsPruned(t, ctx.graph, testChannels, prunedChannels...)
} }
// TestPruneChannelGraphDoubleDisabled test that we can properly prune channels // TestPruneChannelGraphDoubleDisabled test that we can properly prune channels