pub struct ProxyExtendedChannelFactory { /* private fields */ }
Expand description

Used by proxies that want to open extended channls with upstream. If the proxy has job declaration capabilities, we set the job creator and the coinbase outs.

Implementations§

source§

impl ProxyExtendedChannelFactory

source

pub fn new( ids: Arc<Mutex<GroupId>>, extranonces: ExtendedExtranonce, job_creator: Option<JobsCreators>, share_per_min: f32, kind: ExtendedChannelKind, pool_coinbase_outputs: Option<Vec<TxOut>>, pool_signature: String, extended_channel_id: u32, ) -> Self

source

pub fn add_standard_channel( &mut self, request_id: u32, downstream_hash_rate: f32, id_header_only: bool, id: u32, ) -> Result<Vec<Mining<'_>>, Error>

Calls [ChannelFactory::add_standard_channel]

source

pub fn new_extended_channel( &mut self, request_id: u32, hash_rate: f32, min_extranonce_size: u16, ) -> Result<Vec<Mining<'_>>, Error>

Calls [ChannelFactory::new_extended_channel]

source

pub fn on_new_prev_hash_from_tp( &mut self, m: &SetNewPrevHashFromTp<'static>, ) -> Result<Option<(PartialSetCustomMiningJob, u32)>, Error>

Called only when a new prev hash is received by a Template Provider when job declaration is used. It matches the message with a job_id, creates a new custom job, and calls [ChannelFactory::on_new_prev_hash]

source

pub fn on_new_template( &mut self, m: &mut NewTemplate<'static>, ) -> Result<(HashMap<u32, Mining<'static>, BuildNoHashHasher<u32>>, Option<PartialSetCustomMiningJob>, u32), Error>

Called only when a new template is received by a Template Provider when job declaration is used. It creates a new custom job and calls [ChannelFactory::on_new_extended_mining_job]

source

pub fn on_submit_shares_extended( &mut self, m: SubmitSharesExtended<'static>, ) -> Result<OnNewShare, Error>

Called when a SubmitSharesStandard message is received from the downstream. We check the shares against the channel’s respective target and return OnNewShare to let us know if and where the the shares should be relayed

source

pub fn on_submit_shares_standard( &mut self, m: SubmitSharesStandard, ) -> Result<OnNewShare, Error>

Called when a SubmitSharesStandard message is received from the Downstream. We check the shares against the channel’s respective target and return OnNewShare to let us know if and where the shares should be relayed

source

pub fn on_new_prev_hash( &mut self, m: SetNewPrevHash<'static>, ) -> Result<(), Error>

Calls [ChannelFactory::on_new_prev_hash]

source

pub fn on_new_extended_mining_job( &mut self, m: NewExtendedMiningJob<'static>, ) -> Result<HashMap<u32, Mining<'static>, BuildNoHashHasher<u32>>, Error>

Calls [ChannelFactory::on_new_extended_mining_job]

source

pub fn set_target(&mut self, new_target: &mut Target)

source

pub fn last_valid_job_version(&self) -> Option<u32>

source

pub fn extranonce_from_downstream_extranonce( &self, ext: Extranonce, ) -> Option<Extranonce>

Returns the full extranonce, extranonce1 (static for channel) + extranonce2 (miner nonce space)

source

pub fn last_prev_hash(&self) -> Option<U256<'static>>

Returns the most recent prev hash

source

pub fn last_min_ntime(&self) -> Option<u32>

source

pub fn last_nbits(&self) -> Option<u32>

source

pub fn extranonce_size(&self) -> usize

source

pub fn channel_extranonce2_size(&self) -> usize

source

pub fn update_pool_outputs(&mut self, outs: Vec<TxOut>)

source

pub fn get_this_channel_id(&self) -> u32

source

pub fn get_upstream_extranonce1_len(&self) -> usize

returns the extranonce1 len of the upstream. For a proxy, this would be the extranonce_prefix len

source

pub fn update_target_for_channel( &mut self, channel_id: u32, new_target: Target, ) -> Option<bool>

calls [ChannelFactory::update_target_for_channel]

Trait Implementations§

source§

impl Debug for ProxyExtendedChannelFactory

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more