@@ -154,7 +154,7 @@ struct NodeInfo {
154
154
lowest_inbound_channel_fee_proportional_millionths : u32 ,
155
155
156
156
features : Features < FeatureContextNode > ,
157
- last_update : u32 ,
157
+ last_update : Option < u32 > ,
158
158
rgb : [ u8 ; 3 ] ,
159
159
alias : [ u8 ; 32 ] ,
160
160
addresses : Vec < NetAddress > ,
@@ -165,7 +165,7 @@ struct NodeInfo {
165
165
166
166
impl std:: fmt:: Display for NodeInfo {
167
167
fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> Result < ( ) , std:: fmt:: Error > {
168
- write ! ( f, "features: {}, last_update: {}, lowest_inbound_channel_fee_base_msat: {}, lowest_inbound_channel_fee_proportional_millionths: {}, channels: {:?}" , log_bytes!( self . features. encode( ) ) , self . last_update, self . lowest_inbound_channel_fee_base_msat, self . lowest_inbound_channel_fee_proportional_millionths, & self . channels[ ..] ) ?;
168
+ write ! ( f, "features: {}, last_update: {:? }, lowest_inbound_channel_fee_base_msat: {}, lowest_inbound_channel_fee_proportional_millionths: {}, channels: {:?}" , log_bytes!( self . features. encode( ) ) , self . last_update, self . lowest_inbound_channel_fee_base_msat, self . lowest_inbound_channel_fee_proportional_millionths, & self . channels[ ..] ) ?;
169
169
Ok ( ( ) )
170
170
}
171
171
}
@@ -428,12 +428,15 @@ impl RoutingMessageHandler for Router {
428
428
match network. nodes . get_mut ( & msg. contents . node_id ) {
429
429
None => Err ( LightningError { err : "No existing channels for node_announcement" , action : ErrorAction :: IgnoreError } ) ,
430
430
Some ( node) => {
431
- if node. last_update >= msg. contents . timestamp {
432
- return Err ( LightningError { err : "Update older than last processed update" , action : ErrorAction :: IgnoreError } ) ;
431
+ match node. last_update {
432
+ Some ( last_update) => if last_update >= msg. contents . timestamp {
433
+ return Err ( LightningError { err : "Update older than last processed update" , action : ErrorAction :: IgnoreError } ) ;
434
+ } ,
435
+ None => { } ,
433
436
}
434
437
435
438
node. features = msg. contents . features . clone ( ) ;
436
- node. last_update = msg. contents . timestamp ;
439
+ node. last_update = Some ( msg. contents . timestamp ) ;
437
440
node. rgb = msg. contents . rgb ;
438
441
node. alias = msg. contents . alias ;
439
442
node. addresses = msg. contents . addresses . clone ( ) ;
@@ -549,7 +552,7 @@ impl RoutingMessageHandler for Router {
549
552
lowest_inbound_channel_fee_base_msat: u32 :: max_value( ) ,
550
553
lowest_inbound_channel_fee_proportional_millionths: u32 :: max_value( ) ,
551
554
features: Features :: <FeatureContextNode >:: empty( ) ,
552
- last_update: 0 ,
555
+ last_update: None ,
553
556
rgb: [ 0 ; 3 ] ,
554
557
alias: [ 0 ; 32 ] ,
555
558
addresses: Vec :: new( ) ,
@@ -751,7 +754,7 @@ impl Router {
751
754
lowest_inbound_channel_fee_base_msat : u32:: max_value ( ) ,
752
755
lowest_inbound_channel_fee_proportional_millionths : u32:: max_value ( ) ,
753
756
features : Features :: < FeatureContextNode > :: empty ( ) ,
754
- last_update : 0 ,
757
+ last_update : None ,
755
758
rgb : [ 0 ; 3 ] ,
756
759
alias : [ 0 ; 32 ] ,
757
760
addresses : Vec :: new ( ) ,
@@ -1164,7 +1167,7 @@ mod tests {
1164
1167
lowest_inbound_channel_fee_base_msat : 100 ,
1165
1168
lowest_inbound_channel_fee_proportional_millionths : 0 ,
1166
1169
features : Features { flags : id_to_feature_flags ! ( 1 ) , mark : :: std:: marker:: PhantomData } ,
1167
- last_update : 1 ,
1170
+ last_update : Some ( 1 ) ,
1168
1171
rgb : [ 0 ; 3 ] ,
1169
1172
alias : [ 0 ; 32 ] ,
1170
1173
addresses : Vec :: new ( ) ,
@@ -1198,7 +1201,7 @@ mod tests {
1198
1201
lowest_inbound_channel_fee_base_msat : 0 ,
1199
1202
lowest_inbound_channel_fee_proportional_millionths : 0 ,
1200
1203
features : Features { flags : id_to_feature_flags ! ( 2 ) , mark : :: std:: marker:: PhantomData } ,
1201
- last_update : 1 ,
1204
+ last_update : Some ( 1 ) ,
1202
1205
rgb : [ 0 ; 3 ] ,
1203
1206
alias : [ 0 ; 32 ] ,
1204
1207
addresses : Vec :: new ( ) ,
@@ -1232,7 +1235,7 @@ mod tests {
1232
1235
lowest_inbound_channel_fee_base_msat : 0 ,
1233
1236
lowest_inbound_channel_fee_proportional_millionths : 0 ,
1234
1237
features : Features { flags : id_to_feature_flags ! ( 8 ) , mark : :: std:: marker:: PhantomData } ,
1235
- last_update : 1 ,
1238
+ last_update : Some ( 1 ) ,
1236
1239
rgb : [ 0 ; 3 ] ,
1237
1240
alias : [ 0 ; 32 ] ,
1238
1241
addresses : Vec :: new ( ) ,
@@ -1272,7 +1275,7 @@ mod tests {
1272
1275
lowest_inbound_channel_fee_base_msat : 0 ,
1273
1276
lowest_inbound_channel_fee_proportional_millionths : 0 ,
1274
1277
features : Features { flags : id_to_feature_flags ! ( 3 ) , mark : :: std:: marker:: PhantomData } ,
1275
- last_update : 1 ,
1278
+ last_update : Some ( 1 ) ,
1276
1279
rgb : [ 0 ; 3 ] ,
1277
1280
alias : [ 0 ; 32 ] ,
1278
1281
addresses : Vec :: new ( ) ,
@@ -1352,7 +1355,7 @@ mod tests {
1352
1355
lowest_inbound_channel_fee_base_msat : 0 ,
1353
1356
lowest_inbound_channel_fee_proportional_millionths : 0 ,
1354
1357
features : Features { flags : id_to_feature_flags ! ( 4 ) , mark : :: std:: marker:: PhantomData } ,
1355
- last_update : 1 ,
1358
+ last_update : Some ( 1 ) ,
1356
1359
rgb : [ 0 ; 3 ] ,
1357
1360
alias : [ 0 ; 32 ] ,
1358
1361
addresses : Vec :: new ( ) ,
@@ -1386,7 +1389,7 @@ mod tests {
1386
1389
lowest_inbound_channel_fee_base_msat : 0 ,
1387
1390
lowest_inbound_channel_fee_proportional_millionths : 0 ,
1388
1391
features : Features { flags : id_to_feature_flags ! ( 5 ) , mark : :: std:: marker:: PhantomData } ,
1389
- last_update : 1 ,
1392
+ last_update : Some ( 1 ) ,
1390
1393
rgb : [ 0 ; 3 ] ,
1391
1394
alias : [ 0 ; 32 ] ,
1392
1395
addresses : Vec :: new ( ) ,
@@ -1443,7 +1446,7 @@ mod tests {
1443
1446
lowest_inbound_channel_fee_base_msat : 0 ,
1444
1447
lowest_inbound_channel_fee_proportional_millionths : 0 ,
1445
1448
features : Features { flags : id_to_feature_flags ! ( 6 ) , mark : :: std:: marker:: PhantomData } ,
1446
- last_update : 1 ,
1449
+ last_update : Some ( 1 ) ,
1447
1450
rgb : [ 0 ; 3 ] ,
1448
1451
alias : [ 0 ; 32 ] ,
1449
1452
addresses : Vec :: new ( ) ,
0 commit comments