From 2487a1079bc2c9b3f3ea678f625f06ecd75acc62 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 12 Jul 2019 21:01:21 -1100 Subject: [PATCH] Test --- src/komodo_nSPV.h | 1 + src/komodo_nSPV_fullnode.h | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/komodo_nSPV.h b/src/komodo_nSPV.h index 6500b9688..ad805848d 100644 --- a/src/komodo_nSPV.h +++ b/src/komodo_nSPV.h @@ -248,6 +248,7 @@ int32_t NSPV_rwntzsproofresp(int32_t rwflag,uint8_t *serialized,struct NSPV_ntzs len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->nexttxidht),&ptr->nexttxidht); len += iguana_rwuint8vec(rwflag,&serialized[len],&ptr->prevtxlen,&ptr->prevntz); len += iguana_rwuint8vec(rwflag,&serialized[len],&ptr->nexttxlen,&ptr->nextntz); + fprintf(stderr,"retlen.%d\n",len); return(len); } diff --git a/src/komodo_nSPV_fullnode.h b/src/komodo_nSPV_fullnode.h index 2479d0cdc..069b974ad 100644 --- a/src/komodo_nSPV_fullnode.h +++ b/src/komodo_nSPV_fullnode.h @@ -290,7 +290,7 @@ int32_t NSPV_getntzsproofresp(struct NSPV_ntzsproofresp *ptr,uint256 prevntztxid fprintf(stderr,"illegal prevht.%d nextht.%d\n",ptr->common.prevht,ptr->common.nextht); return(-7); } - //fprintf(stderr,"%s -> prevht.%d, %s -> nexht.%d\n",ptr->prevtxid.GetHex().c_str(),ptr->common.prevht,ptr->nexttxid.GetHex().c_str(),ptr->common.nextht); + fprintf(stderr,"%s -> prevht.%d, %s -> nexht.%d\n",ptr->prevtxid.GetHex().c_str(),ptr->common.prevht,ptr->nexttxid.GetHex().c_str(),ptr->common.nextht); ptr->common.numhdrs = (ptr->common.nextht - ptr->common.prevht + 1); ptr->common.hdrs = (struct NSPV_equihdr *)calloc(ptr->common.numhdrs,sizeof(*ptr->common.hdrs)); //fprintf(stderr,"prev.%d next.%d allocate numhdrs.%d\n",prevht,nextht,ptr->common.numhdrs); @@ -426,9 +426,9 @@ void komodo_nSPVreq(CNode *pfrom,std::vector request) // received a req iguana_rwbignum(0,&request[1],sizeof(prevntz),(uint8_t *)&prevntz); iguana_rwbignum(0,&request[1+sizeof(prevntz)],sizeof(nextntz),(uint8_t *)&nextntz); memset(&P,0,sizeof(P)); - //fprintf(stderr,"msg prev.%s next.%s\n",prevntz.GetHex().c_str(),nextntz.GetHex().c_str()); if ( (slen= NSPV_getntzsproofresp(&P,prevntz,nextntz)) > 0 ) { + fprintf(stderr,"slen.%d msg prev.%s next.%s\n",slen,prevntz.GetHex().c_str(),nextntz.GetHex().c_str()); response.resize(1 + slen); response[0] = NSPV_NTZSPROOFRESP; if ( NSPV_rwntzsproofresp(1,&response[1],&P) == slen ) @@ -437,7 +437,7 @@ void komodo_nSPVreq(CNode *pfrom,std::vector request) // received a req pfrom->prevtimes[ind] = timestamp; } NSPV_ntzsproofresp_purge(&P); - } + } else fprintf(stderr,"err.%d\n",slen); } } }