[−][src]Struct ckb_fee_estimator::Estimator
Fee Estimator Estimator track new block and tx_pool to collect data we track every new tx enter txpool and record the tip height and fee_rate, when tx is packed into a new block or dropped by txpool, we get a sample about how long a tx with X fee_rate can get confirmed or get dropped.
In inner, we group samples by predefined fee_rate buckets. To estimator fee_rate for a confirm target(how many blocks that a tx can get committed), we travel through fee_rate buckets, try to find a fee_rate X to let a tx get committed with high probilities within confirm target blocks.
Implementations
impl Estimator
[src]
pub fn new() -> Self
[src]
pub fn process_block(&mut self, height: u64, txs: impl Iterator<Item = Byte32>)
[src]
process new block record confirm blocks for txs which we tracked before.
pub fn track_tx(&mut self, tx_hash: Byte32, fee_rate: FeeRate, height: u64)
[src]
track a tx that entered txpool
pub fn drop_tx(&mut self, tx_hash: &Byte32) -> bool
[src]
tx removed from txpool
pub fn estimate(&self, expect_confirm_blocks: usize) -> FeeRate
[src]
estimate a fee rate for confirm target
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Estimator
impl Send for Estimator
impl Sync for Estimator
impl Unpin for Estimator
impl UnwindSafe for Estimator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,