Fix nspv
This commit is contained in:
@@ -124,19 +124,8 @@ int32_t NSPV_setequihdr(struct NSPV_equihdr *hdr,int32_t height)
|
|||||||
hdr->nTime = pindex->nTime;
|
hdr->nTime = pindex->nTime;
|
||||||
hdr->nBits = pindex->nBits;
|
hdr->nBits = pindex->nBits;
|
||||||
hdr->nNonce = pindex->nNonce;
|
hdr->nNonce = pindex->nNonce;
|
||||||
auto header = pindex->GetBlockHeader();
|
|
||||||
|
|
||||||
// if (pindex->HasSolution()) {
|
memcpy(hdr->nSolution,&pindex->GetBlockHeader().nSolution[0],sizeof(hdr->nSolution));
|
||||||
// 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));
|
|
||||||
return(sizeof(*hdr));
|
return(sizeof(*hdr));
|
||||||
}
|
}
|
||||||
return(-1);
|
return(-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user