diff --git a/src/komodo_nSPV.h b/src/komodo_nSPV.h index 846e5b879..32c9dcd69 100644 --- a/src/komodo_nSPV.h +++ b/src/komodo_nSPV.h @@ -279,12 +279,12 @@ void NSPV_txproof_copy(struct NSPV_txproof *dest,struct NSPV_txproof *ptr) *dest = *ptr; if ( ptr->tx != 0 ) { - dest->tx = malloc(ptr->txlen); + dest->tx = (uint8_t *)malloc(ptr->txlen); memcpy(dest->tx,ptr->tx,ptr->txlen); } if ( ptr->txproof != 0 ) { - dest->txproof = malloc(ptr->txprooflen); + dest->txproof = (uint8_t *)malloc(ptr->txprooflen); memcpy(dest->txproof,ptr->txproof,ptr->txprooflen); } } @@ -348,17 +348,17 @@ void NSPV_ntzsproof_copy(struct NSPV_ntzsproofresp *dest,struct NSPV_ntzsproofre *dest = *ptr; if ( ptr->common.hdrs != 0 ) { - dest->common.hdrs = malloc(ptr->common.numhdrs * sizeof(*ptr->common.hdrs)); + dest->common.hdrs = (struct NSPV_equihdr *)malloc(ptr->common.numhdrs * sizeof(*ptr->common.hdrs)); memcpy(dest->common.hdrs,ptr->common.hdrs,ptr->common.numhdrs * sizeof(*ptr->common.hdrs)); } if ( ptr->prevntz != 0 ) { - dest->prevntz = malloc(ptr->prevtxlen); + dest->prevntz = (uint8_t *)malloc(ptr->prevtxlen); memcpy(dest->prevntz,ptr->prevntz,ptr->prevtxlen); } if ( ptr->nextntz != 0 ) { - dest->nextntz = malloc(ptr->nexttxlen); + dest->nextntz = (uint8_t *)malloc(ptr->nexttxlen); memcpy(dest->nextntz,ptr->nextntz,ptr->nexttxlen); } } diff --git a/src/komodo_nSPV_fullnode.h b/src/komodo_nSPV_fullnode.h index fc56b0a4e..629abfb17 100644 --- a/src/komodo_nSPV_fullnode.h +++ b/src/komodo_nSPV_fullnode.h @@ -80,9 +80,9 @@ int32_t NSPV_ntzextract(struct NSPV_ntz *ptr,uint256 ntztxid,int32_t txidht,uint int32_t NSPV_getntzsresp(struct NSPV_ntzsresp *ptr,int32_t reqheight) { struct NSPV_ntzargs prev,next; - if ( height < chainActive.LastTip()->GetHeight() ) - height++; - if ( NSPV_notarized_bracket(&prev,&next,height) == 0 ) + if ( reqheight < chainActive.LastTip()->GetHeight() ) + reqheight++; + if ( NSPV_notarized_bracket(&prev,&next,reqheight) == 0 ) { if ( prev.ntzheight != 0 ) { diff --git a/src/komodo_nSPV_superlite.h b/src/komodo_nSPV_superlite.h index 27fd0d241..3d3c5ef26 100644 --- a/src/komodo_nSPV_superlite.h +++ b/src/komodo_nSPV_superlite.h @@ -43,6 +43,7 @@ struct NSPV_txproof NSPV_txproof_cache[NSPV_MAXVINS * 4]; struct NSPV_ntzsresp *NSPV_ntzsresp_find(int32_t reqheight) { + int32_t i; for (i=0; i