Skip to content

Commit 7632cfe

Browse files
Refuse to pathfind when provided our_node_id matches internal dummy pk
The fuzzer managed to hit this and it causes some invalid paths to be generated internally.
1 parent 6cfb052 commit 7632cfe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lightning/src/routing/router.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,6 +1489,9 @@ where L::Target: Logger {
14891489
if payee_node_id_opt.map_or(false, |payee| payee == our_node_id) {
14901490
return Err(LightningError{err: "Cannot generate a route to ourselves".to_owned(), action: ErrorAction::IgnoreError});
14911491
}
1492+
if our_node_id == maybe_dummy_payee_node_id {
1493+
return Err(LightningError{err: "Invalid origin node id provided, use a different one".to_owned(), action: ErrorAction::IgnoreError});
1494+
}
14921495

14931496
if final_value_msat > MAX_VALUE_MSAT {
14941497
return Err(LightningError{err: "Cannot generate a route of more value than all existing satoshis".to_owned(), action: ErrorAction::IgnoreError});

0 commit comments

Comments
 (0)