// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2019 The Bitcoin Core developers
// Copyright (c) 2021 The Dogecoin 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 <crypto/scrypt.h>
#include <hash.h>
#include <util/strencodings.h>

void CPureBlockHeader::SetBaseVersion(int32_t nBaseVersion)
{
    nVersion = nBaseVersion;
}

uint256 CPureBlockHeader::GetHash() const
{
    return SerializeHash(*this);
}

uint256 CPureBlockHeader::GetPoWHash() const
{
    uint256 thash;
    scrypt_1024_1_1_256((char*)&nVersion, (char*)&thash);
    return thash;
}
