@@ -847,6 +847,9 @@ impl NetworkGraph {
847
847
None => Err ( LightningError { err : "No existing channels for node_announcement" . to_owned ( ) , action : ErrorAction :: IgnoreError } ) ,
848
848
Some ( node) => {
849
849
if let Some ( node_info) = node. announcement_info . as_ref ( ) {
850
+ // The timestamp field is somewhat of a misnomer - the BOLTs use it to order
851
+ // updates to ensure you always have the latest one, only vaguely suggesting
852
+ // that it be at least the current time.
850
853
if node_info. last_update > msg. timestamp {
851
854
return Err ( LightningError { err : "Update older than last processed update" . to_owned ( ) , action : ErrorAction :: IgnoreAndLog ( Level :: Gossip ) } ) ;
852
855
} else if node_info. last_update == msg. timestamp {
@@ -1084,6 +1087,12 @@ impl NetworkGraph {
1084
1087
macro_rules! maybe_update_channel_info {
1085
1088
( $target: expr, $src_node: expr) => {
1086
1089
if let Some ( existing_chan_info) = $target. as_ref( ) {
1090
+ // The timestamp field is somewhat of a misnomer - the BOLTs use it to
1091
+ // order updates to ensure you always have the latest one, only
1092
+ // suggesting that it be at least the current time. For
1093
+ // channel_updates specifically, the BOLTs discuss the possibility of
1094
+ // pruning based on the timestamp field being more than two weeks old,
1095
+ // but only in the non-normative section.
1087
1096
if existing_chan_info. last_update > msg. timestamp {
1088
1097
return Err ( LightningError { err: "Update older than last processed update" . to_owned( ) , action: ErrorAction :: IgnoreAndLog ( Level :: Gossip ) } ) ;
1089
1098
} else if existing_chan_info. last_update == msg. timestamp {
0 commit comments