Skip to content

Commit 76fa6cf

Browse files
committed
Default to creating BOLT4 tlv payload format onions
Default to creating tlv onions for nodes for which we haven't received any features through node announcements, and where no other features are known such as invoice features nor channel init features.
1 parent 711bcef commit 76fa6cf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lightning/src/routing/router.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,9 @@ where L::Target: Logger {
11011101
} }
11021102
}
11031103

1104-
let empty_node_features = NodeFeatures::empty();
1104+
let mut variable_length_onion_optional_features = NodeFeatures::empty();
1105+
variable_length_onion_optional_features.set_variable_length_onion_optional();
1106+
11051107
// Find ways (channels with destination) to reach a given node and store them
11061108
// in the corresponding data structures (routing graph etc).
11071109
// $fee_to_target_msat represents how much it costs to reach to this node from the payee,
@@ -1132,7 +1134,7 @@ where L::Target: Logger {
11321134
let features = if let Some(node_info) = $node.announcement_info.as_ref() {
11331135
&node_info.features
11341136
} else {
1135-
&empty_node_features
1137+
&variable_length_onion_optional_features
11361138
};
11371139

11381140
if !features.requires_unknown_bits() {
@@ -1330,7 +1332,7 @@ where L::Target: Logger {
13301332
if let Some(node_info) = node.announcement_info.as_ref() {
13311333
ordered_hops.last_mut().unwrap().1 = node_info.features.clone();
13321334
} else {
1333-
ordered_hops.last_mut().unwrap().1 = NodeFeatures::empty();
1335+
ordered_hops.last_mut().unwrap().1 = variable_length_onion_optional_features.clone();
13341336
}
13351337
} else {
13361338
// We can fill in features for everything except hops which were

0 commit comments

Comments
 (0)