This commit is contained in:
Duke
2023-06-14 00:08:16 -04:00
parent 13612bb1c8
commit f05cb0cfbd

View File

@@ -124,19 +124,8 @@ int32_t NSPV_setequihdr(struct NSPV_equihdr *hdr,int32_t height)
hdr->nTime = pindex->nTime;
hdr->nBits = pindex->nBits;
hdr->nNonce = pindex->nNonce;
auto header = pindex->GetBlockHeader();
// if (pindex->HasSolution()) {
// header.nSolution = nSolution;
// } else {
CDiskBlockIndex dbindex;
if (!pblocktree->ReadDiskBlockIndex(pindex->GetBlockHash(), dbindex)) {
LogPrintf("%s: Failed to read index entry", __func__);
throw std::runtime_error("Failed to read index entry");
}
header.nSolution = dbindex.GetSolution();
// }
memcpy(hdr->nSolution,&header.nSolution[0],sizeof(hdr->nSolution));
memcpy(hdr->nSolution,&pindex->GetBlockHeader().nSolution[0],sizeof(hdr->nSolution));
return(sizeof(*hdr));
}
return(-1);