pub enum TxOrdering {
Shuffle,
Untouched,
Custom {
input_sort: Arc<dyn Fn(&TxIn, &TxIn) -> Ordering + Send + Sync>,
output_sort: Arc<dyn Fn(&TxOut, &TxOut) -> Ordering + Send + Sync>,
},
}Expand description
Ordering of the transaction’s inputs and outputs
Variants§
Shuffle
Randomized (default)
Untouched
Unchanged
Unchanged insertion order for recipients and for manually added UTXOs. This guarantees all recipients preserve insertion order in the transaction’s output vector and manually added UTXOs preserve insertion order in the transaction’s input vector, but does not make any guarantees about algorithmically selected UTXOs. However, by design they will always be placed after the manually selected ones.
Custom
Provide custom comparison functions for sorting
Implementations§
Source§impl TxOrdering
impl TxOrdering
Sourcepub fn sort_tx(&self, tx: &mut Transaction)
pub fn sort_tx(&self, tx: &mut Transaction)
Sort transaction inputs and outputs by TxOrdering variant.
Uses the thread-local random number generator (rng).
Sourcepub fn sort_tx_with_aux_rand(
&self,
tx: &mut Transaction,
rng: &mut impl RngCore,
)
pub fn sort_tx_with_aux_rand( &self, tx: &mut Transaction, rng: &mut impl RngCore, )
Sort transaction inputs and outputs by TxOrdering variant.
Uses a provided random number generator (rng).
Trait Implementations§
Source§impl Clone for TxOrdering
impl Clone for TxOrdering
Source§fn clone(&self) -> TxOrdering
fn clone(&self) -> TxOrdering
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TxOrdering
impl Debug for TxOrdering
Source§impl Default for TxOrdering
impl Default for TxOrdering
Source§fn default() -> TxOrdering
fn default() -> TxOrdering
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TxOrdering
impl !RefUnwindSafe for TxOrdering
impl Send for TxOrdering
impl Sync for TxOrdering
impl Unpin for TxOrdering
impl !UnwindSafe for TxOrdering
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
Mutably borrows from an owned value. Read more