More flexible fee rate estimates
[rust-lightning] / lightning / src / util / test_utils.rs
index bd66e4cae3e56fa70195a4627bf38451bac37d9c..45247be7ce18338cdcc775f51e226c44876b6f2b 100644 (file)
@@ -94,8 +94,13 @@ pub struct TestFeeEstimator {
        pub sat_per_kw: Mutex<u32>,
 }
 impl chaininterface::FeeEstimator for TestFeeEstimator {
-       fn get_est_sat_per_1000_weight(&self, _confirmation_target: ConfirmationTarget) -> u32 {
-               *self.sat_per_kw.lock().unwrap()
+       fn get_est_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32 {
+               match confirmation_target {
+                       ConfirmationTarget::MaxAllowedNonAnchorChannelRemoteFee => {
+                               core::cmp::max(25 * 250, *self.sat_per_kw.lock().unwrap() * 10)
+                       }
+                       _ => *self.sat_per_kw.lock().unwrap(),
+               }
        }
 }