Function zebra_rpc::methods::get_block_template_rpcs::zip317::choose_transaction_weighted_random
source ยท fn choose_transaction_weighted_random(
candidate_txs: &mut Vec<VerifiedUnminedTx>,
weighted_index: WeightedIndex<f32>,
) -> (Option<WeightedIndex<f32>>, VerifiedUnminedTx)
Expand description
Choose a transaction from transactions
, using the previously set up weighted_index
.
If some transactions have not yet been chosen, returns the weighted index and the transaction. Otherwise, just returns the transaction.