diff --git a/stackslib/src/chainstate/stacks/tests/block_construction.rs b/stackslib/src/chainstate/stacks/tests/block_construction.rs index cb99b8c7f2..3be2894669 100644 --- a/stackslib/src/chainstate/stacks/tests/block_construction.rs +++ b/stackslib/src/chainstate/stacks/tests/block_construction.rs @@ -5163,12 +5163,12 @@ fn mempool_walk_test_next_nonce_with_highest_fee_rate_strategy() { // // tuple shape: (origin_address_index, origin_nonce, sponsor_address_index, sponsor_nonce, fee_rate) let test_vectors = vec![ - (0, 0, 0, 0, 100.0), // Old origin nonce - ignored - (0, 1, 0, 1, 200.0), // Old origin nonce - ignored + (0, 0, 0, 0, 100.0), // Old origin nonce - ignored + (0, 1, 0, 1, 200.0), // Old origin nonce - ignored (0, 2, 0, 2, 300.0), (0, 3, 0, 3, 400.0), - (0, 4, 3, 0, 500.0), // Nonce 0 for address 3 is not in the table but will be valid on MARF - (1, 0, 1, 0, 400.0), // Old origin nonce - ignored + (0, 4, 3, 0, 500.0), // Nonce 0 for address 3 is not in the table but will be valid on MARF + (1, 0, 1, 0, 400.0), // Old origin nonce - ignored (1, 1, 3, 1, 600.0), (1, 2, 3, 2, 700.0), (1, 3, 3, 3, 800.0), @@ -5176,7 +5176,7 @@ fn mempool_walk_test_next_nonce_with_highest_fee_rate_strategy() { (2, 3, 2, 3, 9000.0), // Old origin nonce - ignored (2, 4, 2, 4, 9000.0), // Old origin nonce - ignored (2, 5, 2, 5, 9000.0), // Old origin nonce - ignored - (2, 6, 4, 0, 900.0), // Old sponsor nonce - ignored + (2, 6, 4, 0, 900.0), // Old sponsor nonce - ignored (2, 6, 4, 1, 1000.0), (2, 7, 4, 2, 800.0), (2, 8, 2, 8, 1000.0), diff --git a/stackslib/src/core/mempool.rs b/stackslib/src/core/mempool.rs index 2b3c0bfb59..2e5fc95bfc 100644 --- a/stackslib/src/core/mempool.rs +++ b/stackslib/src/core/mempool.rs @@ -1767,7 +1767,7 @@ impl MemPoolDB { LEFT JOIN nonces AS no ON m.origin_address = no.address LEFT JOIN nonces AS ns ON m.sponsor_address = ns.address WHERE (no.address IS NULL OR m.origin_nonce = no.nonce) - AND (ns.address IS NULL OR m.sponsor_nonce = ns.nonce) + AND (ns.address IS NULL OR m.sponsor_nonce = ns.nonce) ), address_nonce_ranked AS ( SELECT *, @@ -1808,8 +1808,8 @@ impl MemPoolDB { // When the retry list is empty, read from the mempool db depending on the configured miner strategy match settings.strategy { MemPoolWalkStrategy::GlobalFeeRate => { - let start_with_no_estimate = - tx_consideration_sampler.sample(&mut rng) < settings.consider_no_estimate_tx_prob; + let start_with_no_estimate = tx_consideration_sampler.sample(&mut rng) + < settings.consider_no_estimate_tx_prob; // randomly select from either the null fee-rate transactions or those with fee-rate estimates. let opt_tx = if start_with_no_estimate { null_iterator @@ -1819,11 +1819,15 @@ impl MemPoolDB { fee_iterator.next().map_err(|err| Error::SqliteError(err))? }; match opt_tx { - Some(row) => (MemPoolTxInfoPartial::from_row(row)?, start_with_no_estimate), + Some(row) => { + (MemPoolTxInfoPartial::from_row(row)?, start_with_no_estimate) + } None => { // If the selected iterator is empty, check the other match if start_with_no_estimate { - fee_iterator.next().map_err(|err| Error::SqliteError(err))? + fee_iterator + .next() + .map_err(|err| Error::SqliteError(err))? } else { null_iterator .next() @@ -1852,7 +1856,7 @@ impl MemPoolDB { let tx = MemPoolTxInfoPartial::from_row(row)?; let update_estimate = tx.fee_rate.is_none(); (tx, update_estimate) - }, + } None => { debug!("No more transactions to consider in mempool"); break MempoolIterationStopReason::NoMoreCandidates;