diff --git a/src/komodo_nSPV.h b/src/komodo_nSPV.h index 61cedc77d..d44a7ddae 100644 --- a/src/komodo_nSPV.h +++ b/src/komodo_nSPV.h @@ -256,7 +256,6 @@ int32_t NSPV_rwtxproof(int32_t rwflag,uint8_t *serialized,struct NSPV_txproof *p len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->pad),&ptr->pad); len += iguana_rwuint8vec(rwflag,&serialized[len],&ptr->txlen,&ptr->tx); len += iguana_rwuint8vec(rwflag,&serialized[len],&ptr->txprooflen,&ptr->txproof); - fprintf(stderr,"rwtxproof len.%d\n",len); return(len); } @@ -408,10 +407,14 @@ uint256 NSPV_hdrhash(struct NSPV_equihdr *hdr) int32_t NSPV_txextract(CTransaction &tx,uint8_t *data,int32_t datalen) { std::vector rawdata; + fprintf(stderr,"extract %d bytes\n",datalen); rawdata.resize(datalen); memcpy(&rawdata[0],data,datalen); if ( DecodeHexTx(tx,HexStr(rawdata)) != 0 ) + { + fprintf(stderr,"extracted %s\n",tx.GetHex().c_str()); return(0); + } else return(-1); } diff --git a/src/komodo_nSPV_fullnode.h b/src/komodo_nSPV_fullnode.h index 9092cbc30..746ca83d5 100644 --- a/src/komodo_nSPV_fullnode.h +++ b/src/komodo_nSPV_fullnode.h @@ -450,7 +450,6 @@ void komodo_nSPVreq(CNode *pfrom,std::vector request) // received a req { response.resize(1 + slen); response[0] = NSPV_TXPROOFRESP; - fprintf(stderr,"slen.%d\n",slen); if ( NSPV_rwtxproof(1,&response[1],&P) == slen ) { pfrom->PushMessage("nSPV",response); diff --git a/src/komodo_nSPV_wallet.h b/src/komodo_nSPV_wallet.h index 2ebabaa0c..899a2707b 100644 --- a/src/komodo_nSPV_wallet.h +++ b/src/komodo_nSPV_wallet.h @@ -63,7 +63,7 @@ int32_t NSPV_gettransaction(int32_t vout,uint256 txid,int32_t height,CTransactio NSPV_txproof(vout,txid,height); if ( NSPV_txproofresult.txid != txid ) return(-1); - if ( NSPV_txextract(tx,NSPV_txproofresult.tx,NSPV_txproofresult.txlen) < 0 || NSPV_txproofresult.txlen <= 0 ) + else if ( NSPV_txextract(tx,NSPV_txproofresult.tx,NSPV_txproofresult.txlen) < 0 || NSPV_txproofresult.txlen <= 0 ) retval = -20; else {