Skip to content

Commit 406b908

Browse files
Remove unnecessary scoring methods from Router trait
1 parent 6ddf6ba commit 406b908

File tree

4 files changed

+0
-36
lines changed

4 files changed

+0
-36
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 0 additions & 4 deletions
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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ impl Router for FuzzRouter {
139139
action: msgs::ErrorAction::IgnoreError
140140
})
141141
}
142-
fn notify_payment_path_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
143-
fn notify_payment_path_successful(&self, _path: &[&RouteHop]) {}
144-
fn notify_payment_probe_successful(&self, _path: &[&RouteHop]) {}
145-
fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
146142
}
147143

148144
struct TestBroadcaster {

lightning/src/routing/router.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,6 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, S: Deref> Router for DefaultR
7575
&random_seed_bytes
7676
)
7777
}
78-
79-
fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64) {
80-
self.scorer.lock().payment_path_failed(path, short_channel_id);
81-
}
82-
83-
fn notify_payment_path_successful(&self, path: &[&RouteHop]) {
84-
self.scorer.lock().payment_path_successful(path);
85-
}
86-
87-
fn notify_payment_probe_successful(&self, path: &[&RouteHop]) {
88-
self.scorer.lock().probe_successful(path);
89-
}
90-
91-
fn notify_payment_probe_failed(&self, path: &[&RouteHop], short_channel_id: u64) {
92-
self.scorer.lock().probe_failed(path, short_channel_id);
93-
}
9478
}
9579

9680
/// A trait defining behavior for routing a payment.
@@ -109,14 +93,6 @@ pub trait Router {
10993
) -> Result<Route, LightningError> {
11094
self.find_route(payer, route_params, first_hops, inflight_htlcs)
11195
}
112-
/// Lets the router know that payment through a specific path has failed.
113-
fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64);
114-
/// Lets the router know that payment through a specific path was successful.
115-
fn notify_payment_path_successful(&self, path: &[&RouteHop]);
116-
/// Lets the router know that a payment probe was successful.
117-
fn notify_payment_probe_successful(&self, path: &[&RouteHop]);
118-
/// Lets the router know that a payment probe failed.
119-
fn notify_payment_probe_failed(&self, path: &[&RouteHop], short_channel_id: u64);
12096
}
12197

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

lightning/src/util/test_utils.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ impl<'a> Router for TestRouter<'a> {
133133
&[42; 32]
134134
)
135135
}
136-
fn notify_payment_path_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
137-
fn notify_payment_path_successful(&self, _path: &[&RouteHop]) {}
138-
fn notify_payment_probe_successful(&self, _path: &[&RouteHop]) {}
139-
fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
140136
}
141137

142138
#[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)