Skip to content

Commit 6bc4c64

Browse files
Add default impl of ChannelScorer to Route
1 parent 3df3052 commit 6bc4c64

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lightning/src/routing/router.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use chain::chaininterface::ChainWatchInterface;
99
use ln::channelmanager;
1010
use ln::features::{ChannelFeatures, NodeFeatures};
1111
use ln::msgs::{DecodeError,ErrorAction,LightningError};
12-
use routing::network_graph::{NetGraphMsgHandler, RoutingFees};
12+
use routing::network_graph::{NetGraphMsgHandler, RoutingFees, ChannelScorer};
1313
use util::ser::{Writeable, Readable};
1414
use util::logger::Logger;
1515

@@ -104,6 +104,12 @@ impl Readable for Route {
104104
}
105105
}
106106

107+
/// Another default implementation of ChannelScorer. The use case is a user processing the
108+
/// success/failure of a given Route. They can implement these functions to fit their needs.
109+
impl ChannelScorer for Route {
110+
type Metadata = Option<u8>;
111+
}
112+
107113
/// A channel descriptor which provides a last-hop route to get_route
108114
pub struct RouteHint {
109115
/// The node_id of the non-target end of the route

0 commit comments

Comments
 (0)