blob: c90d5fd8e179f346c4c9195103ab43f9ad748ca1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "primitives/pureheader.h"
#include "chainparams.h"
#include "crypto/scrypt.h"
#include "hash.h"
#include "utilstrencodings.h"
void CBlockVersion::SetBaseVersion(int32_t nBaseVersion)
{
assert(nBaseVersion >= 1 && nBaseVersion < VERSION_AUXPOW);
assert(!IsAuxpow());
const int32_t nChainId = Params().GetConsensus().nAuxpowChainId;
nVersion = nBaseVersion | (nChainId * VERSION_CHAIN_START);
}
uint256 CPureBlockHeader::GetHash() const
{
return SerializeHash(*this);
}
uint256 CPureBlockHeader::GetPoWHash() const
{
uint256 thash;
scrypt_1024_1_1_256(BEGIN(nVersion), BEGIN(thash));
return thash;
}
|