Browse Source

more debugging checks

pull/4/head
Michael Toutonghi 6 years ago
parent
commit
fbe86cecfa
  1. 6
      src/main.cpp

6
src/main.cpp

@ -6025,7 +6025,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
for (; pindex; pindex = chainActive.Next(pindex))
{
CBlockHeader h = pindex->GetBlockHeader();
printf("size.%i, solution size.%i", (int)sizeof(h), (int)h.nSolution.size());
printf("size.%i, solution size.%i\n", (int)sizeof(h), (int)h.nSolution.size());
printf("hash.%s prevhash.%s nonce.%s\n", h.GetHash().ToString().c_str(), h.hashPrevBlock.ToString().c_str(), h.nNonce.ToString().c_str());
vHeaders.push_back(pindex->GetBlockHeader());
if (--nLimit <= 0 || pindex->GetBlockHash() == hashStop)
break;
@ -6196,6 +6197,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
CBlockIndex *pindexLast = NULL;
BOOST_FOREACH(const CBlockHeader& header, headers) {
printf("size.%i, solution size.%i\n", (int)sizeof(header), (int)header.nSolution.size());
printf("hash.%s prevhash.%s nonce.%s\n", header.GetHash().ToString().c_str(), header.hashPrevBlock.ToString().c_str(), header.nNonce.ToString().c_str());
CValidationState state;
if (pindexLast != NULL && header.hashPrevBlock != pindexLast->GetBlockHash()) {
Misbehaving(pfrom->GetId(), 20);

Loading…
Cancel
Save