Update main.cpp 258/head
authorJohn Connor <john-connor@users.noreply.github.com>
Wed, 9 Dec 2015 06:02:32 +0000 (01:02 -0500)
committerJohn Connor <john-connor@users.noreply.github.com>
Wed, 9 Dec 2015 06:02:32 +0000 (01:02 -0500)
src/main.cpp

index b857739..5e8e030 100644 (file)
@@ -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;