X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fchaininterface.rs;h=2ec7f318ff57bb5a3e798a0ecd651cc1fb5f4e1d;hb=b76040718f954fa7baae42c7070e3ff6ac8add3c;hp=02961f2dc71a84d5b1d4a54225072e60cad9d482;hpb=9c0c3b0c95feacb6f5fa9d99bc3cc666ab942c30;p=rust-lightning diff --git a/lightning/src/chain/chaininterface.rs b/lightning/src/chain/chaininterface.rs index 02961f2d..2ec7f318 100644 --- a/lightning/src/chain/chaininterface.rs +++ b/lightning/src/chain/chaininterface.rs @@ -46,10 +46,9 @@ pub trait FeeEstimator { /// LDK will wrap this method and ensure that the value returned is 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). /// - /// The following unit conversions can be used to convert to sats/KW. Note that it is not - /// necessary to use max() as the minimum of 253 will be enforced by LDK: - /// * max(satoshis-per-byte * 250, 253) - /// * max(satoshis-per-kbyte / 4, 253) + /// The following unit conversions can be used to convert to sats/KW: + /// * satoshis-per-byte * 250 + /// * satoshis-per-kbyte / 4 fn get_est_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32; } @@ -77,8 +76,10 @@ impl LowerBoundedFeeEstimator where F::Target: FeeEstimator { pub fn new(fee_estimator: F) -> Self { LowerBoundedFeeEstimator(fee_estimator) } +} - pub fn get_est_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32 { +impl FeeEstimator for LowerBoundedFeeEstimator where F::Target: FeeEstimator { + fn get_est_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32 { cmp::max( self.0.get_est_sat_per_1000_weight(confirmation_target), FEERATE_FLOOR_SATS_PER_KW,