Remove unnecessary scoring methods from Router trait
authorValentine Wallace <vwallace@protonmail.com>
Thu, 9 Feb 2023 20:36:35 +0000 (14:36 -0600)
committerValentine Wallace <vwallace@protonmail.com>
Tue, 14 Feb 2023 19:20:49 +0000 (14:20 -0500)
fuzz/src/chanmon_consistency.rs
fuzz/src/full_stack.rs
lightning/src/routing/router.rs
lightning/src/util/test_utils.rs

index 0caee0801aa1d747ec6f564a2cc86f9658172f78..a088f64f4d1cbad35a7dfd8fb55146a6e07951eb 100644 (file)
@@ -97,10 +97,6 @@ impl Router for FuzzRouter {
                        action: msgs::ErrorAction::IgnoreError
                })
        }
-       fn notify_payment_path_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
-       fn notify_payment_path_successful(&self, _path: &[&RouteHop]) {}
-       fn notify_payment_probe_successful(&self, _path: &[&RouteHop]) {}
-       fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
 }
 
 pub struct TestBroadcaster {}
index 57c665a2ef1f51f97a31c0a69f00f3ec18d92ed5..9b3b76c2b3a7d4e60f9d7354406411b2b42a294f 100644 (file)
@@ -140,10 +140,6 @@ impl Router for FuzzRouter {
                        action: msgs::ErrorAction::IgnoreError
                })
        }
-       fn notify_payment_path_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
-       fn notify_payment_path_successful(&self, _path: &[&RouteHop]) {}
-       fn notify_payment_probe_successful(&self, _path: &[&RouteHop]) {}
-       fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
 }
 
 struct TestBroadcaster {
index 79838e185bc7f31ff38741a858089853c02ea263..cfee77a67a2e89ece33616bc5a285a721182bdae 100644 (file)
@@ -72,22 +72,6 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, S: Deref> Router for DefaultR
                        &random_seed_bytes
                )
        }
-
-       fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64) {
-               self.scorer.lock().payment_path_failed(path, short_channel_id);
-       }
-
-       fn notify_payment_path_successful(&self, path: &[&RouteHop]) {
-               self.scorer.lock().payment_path_successful(path);
-       }
-
-       fn notify_payment_probe_successful(&self, path: &[&RouteHop]) {
-               self.scorer.lock().probe_successful(path);
-       }
-
-       fn notify_payment_probe_failed(&self, path: &[&RouteHop], short_channel_id: u64) {
-               self.scorer.lock().probe_failed(path, short_channel_id);
-       }
 }
 
 /// A trait defining behavior for routing a payment.
@@ -106,14 +90,6 @@ pub trait Router {
        ) -> Result<Route, LightningError> {
                self.find_route(payer, route_params, first_hops, inflight_htlcs)
        }
-       /// Lets the router know that payment through a specific path has failed.
-       fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64);
-       /// Lets the router know that payment through a specific path was successful.
-       fn notify_payment_path_successful(&self, path: &[&RouteHop]);
-       /// Lets the router know that a payment probe was successful.
-       fn notify_payment_probe_successful(&self, path: &[&RouteHop]);
-       /// Lets the router know that a payment probe failed.
-       fn notify_payment_probe_failed(&self, path: &[&RouteHop], short_channel_id: u64);
 }
 
 /// [`Score`] implementation that factors in in-flight HTLC liquidity.
index 2752212009832732c34fbc202a63ad40bbba50fd..1c2cfe00df0a5379a8f30e9924a50125df35693e 100644 (file)
@@ -135,10 +135,6 @@ impl<'a> Router for TestRouter<'a> {
                        &[42; 32]
                )
        }
-       fn notify_payment_path_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
-       fn notify_payment_path_successful(&self, _path: &[&RouteHop]) {}
-       fn notify_payment_probe_successful(&self, _path: &[&RouteHop]) {}
-       fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
 }
 
 #[cfg(feature = "std")] // If we put this on the `if`, we get "attributes are not yet allowed on `if` expressions" on 1.41.1