Browse Source

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>
json-streaming
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
48de77d56e
  1. 2
      gossipd/gossip_store.h
  2. 2
      tests/test_gossip.py

2
gossipd/gossip_store.h

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

2
tests/test_gossip.py

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

Loading…
Cancel
Save