@@ -127,6 +127,7 @@ pub struct NetworkGraph {
127
127
// Lock order: channels -> nodes
128
128
channels : RwLock < BTreeMap < u64 , ChannelInfo > > ,
129
129
nodes : RwLock < BTreeMap < NodeId , NodeInfo > > ,
130
+ last_rapid_gossip_sync_timestamp : Option < u32 > ,
130
131
}
131
132
132
133
impl Clone for NetworkGraph {
@@ -137,6 +138,7 @@ impl Clone for NetworkGraph {
137
138
genesis_hash : self . genesis_hash . clone ( ) ,
138
139
channels : RwLock :: new ( channels. clone ( ) ) ,
139
140
nodes : RwLock :: new ( nodes. clone ( ) ) ,
141
+ last_rapid_gossip_sync_timestamp : self . last_rapid_gossip_sync_timestamp . clone ( ) ,
140
142
}
141
143
}
142
144
}
@@ -990,7 +992,9 @@ impl Writeable for NetworkGraph {
990
992
node_info. write ( writer) ?;
991
993
}
992
994
993
- write_tlv_fields ! ( writer, { } ) ;
995
+ write_tlv_fields ! ( writer, {
996
+ ( 1 , self . last_rapid_gossip_sync_timestamp, option) ,
997
+ } ) ;
994
998
Ok ( ( ) )
995
999
}
996
1000
}
@@ -1014,12 +1018,18 @@ impl Readable for NetworkGraph {
1014
1018
let node_info = Readable :: read ( reader) ?;
1015
1019
nodes. insert ( node_id, node_info) ;
1016
1020
}
1017
- read_tlv_fields ! ( reader, { } ) ;
1021
+
1022
+ let mut last_rapid_gossip_sync_timestamp: Option < u32 > = None ;
1023
+
1024
+ read_tlv_fields ! ( reader, {
1025
+ ( 1 , last_rapid_gossip_sync_timestamp, option) ,
1026
+ } ) ;
1018
1027
1019
1028
Ok ( NetworkGraph {
1020
1029
genesis_hash,
1021
1030
channels : RwLock :: new ( channels) ,
1022
1031
nodes : RwLock :: new ( nodes) ,
1032
+ last_rapid_gossip_sync_timestamp,
1023
1033
} )
1024
1034
}
1025
1035
}
@@ -1053,6 +1063,7 @@ impl NetworkGraph {
1053
1063
genesis_hash,
1054
1064
channels : RwLock :: new ( BTreeMap :: new ( ) ) ,
1055
1065
nodes : RwLock :: new ( BTreeMap :: new ( ) ) ,
1066
+ last_rapid_gossip_sync_timestamp : None ,
1056
1067
}
1057
1068
}
1058
1069
0 commit comments