Skip to content

Commit bbe56f1

Browse files
committed
f
1 parent 22780c8 commit bbe56f1

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lightning/src/ln/router.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -989,16 +989,14 @@ impl Router {
989989
loop {
990990
if let Some(&(_, ref features)) = first_hop_targets.get(&res.last().unwrap().pubkey) {
991991
res.last_mut().unwrap().node_features = NodeFeatures::with_known_relevant_init_flags(&features);
992+
} else if let Some(node) = network.nodes.get(&res.last().unwrap().pubkey) {
993+
res.last_mut().unwrap().node_features = node.features.clone();
992994
} else {
993-
if let Some(node) = network.nodes.get(&res.last().unwrap().pubkey) {
994-
res.last_mut().unwrap().node_features = node.features.clone();
995-
} else {
996-
// We should be able to fill in features for everything except the last
997-
// hop, if the last hop was provided via a BOLT 11 invoice (though we
998-
// should be able to extend it further as BOLT 11 does have feature
999-
// flags for the last hop node itself).
1000-
assert!(res.last().unwrap().pubkey == *target);
1001-
}
995+
// We should be able to fill in features for everything except the last
996+
// hop, if the last hop was provided via a BOLT 11 invoice (though we
997+
// should be able to extend it further as BOLT 11 does have feature
998+
// flags for the last hop node itself).
999+
assert!(res.last().unwrap().pubkey == *target);
10021000
}
10031001
if res.last().unwrap().pubkey == *target {
10041002
break;

0 commit comments

Comments
 (0)