Skip to content

Commit

Permalink
Merge branch 'develop' into fix/miner-forking
Browse files Browse the repository at this point in the history
  • Loading branch information
jferrant authored Jan 15, 2025
2 parents 151e0e2 + ab90a9d commit 2bf2129
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions stackslib/src/burnchains/bitcoin/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1100,8 +1100,10 @@ impl BurnchainIndexer for BitcoinIndexer {
start_height: u64,
end_height: Option<u64>,
) -> Result<u64, burnchain_error> {
if end_height.is_some() && end_height <= Some(start_height) {
return Ok(end_height.unwrap());
if let Some(end_height) = end_height {
if end_height <= start_height {
return Ok(end_height);
}
}

let new_height = self
Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/burnchains/tests/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl BurnchainDB {
let sql = "SELECT op FROM burnchain_db_block_ops WHERE block_hash = ?1";
let args = params![block_hash];
let mut ops: Vec<BlockstackOperationType> = query_rows(&self.conn, sql, args)?;
ops.sort_by(|a, b| a.vtxindex().cmp(&b.vtxindex()));
ops.sort_by_key(|op| op.vtxindex());
Ok(ops)
}

Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/chainstate/nakamoto/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3049,7 +3049,7 @@ fn filter_one_transaction_per_signer_duplicate_nonces() {
txs.clone(),
);
let filtered_txs: Vec<_> = filtered_transactions.into_values().collect();
txs.sort_by(|a, b| a.txid().cmp(&b.txid()));
txs.sort_by_key(|tx| tx.txid());
assert_eq!(filtered_txs.len(), 1);
assert!(filtered_txs.contains(&txs.first().expect("failed to get first tx")));
}
Expand Down

0 comments on commit 2bf2129

Please sign in to comment.