Skip to content

Commit

Permalink
zero cost mempool memory exhaustion exploit bitcoin#104
Browse files Browse the repository at this point in the history
  Cherry pick commit b8b969336
  Author:    John Connor <john-connor@users.noreply.github.com>
  Date:      Wed Dec 9 01:02:32 2015 -0500
  • Loading branch information
john-connor authored and hrobeers committed Oct 13, 2017
1 parent 51a757a commit 7271c7c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.cpp
Expand Up @@ -594,6 +594,9 @@ bool CTransaction::CheckTransaction(CValidationState &state) const
return state.DoS(10, error("CTransaction::CheckTransaction() : vin empty"));
if (vout.empty())
return state.DoS(10, error("CTransaction::CheckTransaction() : vout empty"));
// Time (prevent mempool memory exhaustion attack)
if (nTime > GetAdjustedTime() + nMaxClockDrift)
return state.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 state.DoS(100, error("CTransaction::CheckTransaction() : size limits failed"));
Expand Down

0 comments on commit 7271c7c

Please sign in to comment.