From ee11a412a537f62aa46e8862678ce2069a2df5b7 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 11 Nov 2020 14:38:49 +0000 Subject: [PATCH] Avoid signed integer overflow when loading a mempool.dat file with a malformed time field --- src/validation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index 8241cb159f..feb7502a0f 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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 */,