@@ -1120,26 +1120,26 @@ impl Writeable for NodeAnnouncementInfo {
11201120 ( 4 , self . rgb, required) ,
11211121 ( 6 , self . alias, required) ,
11221122 ( 8 , self . announcement_message, option) ,
1123- ( 10 , empty_addresses, vec_type ) , // Versions prior to 0.0.115 require this field
1123+ ( 10 , empty_addresses, required_vec ) , // Versions prior to 0.0.115 require this field
11241124 } ) ;
11251125 Ok ( ( ) )
11261126 }
11271127}
11281128
11291129impl Readable for NodeAnnouncementInfo {
1130- fn read < R : io:: Read > ( reader : & mut R ) -> Result < Self , DecodeError > {
1130+ fn read < R : io:: Read > ( reader : & mut R ) -> Result < Self , DecodeError > {
11311131 _init_and_read_tlv_fields ! ( reader, {
11321132 ( 0 , features, required) ,
11331133 ( 2 , last_update, required) ,
11341134 ( 4 , rgb, required) ,
11351135 ( 6 , alias, required) ,
11361136 ( 8 , announcement_message, option) ,
1137- ( 10 , _addresses, vec_type ) , // deprecated, not used anymore
1137+ ( 10 , _addresses, optional_vec ) , // deprecated, not used anymore
11381138 } ) ;
11391139 let _: Option < Vec < NetAddress > > = _addresses;
11401140 Ok ( Self { features : features. 0 . unwrap ( ) , last_update : last_update. 0 . unwrap ( ) , rgb : rgb. 0 . unwrap ( ) ,
11411141 alias : alias. 0 . unwrap ( ) , announcement_message } )
1142- }
1142+ }
11431143}
11441144
11451145/// A user-defined name for a node, which may be used when displaying the node in a graph.
@@ -1205,7 +1205,7 @@ impl Writeable for NodeInfo {
12051205 write_tlv_fields ! ( writer, {
12061206 // Note that older versions of LDK wrote the lowest inbound fees here at type 0
12071207 ( 2 , self . announcement_info, option) ,
1208- ( 4 , self . channels, vec_type ) ,
1208+ ( 4 , self . channels, required_vec ) ,
12091209 } ) ;
12101210 Ok ( ( ) )
12111211 }
@@ -1236,19 +1236,17 @@ impl Readable for NodeInfo {
12361236 // with zero inbound fees, causing that heuristic to provide little gain. Worse, because it
12371237 // requires additional complexity and lookups during routing, it ends up being a
12381238 // performance loss. Thus, we simply ignore the old field here and no longer track it.
1239- let mut _lowest_inbound_channel_fees: Option < RoutingFees > = None ;
1240- let mut announcement_info_wrap: Option < NodeAnnouncementInfoDeserWrapper > = None ;
1241- _init_tlv_field_var ! ( channels, vec_type) ;
1242-
1243- read_tlv_fields ! ( reader, {
1239+ _init_and_read_tlv_fields ! ( reader, {
12441240 ( 0 , _lowest_inbound_channel_fees, option) ,
12451241 ( 2 , announcement_info_wrap, upgradable_option) ,
1246- ( 4 , channels, vec_type ) ,
1242+ ( 4 , channels, required_vec ) ,
12471243 } ) ;
1244+ let _: Option < RoutingFees > = _lowest_inbound_channel_fees;
1245+ let announcement_info_wrap: Option < NodeAnnouncementInfoDeserWrapper > = announcement_info_wrap;
12481246
12491247 Ok ( NodeInfo {
12501248 announcement_info : announcement_info_wrap. map ( |w| w. 0 ) ,
1251- channels : _init_tlv_based_struct_field ! ( channels , vec_type ) ,
1249+ channels,
12521250 } )
12531251 }
12541252}
0 commit comments