gossipd: invalidate old gossip_stores.

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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-09-21 10:01:45 +09:30 committed by Christian Decker
parent 0855422110
commit 48de77d56e
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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