hashPrevBlock
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user