Skip to content

Commit

Permalink
node: Rename dur to expiration_time
Browse files Browse the repository at this point in the history
  • Loading branch information
Goshawk committed Aug 20, 2024
1 parent 9688224 commit 4c6a362
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions node/src/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ impl<N: Network, DB: database::DB, VM: vm::VMExecution>
_ = on_idle_event.tick() => {
info!(event = "mempool_idle", interval = ?idle_interval);

let dur = time::SystemTime::now()
let expiration_time = time::SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("valid timestamp")
.checked_sub(mempool_expiry)
.expect("valid duration");

// Remove expired transactions from the mempool
db.read().await.update(|db| {
let expired_txs = db.get_expired_txs(dur.as_secs())?;
let expired_txs = db.get_expired_txs(expiration_time.as_secs())?;
for tx_id in expired_txs {
info!(event = "expired_tx", hash = hex::encode(tx_id));
if db.delete_tx(tx_id)? {
Expand Down

0 comments on commit 4c6a362

Please sign in to comment.