Skip to content

Commit

Permalink
Merge pull request miketout#319 from Asherda/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Asherda authored Feb 14, 2021
2 parents 87fb544 + ced45b3 commit d3cffbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/primitives/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ int32_t CBlockHeader::GetPBaaSHeader(CPBaaSBlockHeader &pbh, const uint160 &cID)
CPBaaSSolutionDescriptor d = CVerusSolutionVector::solutionTools.GetDescriptor(nSolution);
if (CVerusSolutionVector::solutionTools.HasPBaaSHeader(nSolution) != 0)
{
int32_t len = CVerusSolutionVector::solutionTools.ExtraDataLen(nSolution);
int32_t len = CVerusSolutionVector::solutionTools.ExtraDataLen(nSolution, true);
int32_t numHeaders = d.numPBaaSHeaders;
if (numHeaders * sizeof(CPBaaSBlockHeader) > len)
{
Expand Down
4 changes: 2 additions & 2 deletions src/primitives/solutiondata.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ class CConstVerusSolutionVector
return GetDescriptor(vch).numPBaaSHeaders * sizeof(CPBaaSBlockHeader) + OVERHEAD_SIZE;
}

static uint32_t ExtraDataLen(const std::vector<unsigned char> &vch)
static uint32_t ExtraDataLen(const std::vector<unsigned char> &vch, bool allowPBaaSHeader=false)
{
int len;

if (Version(vch) < CActivationHeight::ACTIVATE_PBAAS)
if (!(Version(vch) >= CActivationHeight::ACTIVATE_PBAAS || (allowPBaaSHeader && Version(vch) >= CActivationHeight::ACTIVATE_PBAAS_HEADER)))
{
len = 0;
}
Expand Down

0 comments on commit d3cffbe

Please sign in to comment.