Commit 14786fee authored by barrystyle's avatar barrystyle

debug stake modifier

parent 20dd70f7
......@@ -4,7 +4,7 @@ define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, false)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
AC_INIT([Merge Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[www.projectmerge.org],[merge])
AC_CONFIG_SRCDIR([src/main.cpp])
......
......@@ -291,6 +291,11 @@ bool stakeTargetHit(uint256 hashProofOfStake, int64_t nValueIn, uint256 bnTarget
return (uint256(hashProofOfStake) < bnCoinDayWeight * bnTargetPerCoinDay);
}
void DebugStakeHash(uint64_t currentModifier, unsigned int nTimeBlockFrom, unsigned int prevoutn, uint256 prevouthash, unsigned int nTimeTx)
{
LogPrintf("modifier %016llx ntimeblockfrom %d prevoutn %d prevouthash %s ntimetx %d\n", currentModifier, nTimeBlockFrom, prevoutn, prevouthash.ToString().c_str(), nTimeTx);
}
//instead of looping outside and reinitializing variables many times, we will give a nTimeTx and also search interval so that we can do all the hashing here
bool CheckStakeKernelHash(unsigned int nBits, const CBlock blockFrom, const CTransaction txPrev, const COutPoint prevout, unsigned int& nTimeTx, unsigned int nHashDrift, bool fCheck, uint256& hashProofOfStake, bool fPrintProofOfStake)
{
......@@ -317,6 +322,11 @@ bool CheckStakeKernelHash(unsigned int nBits, const CBlock blockFrom, const CTra
return false;
}
if (fDebug) {
LogPrintf("debug blockhash %s\n", blockFrom.GetHash().ToString().c_str());
DebugStakeHash(nStakeModifier, nTimeBlockFrom, prevout.n, prevout.hash, nTimeTx);
}
//create data stream once instead of repeating it in the loop
CDataStream ss(SER_GETHASH, 0);
ss << nStakeModifier;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment