Skip to content

Commit

Permalink
Avoid signed integer overflow when loading a mempool.dat file with a …
Browse files Browse the repository at this point in the history
…malformed time field
  • Loading branch information
practicalswift committed Nov 11, 2020
1 parent 155bf91 commit ee11a41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5084,7 +5084,7 @@ bool LoadMempool(CTxMemPool& pool)
pool.PrioritiseTransaction(tx->GetHash(), amountdelta);
}
TxValidationState state;
if (nTime + nExpiryTimeout > nNow) {
if (nTime > nNow - nExpiryTimeout) {
LOCK(cs_main);
AcceptToMemoryPoolWithTime(chainparams, pool, state, tx, nTime,
nullptr /* plTxnReplaced */, false /* bypass_limits */,
Expand Down

0 comments on commit ee11a41

Please sign in to comment.