Skip to content

Commit

Permalink
gossipd: count deleted records correctly when loading gossip_store.
Browse files Browse the repository at this point in the history
The result of an incorrect count was that we failed on next compaction.

Fixes: #2743
Fixes: #2742
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Jun 14, 2019
1 parent 12a523f commit eb5cc47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gossipd/gossip_store.c
Expand Up @@ -541,6 +541,8 @@ bool gossip_store_load(struct routing_state *rstate, struct gossip_store *gs)

/* Skip deleted entries */
if (be32_to_cpu(hdr.len) & GOSSIP_STORE_LEN_DELETED_BIT) {
/* Count includes deleted! */
gs->count++;
gs->deleted++;
goto next;
}
Expand Down
1 change: 0 additions & 1 deletion tests/test_gossip.py
Expand Up @@ -1155,7 +1155,6 @@ def test_gossip_store_compact(node_factory, bitcoind):
wait_for(lambda: l2.daemon.is_in_log('gossip_store: Read '))


@pytest.mark.xfail(strict=True)
@unittest.skipIf(not DEVELOPER, "need dev-compact-gossip-store")
def test_gossip_store_compact_restart(node_factory, bitcoind):
l2 = setup_gossip_store_test(node_factory, bitcoind)
Expand Down

0 comments on commit eb5cc47

Please sign in to comment.