From 0d45abf20f040b9bf7202bb8a3125e173a42a6ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 6 Jul 2019 21:44:01 -1100 Subject: [PATCH] hashPrevBlock --- src/komodo_nSPV.h | 2 +- src/komodo_nSPV_wallet.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_nSPV.h b/src/komodo_nSPV.h index 31756881f..c0c45d8e2 100644 --- a/src/komodo_nSPV.h +++ b/src/komodo_nSPV.h @@ -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); diff --git a/src/komodo_nSPV_wallet.h b/src/komodo_nSPV_wallet.h index 00b1b27ec..081af7b05 100644 --- a/src/komodo_nSPV_wallet.h +++ b/src/komodo_nSPV_wallet.h @@ -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 )