Skip to content

Commit

Permalink
Fix Wdeprecated-copy warning in primitives block
Browse files Browse the repository at this point in the history
  • Loading branch information
timemarkovqtum committed Apr 4, 2024
1 parent b39c8ea commit d54ff90
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions src/primitives/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class CBlockHeader
{
SetNull();
}
virtual ~CBlockHeader(){};

SERIALIZE_METHODS(CBlockHeader, obj) { READWRITE(obj.nVersion, obj.hashPrevBlock, obj.hashMerkleRoot, obj.nTime, obj.nBits, obj.nNonce, obj.hashStateRoot, obj.hashUTXORoot, obj.prevoutStake, obj.vchBlockSigDlgt); }

Expand Down Expand Up @@ -78,17 +77,17 @@ class CBlockHeader
}

// ppcoin: two types of block: proof-of-work or proof-of-stake
virtual bool IsProofOfStake() const //qtum
bool IsProofOfStake() const //qtum
{
return !prevoutStake.IsNull();
}

virtual bool IsProofOfWork() const
bool IsProofOfWork() const
{
return !IsProofOfStake();
}

virtual uint32_t StakeTime() const
uint32_t StakeTime() const
{
uint32_t ret = 0;
if(IsProofOfStake())
Expand All @@ -105,24 +104,6 @@ class CBlockHeader
std::vector<unsigned char> GetProofOfDelegation() const;

bool HasProofOfDelegation() const;

CBlockHeader& operator=(const CBlockHeader& other) //qtum
{
if (this != &other)
{
this->nVersion = other.nVersion;
this->hashPrevBlock = other.hashPrevBlock;
this->hashMerkleRoot = other.hashMerkleRoot;
this->nTime = other.nTime;
this->nBits = other.nBits;
this->nNonce = other.nNonce;
this->hashStateRoot = other.hashStateRoot;
this->hashUTXORoot = other.hashUTXORoot;
this->vchBlockSigDlgt = other.vchBlockSigDlgt;
this->prevoutStake = other.prevoutStake;
}
return *this;
}
};


Expand Down

0 comments on commit d54ff90

Please sign in to comment.