Skip to content

Commit

Permalink
Fix old transactions clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
catena2w committed Jun 6, 2016
1 parent 7b252a2 commit a766363
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ class SimpleTransactionModule(implicit val settings: TransactionSettings with Se

val txs = utxStorage.all()
val notTooOld = txs.filter { tx =>
if ((lastBlockTs - tx.timestamp).seconds > MaxTimeForUnconfirmed) utxStorage.remove(tx)
(lastBlockTs - tx.timestamp).seconds <= MaxTimeForUnconfirmed
if ((lastBlockTs - tx.timestamp).millis > MaxTimeForUnconfirmed) utxStorage.remove(tx)
(lastBlockTs - tx.timestamp).millis <= MaxTimeForUnconfirmed
}

notTooOld.diff(blockStorage.state.validate(txs)).foreach(tx => utxStorage.remove(tx))
Expand Down

0 comments on commit a766363

Please sign in to comment.