Blackcoin Lore
This commit is contained in:
@@ -6,25 +6,36 @@
|
||||
#include "primitives/block.h"
|
||||
|
||||
#include "hash.h"
|
||||
#include "crypto/scrypt.h"
|
||||
#include "tinyformat.h"
|
||||
#include "utilstrencodings.h"
|
||||
#include "crypto/common.h"
|
||||
|
||||
uint256 CBlockHeader::GetHash() const
|
||||
{
|
||||
return SerializeHash(*this);
|
||||
if (nVersion > 6)
|
||||
return SerializeHash(*this);
|
||||
return GetPoWHash();
|
||||
}
|
||||
|
||||
uint256 CBlockHeader::GetPoWHash() const
|
||||
{
|
||||
uint256 thash;
|
||||
scrypt_1024_1_1_256(BEGIN(nVersion), BEGIN(thash));
|
||||
return thash;
|
||||
}
|
||||
|
||||
std::string CBlock::ToString() const
|
||||
{
|
||||
std::stringstream s;
|
||||
s << strprintf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\n",
|
||||
s << strprintf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u, vchBlockSig=%s)\n",
|
||||
GetHash().ToString(),
|
||||
nVersion,
|
||||
hashPrevBlock.ToString(),
|
||||
hashMerkleRoot.ToString(),
|
||||
nTime, nBits, nNonce,
|
||||
vtx.size());
|
||||
vtx.size(),
|
||||
HexStr(vchBlockSig.begin(), vchBlockSig.end()));
|
||||
for (unsigned int i = 0; i < vtx.size(); i++)
|
||||
{
|
||||
s << " " << vtx[i].ToString() << "\n";
|
||||
|
||||
Reference in New Issue
Block a user