Skip to content

Commit

Permalink
Fixing a rare case memory bloat (#1081)
Browse files Browse the repository at this point in the history
* Fixing a rare case memory bloat

* Version 0.14.9.1
  • Loading branch information
a-bezrukov authored Oct 28, 2021
1 parent 901ddd1 commit 634fc2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 14)
define(_CLIENT_VERSION_REVISION, 9)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2021)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 14
#define CLIENT_VERSION_REVISION 9
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_BUILD 1

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
5 changes: 5 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4233,6 +4233,11 @@ bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, const
uint256 final_hash;
if (block.IsProgPow())
{
// if nHeight is too big progpow_hash_full will use too much memory. This condition allows
// progpow usage until block 2600000
if (block.nHeight >= progpow::epoch_length*2000)
return state.DoS(50, false, REJECT_INVALID, "invalid-progpow-epoch", false, "invalid epoch number");

uint256 exp_mix_hash;
final_hash = block.GetProgPowHashFull(exp_mix_hash);
if (exp_mix_hash != block.mix_hash)
Expand Down

0 comments on commit 634fc2d

Please sign in to comment.