Myriadcoin 0.11 port

This commit is contained in:
nzsquirrell
2016-02-24 20:34:22 +13:00
parent 5e70510c51
commit 5efd59f935
991 changed files with 109184 additions and 168045 deletions
+77
View File
@@ -0,0 +1,77 @@
// 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/hashgroestl.h"
#include "crypto/hashqubit.h"
#include "crypto/hashskein.h"
#include "crypto/scrypt.h"
#include "hash.h"
#include "utilstrencodings.h"
uint256 CPureBlockHeader::GetHash() const
{
return SerializeHash(*this);
}
uint256 CPureBlockHeader::GetPoWHash(int algo) const
{
switch(algo)
{
case ALGO_SHA256D:
return GetHash();
case ALGO_SCRYPT:
{
uint256 thash;
scrypt_1024_1_1_256(BEGIN(nVersion), BEGIN(thash));
return thash;
}
case ALGO_GROESTL:
return HashGroestl(BEGIN(nVersion), END(nNonce));
case ALGO_SKEIN:
return HashSkein(BEGIN(nVersion), END(nNonce));
case ALGO_QUBIT:
return HashQubit(BEGIN(nVersion), END(nNonce));
}
return GetHash();
}
int GetAlgo(int nVersion)
{
switch (nVersion & BLOCK_VERSION_ALGO)
{
case 0:
return ALGO_SHA256D;
case BLOCK_VERSION_SCRYPT:
return ALGO_SCRYPT;
case BLOCK_VERSION_GROESTL:
return ALGO_GROESTL;
case BLOCK_VERSION_SKEIN:
return ALGO_SKEIN;
case BLOCK_VERSION_QUBIT:
return ALGO_QUBIT;
}
return ALGO_SHA256D;
}
std::string GetAlgoName(int Algo)
{
switch (Algo)
{
case ALGO_SHA256D:
return std::string("sha256d");
case ALGO_SCRYPT:
return std::string("scrypt");
case ALGO_GROESTL:
return std::string("groestl");
case ALGO_SKEIN:
return std::string("skein");
case ALGO_QUBIT:
return std::string("qubit");
}
return std::string("unknown");
}