From b8b969336c77e6e57d4ad5c41e8a6df816b1eab2 Mon Sep 17 00:00:00 2001 From: John Connor Date: Wed, 9 Dec 2015 01:02:32 -0500 Subject: [PATCH] Update main.cpp --- src/main.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b857739..5e8e030 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -511,6 +511,9 @@ bool CTransaction::CheckTransaction() const return DoS(10, error("CTransaction::CheckTransaction() : vin empty")); if (vout.empty()) return DoS(10, error("CTransaction::CheckTransaction() : vout empty")); + // Time (prevent mempool memory exhaustion attack) + if (nTime > FutureDrift(GetAdjustedTime())) + return DoS(10, error("CTransaction::CheckTransaction() : timestamp is too far into the future")); // Size limits if (::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE) return DoS(100, error("CTransaction::CheckTransaction() : size limits failed")); @@ -4084,4 +4087,4 @@ public: // orphan transactions } -} instance_of_cmaincleanup; \ No newline at end of file +} instance_of_cmaincleanup; -- 1.7.1