@@ -41,6 +41,7 @@ use stacks::chainstate::stacks::{
4141 TenureChangeCause , TenureChangePayload , TransactionAnchorMode , TransactionPayload ,
4242 TransactionVersion ,
4343} ;
44+ use stacks:: core:: mempool:: MemPoolWalkStrategy ;
4445use stacks:: net:: api:: poststackerdbchunk:: StackerDBErrorCodes ;
4546use stacks:: net:: p2p:: NetworkHandle ;
4647use stacks:: net:: stackerdb:: StackerDBs ;
@@ -618,7 +619,13 @@ impl BlockMinerThread {
618619 "Miner did not find any transactions to mine, sleeping for {:?}" ,
619620 self . config. miner. empty_mempool_sleep_time
620621 ) ;
621- self . reset_nonce_cache = false ;
622+ // For NextNonceWithHighestFeeRate strategy, keep reset_nonce_cache = true
623+ // to ensure considered_txs table is cleared for each block attempt
624+ if self . config . miner . mempool_walk_strategy
625+ != MemPoolWalkStrategy :: NextNonceWithHighestFeeRate
626+ {
627+ self . reset_nonce_cache = false ;
628+ }
622629
623630 // Pause the miner to wait for transactions to arrive
624631 let now = Instant :: now ( ) ;
@@ -733,7 +740,13 @@ impl BlockMinerThread {
733740 ) ;
734741
735742 // We successfully mined, so the mempool caches are valid.
736- self . reset_nonce_cache = false ;
743+ // For NextNonceWithHighestFeeRate strategy, keep reset_nonce_cache = true
744+ // to ensure considered_txs table is cleared for each block attempt
745+ if self . config . miner . mempool_walk_strategy
746+ != MemPoolWalkStrategy :: NextNonceWithHighestFeeRate
747+ {
748+ self . reset_nonce_cache = false ;
749+ }
737750 }
738751
739752 // update mined-block counters and mined-tenure counters
0 commit comments