pub struct NewTemplate<'decoder> {
    pub template_id: u64,
    pub future_template: bool,
    pub version: u32,
    pub coinbase_tx_version: u32,
    pub coinbase_prefix: B0255<'decoder>,
    pub coinbase_tx_input_sequence: u32,
    pub coinbase_tx_value_remaining: u64,
    pub coinbase_tx_outputs_count: u32,
    pub coinbase_tx_outputs: B064K<'decoder>,
    pub coinbase_tx_locktime: u32,
    pub merkle_path: Seq0255<'decoder, U256<'decoder>>,
}
Expand description

§NewTemplate (Server -> Client)

The primary template-providing function. Note that the coinbase_tx_outputs bytes will appear as is at the end of the coinbase transaction.

Fields§

§template_id: u64

Server’s identification of the template. Strictly increasing, the current UNIX time may be used in place of an ID.

§future_template: bool

True if the template is intended for future crate::SetNewPrevHash message sent on the channel. If False, the job relates to the last sent crate::SetNewPrevHash message on the channel and the miner should start to work on the job immediately.

§version: u32

Valid header version field that reflects the current network consensus. The general purpose bits (as specified in [BIP320]) can be freely manipulated by the downstream node. The downstream node MUST NOT rely on the upstream node to set the BIP320 bits to any particular value.

§coinbase_tx_version: u32

The coinbase transaction nVersion field.

§coinbase_prefix: B0255<'decoder>

Up to 8 bytes (not including the length byte) which are to be placed at the beginning of the coinbase field in the coinbase transaction.

§coinbase_tx_input_sequence: u32

bug The coinbase transaction input’s nSequence field.

§coinbase_tx_value_remaining: u64

The value, in satoshis, available for spending in coinbase outputs added by the client. Includes both transaction fees and block subsidy.

§coinbase_tx_outputs_count: u32

The number of transaction outputs included in coinbase_tx_outputs.

§coinbase_tx_outputs: B064K<'decoder>

Bitcoin transaction outputs to be included as the last outputs in the coinbase transaction.

§coinbase_tx_locktime: u32

The locktime field in the coinbase transaction.

§merkle_path: Seq0255<'decoder, U256<'decoder>>

Merkle path hashes ordered from deepest.

Implementations§

source§

impl<'decoder> NewTemplate<'decoder>

source

pub fn into_static(self) -> NewTemplate<'static>

source§

impl<'decoder> NewTemplate<'decoder>

source

pub fn as_static(&self) -> NewTemplate<'static>

Trait Implementations§

source§

impl<'decoder> Clone for NewTemplate<'decoder>

source§

fn clone(&self) -> NewTemplate<'decoder>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'decoder> Debug for NewTemplate<'decoder>

source§

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

Formats the value using the given formatter. Read more
source§

impl<'decoder> Decodable<'decoder> for NewTemplate<'decoder>

source§

fn get_structure(data: &[u8]) -> Result<Vec<FieldMarker>, Error>

source§

fn from_decoded_fields( data: Vec<DecodableField<'decoder>> ) -> Result<Self, Error>

source§

fn from_bytes(data: &'a mut [u8]) -> Result<Self, Error>

source§

impl<'a> From<NewTemplate<'a>> for CNewTemplate

source§

fn from(v: NewTemplate<'a>) -> Self

Converts to this type from the input type.
source§

impl<'decoder> From<NewTemplate<'decoder>> for EncodableField<'decoder>

source§

fn from(v: NewTemplate<'decoder>) -> Self

Converts to this type from the input type.
source§

impl<'decoder> GetSize for NewTemplate<'decoder>

source§

fn get_size(&self) -> usize

source§

impl<'decoder> PartialEq for NewTemplate<'decoder>

source§

fn eq(&self, other: &NewTemplate<'decoder>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'decoder> Eq for NewTemplate<'decoder>

source§

impl<'decoder> StructuralPartialEq for NewTemplate<'decoder>

Auto Trait Implementations§

§

impl<'decoder> Freeze for NewTemplate<'decoder>

§

impl<'decoder> RefUnwindSafe for NewTemplate<'decoder>

§

impl<'decoder> Send for NewTemplate<'decoder>

§

impl<'decoder> Sync for NewTemplate<'decoder>

§

impl<'decoder> Unpin for NewTemplate<'decoder>

§

impl<'decoder> !UnwindSafe for NewTemplate<'decoder>

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, 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<'a, T> Encodable for T
where T: Into<EncodableField<'a>>,

source§

fn to_bytes(self, dst: &mut [u8]) -> Result<usize, Error>

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.