Blackcoin Lore

This commit is contained in:
janko33bd
2017-05-30 21:33:31 +02:00
parent 597c9b42e5
commit 2fdd12b2ea
141 changed files with 4385 additions and 3872 deletions

View File

@@ -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;
};