[][src]Struct grin_servers::common::types::DandelionEpoch

pub struct DandelionEpoch { /* fields omitted */ }

A node is either "stem" of "fluff" for the duration of a single epoch. A node also maintains an outbound relay peer for the epoch.

Implementations

impl DandelionEpoch[src]

pub fn new(config: DandelionConfig) -> DandelionEpoch[src]

Create a new Dandelion epoch, defaulting to "stem" and no outbound relay peer.

pub fn is_expired(&self) -> bool[src]

Is the current Dandelion epoch expired? It is expired if start_time is older than the configured epoch_secs.

pub fn next_epoch(&mut self, peers: &Arc<Peers>)[src]

Transition to next Dandelion epoch. Select stem/fluff based on configured stem_probability. Choose a new outbound stem relay peer.

pub fn is_stem(&self) -> bool[src]

Are we stemming (or fluffing) transactions in this epoch?

pub fn always_stem_our_txs(&self) -> bool[src]

Always stem our (pushed via api) txs regardless of stem/fluff epoch?

pub fn relay_peer(&mut self, peers: &Arc<Peers>) -> Option<Arc<Peer>>[src]

What is our current relay peer? If it is not connected then choose a new one.

Trait Implementations

impl Debug for DandelionEpoch[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,