diff options
| author | Max K <[email protected]> | 2019-07-14 19:35:30 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-07-14 19:35:30 +0200 |
| commit | cee13699a5676355487f8eb2d91985f63438eae4 (patch) | |
| tree | cf12be6180f950a25ee2ee7f3f2126542835d6e3 /src/primitives/block.cpp | |
| parent | Correct build and test net seed (diff) | |
| parent | Handle legacy v2 block at #66064 (diff) | |
| download | discoin-1.17-dev.tar.xz discoin-1.17-dev.zip | |
Merge pull request #1546 from rnicoll/1.17-auxpow1.17-dev
1.17 AuxPoW support
Diffstat (limited to 'src/primitives/block.cpp')
| -rw-r--r-- | src/primitives/block.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/primitives/block.cpp b/src/primitives/block.cpp index c61dc5fb5..f272347a3 100644 --- a/src/primitives/block.cpp +++ b/src/primitives/block.cpp @@ -6,21 +6,21 @@ #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 +void CBlockHeader::SetAuxpow (std::unique_ptr<CAuxPow> apow) { - return SerializeHash(*this); -} - -uint256 CBlockHeader::GetPoWHash() const -{ - uint256 thash; - scrypt_1024_1_1_256(BEGIN(nVersion), BEGIN(thash)); - return thash; + if (apow != nullptr) + { + auxpow.reset(apow.release()); + SetAuxpowFlag(true); + } else + { + auxpow.reset(); + SetAuxpowFlag(false); + } } std::string CBlock::ToString() const |