hashPrevBlock

This commit is contained in:
jl777
2019-07-06 21:44:01 -11:00
parent 27d4e82f0c
commit 0d45abf20f
2 changed files with 2 additions and 2 deletions

View File

@@ -379,7 +379,7 @@ void NSPV_broadcast_purge(struct NSPV_broadcastresp *ptr)
uint256 NSPV_doublesha256(uint8_t *data,int32_t datalen)
{
bits256 _hash; uint256 hash; int32_t i;
_hash = bits256_doublesha256(0,data,datalen);
_hash = bits256_doublesha256(0,(void *)data,datalen);
for (i=0; i<32; i++)
((uint8_t *)&hash)[i] = _hash.bytes[31 - i];
return(hash);

View File

@@ -37,7 +37,7 @@ int32_t NSPV_validatehdrs(struct NSPV_ntzsproofresp *ptr)
return(-6);
for (i=ptr->common.numhdrs-1; i>0; i--)
{
if ( NSPV_doublesha256((uint8_t *)&ptr->common.hdrs[i-1],sizeof(*ptr->common.hdrs)) != ptr->common.hdrs.prevblockhash )
if ( NSPV_doublesha256((uint8_t *)&ptr->common.hdrs[i-1],sizeof(*ptr->common.hdrs)) != ptr->common.hdrs.hashPrevBlock )
return(-i-11);
}
if ( NSPV_txextract(tx,ptr->prevntz,ptr->prevtxlen) < 0 )