projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some changes in comments and error messages.
[rust-lightning]
/
src
/
ln
/
router.rs
diff --git
a/src/ln/router.rs
b/src/ln/router.rs
index 16f996df062047134248d43298aa77d2d6ee4ad1..4c3bcb98074fd8301941739c9352ce6bef593e05 100644
(file)
--- a/
src/ln/router.rs
+++ b/
src/ln/router.rs
@@
-1,4
+1,5
@@
//! The top-level routing/network map tracking logic lives here.
//! The top-level routing/network map tracking logic lives here.
+//!
//! You probably want to create a Router and use that as your RoutingMessageHandler and then
//! interrogate it to get routes for your own payments.
//! You probably want to create a Router and use that as your RoutingMessageHandler and then
//! interrogate it to get routes for your own payments.
@@
-348,12
+349,19
@@
impl RoutingMessageHandler for Router {
&msgs::HTLCFailChannelUpdate::ChannelUpdateMessage { ref msg } => {
let _ = self.handle_channel_update(msg);
},
&msgs::HTLCFailChannelUpdate::ChannelUpdateMessage { ref msg } => {
let _ = self.handle_channel_update(msg);
},
- &msgs::HTLCFailChannelUpdate::ChannelClosed { ref short_channel_id } => {
+ &msgs::HTLCFailChannelUpdate::ChannelClosed { ref short_channel_id, is_permanent:_ } => {
+//XXX
let mut network = self.network_map.write().unwrap();
if let Some(chan) = network.channels.remove(short_channel_id) {
Self::remove_channel_in_nodes(&mut network.nodes, &chan, *short_channel_id);
}
},
let mut network = self.network_map.write().unwrap();
if let Some(chan) = network.channels.remove(short_channel_id) {
Self::remove_channel_in_nodes(&mut network.nodes, &chan, *short_channel_id);
}
},
+ &msgs::HTLCFailChannelUpdate::NodeFailure { ref node_id, is_permanent:_ } => {
+//XXX
+ //let mut network = self.network_map.write().unwrap();
+ //TODO: check _blamed_upstream_node
+ self.mark_node_bad(node_id, false);
+ },
}
}
}
}
@@
-523,13
+531,18
@@
impl Router {
}
/// Gets a route from us to the given target node.
}
/// Gets a route from us to the given target node.
+ ///
/// Extra routing hops between known nodes and the target will be used if they are included in
/// last_hops.
/// Extra routing hops between known nodes and the target will be used if they are included in
/// last_hops.
+ ///
/// If some channels aren't announced, it may be useful to fill in a first_hops with the
/// results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
/// (this Router's) view of our local channels will be ignored, and only those in first_hops
/// If some channels aren't announced, it may be useful to fill in a first_hops with the
/// results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
/// (this Router's) view of our local channels will be ignored, and only those in first_hops
- /// will be used. Panics if first_hops contains channels without short_channel_ids
+ /// will be used.
+ ///
+ /// Panics if first_hops contains channels without short_channel_ids
/// (ChannelManager::list_usable_channels will never include such channels).
/// (ChannelManager::list_usable_channels will never include such channels).
+ ///
/// The fees on channels from us to next-hops are ignored (as they are assumed to all be
/// equal), however the enabled/disabled bit on such channels as well as the htlc_minimum_msat
/// *is* checked as they may change based on the receiving node.
/// The fees on channels from us to next-hops are ignored (as they are assumed to all be
/// equal), however the enabled/disabled bit on such channels as well as the htlc_minimum_msat
/// *is* checked as they may change based on the receiving node.