Blackcoin Lore
This commit is contained in:
@@ -63,6 +63,8 @@ public:
|
||||
|
||||
uint256 GetHash() const;
|
||||
|
||||
uint256 GetPoWHash() const;
|
||||
|
||||
int64_t GetBlockTime() const
|
||||
{
|
||||
return (int64_t)nTime;
|
||||
@@ -70,12 +72,16 @@ public:
|
||||
};
|
||||
|
||||
|
||||
|
||||
class CBlock : public CBlockHeader
|
||||
{
|
||||
public:
|
||||
// network and disk
|
||||
std::vector<CTransaction> vtx;
|
||||
|
||||
// network and disk
|
||||
std::vector<unsigned char> vchBlockSig;
|
||||
|
||||
// memory only
|
||||
mutable bool fChecked;
|
||||
|
||||
@@ -96,15 +102,28 @@ public:
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
READWRITE(*(CBlockHeader*)this);
|
||||
READWRITE(vtx);
|
||||
READWRITE(vchBlockSig);
|
||||
}
|
||||
|
||||
void SetNull()
|
||||
{
|
||||
CBlockHeader::SetNull();
|
||||
vtx.clear();
|
||||
vchBlockSig.clear();
|
||||
fChecked = false;
|
||||
}
|
||||
|
||||
// two types of block: proof-of-work or proof-of-stake
|
||||
bool IsProofOfStake() const
|
||||
{
|
||||
return (vtx.size() > 1 && vtx[1].IsCoinStake());
|
||||
}
|
||||
|
||||
bool IsProofOfWork() const
|
||||
{
|
||||
return !IsProofOfStake();
|
||||
}
|
||||
|
||||
CBlockHeader GetBlockHeader() const
|
||||
{
|
||||
CBlockHeader block;
|
||||
@@ -117,6 +136,8 @@ public:
|
||||
return block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::string ToString() const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user