From 0c34737e3512e7e254a93ce6fa44d35843a594d5 Mon Sep 17 00:00:00 2001 From: Conor Okus Date: Wed, 8 Dec 2021 17:15:57 +0000 Subject: [PATCH] Updates Fee estimator docs to include a max return value for get_est_sat_per_1000_weight Updates docs to include a max return value for get_est_sat_per_1000_weight Adds max to both conversions Additional detail --- lightning/src/chain/chaininterface.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lightning/src/chain/chaininterface.rs b/lightning/src/chain/chaininterface.rs index 8ccfb9455..cca51e318 100644 --- a/lightning/src/chain/chaininterface.rs +++ b/lightning/src/chain/chaininterface.rs @@ -41,12 +41,12 @@ pub enum ConfirmationTarget { pub trait FeeEstimator { /// Gets estimated satoshis of fee required per 1000 Weight-Units. /// - /// Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs - /// don't put us below 1 satoshi-per-byte). + /// Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later + /// round-downs don't put us below 1 satoshi-per-byte). /// - /// This translates to: - /// * satoshis-per-byte * 250 - /// * ceil(satoshis-per-kbyte / 4) + /// This method can be implemented with the following unit conversions: + /// * max(satoshis-per-byte * 250, 253) + /// * max(satoshis-per-kbyte / 4, 253) fn get_est_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32; } -- 2.39.5