X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fchaininterface.rs;h=9a45a88ffe407898e1b38ee42f3356856b7f9cd4;hb=10be993f9458ff14c2085b1abe53eceb8870ce6a;hp=83fee4d674d1611e82dccee1e1c674e8fb94f9aa;hpb=38a544eafd51f0446b1bb460a42107d35c740388;p=rust-lightning diff --git a/lightning/src/chain/chaininterface.rs b/lightning/src/chain/chaininterface.rs index 83fee4d6..9a45a88f 100644 --- a/lightning/src/chain/chaininterface.rs +++ b/lightning/src/chain/chaininterface.rs @@ -23,6 +23,7 @@ pub trait BroadcasterInterface { /// An enum that represents the speed at which we want a transaction to confirm used for feerate /// estimation. +#[derive(Clone, Copy, PartialEq, Eq)] pub enum ConfirmationTarget { /// We are happy with this transaction confirming slowly when feerate drops some. Background, @@ -40,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; }