switch to SHA-3 PoW

Co-authored-by: fuwa <fuwa0529@users.noreply.github.com>
This commit is contained in:
wowario
2020-05-15 08:37:36 +03:00
co-authored by fuwa
parent 116d29906c
commit 87dcc37776
18 changed files with 89 additions and 23 deletions
+14 -2
View File
@@ -449,14 +449,26 @@ namespace cryptonote
uint8_t minor_version; // now used as a voting mechanism, rather than how this particular block is built
uint64_t timestamp;
crypto::hash prev_id;
uint32_t nonce;
uint64_t nonce;
BEGIN_SERIALIZE()
VARINT_FIELD(major_version)
VARINT_FIELD(minor_version)
VARINT_FIELD(timestamp)
FIELD(prev_id)
FIELD(nonce)
if (major_version >= HF_VERSION_SHA3_POW)
{
FIELD(nonce)
}
else
{
uint32_t nonce32;
if (typename Archive<W>::is_saving())
nonce32 = (uint32_t)nonce;
FIELD_N("nonce", nonce32);
if (!typename Archive<W>::is_saving())
nonce = nonce32;
}
END_SERIALIZE()
};