Skip to content

Commit

Permalink
use * in mempool SELECT
Browse files Browse the repository at this point in the history
  • Loading branch information
kantai committed Sep 25, 2024
1 parent f394e64 commit cdb5394
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
16 changes: 1 addition & 15 deletions stackslib/src/core/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2015,21 +2015,7 @@ impl MemPoolDB {
nonce: u64,
) -> Result<Option<MemPoolTxMetadata>, db_error> {
let sql = format!(
"SELECT
txid,
origin_address,
origin_nonce,
sponsor_address,
sponsor_nonce,
tx_fee,
length,
consensus_hash,
block_header_hash,
height,
accept_time,
last_known_sponsor_nonce,
last_known_origin_nonce
FROM mempool WHERE {0}_address = ?1 AND {0}_nonce = ?2",
"SELECT * FROM mempool WHERE {0}_address = ?1 AND {0}_nonce = ?2",
if is_origin { "origin" } else { "sponsor" }
);
let args = params![addr.to_string(), u64_to_sql(nonce)?];
Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/core/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ fn mempool_do_not_replace_tx() {
.unwrap_err();
assert!(match err_resp {
MemPoolRejection::ConflictingNonceInMempool => true,
_ => false,
e => panic!("Failed: {e:?}"),
});

assert!(MemPoolDB::db_has_tx(&mempool_tx, &prior_txid).unwrap());
Expand Down

0 comments on commit cdb5394

Please sign in to comment.