Skip to content

Commit 5e4f0bc

Browse files
Fix InvalidRoute error to be ChannelUnavailable
InvalidRoute is reserved for malformed routes, not routes where a channel or its peer is unavailable
1 parent 9f41bd7 commit 5e4f0bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,7 @@ where
23862386

23872387
let per_peer_state = self.per_peer_state.read().unwrap();
23882388
let peer_state_mutex = per_peer_state.get(&counterparty_node_id)
2389-
.ok_or_else(|| APIError::InvalidRoute{err: "No peer matching the path's first hop found!" })?;
2389+
.ok_or_else(|| APIError::ChannelUnavailable{err: "No peer matching the path's first hop found!".to_owned() })?;
23902390
let mut peer_state_lock = peer_state_mutex.lock().unwrap();
23912391
let peer_state = &mut *peer_state_lock;
23922392
if let hash_map::Entry::Occupied(mut chan) = peer_state.channel_by_id.entry(id) {

0 commit comments

Comments
 (0)