Skip to content

Commit

Permalink
gossipd: invalidate old gossip_stores.
Browse files Browse the repository at this point in the history
Incrementing version number means stores which were prior to the previous
commit will be removed, and refreshed.  The simplest fix, if not the most
efficient.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Sep 21, 2018
1 parent 0855422 commit 48de77d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gossipd/gossip_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* gossip_store -- On-disk storage related information
*/
#define GOSSIP_STORE_VERSION 2
#define GOSSIP_STORE_VERSION 3

struct gossip_store;
struct routing_state;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ def test_gossip_store_load(node_factory):
"""Make sure we can read canned gossip store"""
l1 = node_factory.get_node(start=False)
with open(os.path.join(l1.daemon.lightning_dir, 'gossip_store'), 'wb') as f:
f.write(bytearray.fromhex("02" # GOSSIP_VERSION
f.write(bytearray.fromhex("03" # GOSSIP_VERSION
"00000099" # len
"12abbbba" # csum
"1002" # WIRE_GOSSIP_STORE_NODE_ANNOUNCEMENT
Expand Down

0 comments on commit 48de77d

Please sign in to comment.