Skip to content

Commit 2b2965f

Browse files
Remove unnecessary scoring methods from Router trait
1 parent 825ea9d commit 2b2965f

File tree

4 files changed

+0
-36
lines changed

4 files changed

+0
-36
lines changed

fuzz/src/chanmon_consistency.rs

-4
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ impl Router for FuzzRouter {
9797
action: msgs::ErrorAction::IgnoreError
9898
})
9999
}
100-
fn notify_payment_path_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
101-
fn notify_payment_path_successful(&self, _path: &[&RouteHop]) {}
102-
fn notify_payment_probe_successful(&self, _path: &[&RouteHop]) {}
103-
fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
104100
}
105101

106102
pub struct TestBroadcaster {}

fuzz/src/full_stack.rs

-4
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ impl Router for FuzzRouter {
140140
action: msgs::ErrorAction::IgnoreError
141141
})
142142
}
143-
fn notify_payment_path_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
144-
fn notify_payment_path_successful(&self, _path: &[&RouteHop]) {}
145-
fn notify_payment_probe_successful(&self, _path: &[&RouteHop]) {}
146-
fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
147143
}
148144

149145
struct TestBroadcaster {

lightning/src/routing/router.rs

-24
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,6 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, S: Deref> Router for DefaultR
7272
&random_seed_bytes
7373
)
7474
}
75-
76-
fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64) {
77-
self.scorer.lock().payment_path_failed(path, short_channel_id);
78-
}
79-
80-
fn notify_payment_path_successful(&self, path: &[&RouteHop]) {
81-
self.scorer.lock().payment_path_successful(path);
82-
}
83-
84-
fn notify_payment_probe_successful(&self, path: &[&RouteHop]) {
85-
self.scorer.lock().probe_successful(path);
86-
}
87-
88-
fn notify_payment_probe_failed(&self, path: &[&RouteHop], short_channel_id: u64) {
89-
self.scorer.lock().probe_failed(path, short_channel_id);
90-
}
9175
}
9276

9377
/// A trait defining behavior for routing a payment.
@@ -106,14 +90,6 @@ pub trait Router {
10690
) -> Result<Route, LightningError> {
10791
self.find_route(payer, route_params, first_hops, inflight_htlcs)
10892
}
109-
/// Lets the router know that payment through a specific path has failed.
110-
fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64);
111-
/// Lets the router know that payment through a specific path was successful.
112-
fn notify_payment_path_successful(&self, path: &[&RouteHop]);
113-
/// Lets the router know that a payment probe was successful.
114-
fn notify_payment_probe_successful(&self, path: &[&RouteHop]);
115-
/// Lets the router know that a payment probe failed.
116-
fn notify_payment_probe_failed(&self, path: &[&RouteHop], short_channel_id: u64);
11793
}
11894

11995
/// [`Score`] implementation that factors in in-flight HTLC liquidity.

lightning/src/util/test_utils.rs

-4
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@ impl<'a> Router for TestRouter<'a> {
135135
&[42; 32]
136136
)
137137
}
138-
fn notify_payment_path_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
139-
fn notify_payment_path_successful(&self, _path: &[&RouteHop]) {}
140-
fn notify_payment_probe_successful(&self, _path: &[&RouteHop]) {}
141-
fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
142138
}
143139

144140
#[cfg(feature = "std")] // If we put this on the `if`, we get "attributes are not yet allowed on `if` expressions" on 1.41.1

0 commit comments

Comments
 (0)