pub struct DecoyInfo {
pub mixable: usize,
pub not_mixable: usize,
pub min_decoys: usize,
pub max_decoys: usize,
}Expand description
A struct holding information about the inputs and their decoys. This data can vary by block so this data needs to be retrieved after every change in the blockchain.
This data does not need to be refreshed if one of these are true:
- The input amounts are ALL 0 (RCT)
- The top block hash is the same as when this data was retrieved (the blockchain state is unchanged).
https://cuprate.github.io/monero-book/consensus_rules/transactions/decoys.html
Fields§
§mixable: usizeThe number of inputs that have enough outputs on the chain to mix with.
not_mixable: usizeThe number of inputs that don’t have enough outputs on the chain to mix with.
min_decoys: usizeThe minimum amount of decoys used in the transaction.
max_decoys: usizeThe maximum amount of decoys used in the transaction.
Implementations§
Source§impl DecoyInfo
impl DecoyInfo
Sourcepub fn new(
inputs: &[Input],
outputs_with_amount: impl Fn(u64) -> usize,
hf: HardFork,
) -> Result<Self, TransactionError>
pub fn new( inputs: &[Input], outputs_with_amount: impl Fn(u64) -> usize, hf: HardFork, ) -> Result<Self, TransactionError>
Creates a new DecoyInfo struct relating to the passed in inputs, This is only needed from
hf 2 onwards.
outputs_with_amount is a list of the amount of outputs currently on the chain with the same amount
as the inputs amount at the same index. For RCT inputs it instead should be None.
So:
amount_outs_on_chain(inputs[X]) == outputs_with_amount[X]
Do not rely on this function to do consensus checks!
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DecoyInfo
impl RefUnwindSafe for DecoyInfo
impl Send for DecoyInfo
impl Sync for DecoyInfo
impl Unpin for DecoyInfo
impl UnsafeUnpin for DecoyInfo
impl UnwindSafe for DecoyInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes