From b46f0079d93c5b45b1e2bd3543f19ef2269ee634 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 8 Jul 2019 07:08:55 -1100 Subject: [PATCH] NSPV_txproofresult. --- src/komodo_nSPV.h | 1 + src/komodo_nSPV_superlite.h | 5 +++-- src/komodo_nSPV_wallet.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/komodo_nSPV.h b/src/komodo_nSPV.h index 9029318a0..a5de92f4d 100644 --- a/src/komodo_nSPV.h +++ b/src/komodo_nSPV.h @@ -27,6 +27,7 @@ #ifndef KOMODO_NSPV_H #define KOMODO_NSPV_H +#define NSPV_FULLVALIDATION 1 // changing to 1 issues 26 remote gettransaction, per utxo! need to change to bruteforcer #define NSPV_POLLITERS 10 #define NSPV_POLLMICROS 100777 #define NSPV_MAXVINS 64 diff --git a/src/komodo_nSPV_superlite.h b/src/komodo_nSPV_superlite.h index ef67d86d9..43112ed70 100644 --- a/src/komodo_nSPV_superlite.h +++ b/src/komodo_nSPV_superlite.h @@ -478,7 +478,7 @@ UniValue NSPV_txproof(int32_t vout,uint256 txid,int32_t height) len += iguana_rwnum(1,&msg[len],sizeof(height),&height); len += iguana_rwnum(1,&msg[len],sizeof(vout),&vout); len += iguana_rwbignum(1,&msg[len],sizeof(txid),(uint8_t *)&txid); - fprintf(stderr,"req txproof %s/v%d at height.%d\n",txid.GetHex().c_str(),vout,height); + //fprintf(stderr,"req txproof %s/v%d at height.%d\n",txid.GetHex().c_str(),vout,height); for (iter=0; iter<3; iter++); if ( NSPV_req(0,msg,len,NODE_NSPV,msg[0]>>1) != 0 ) { @@ -609,7 +609,8 @@ int32_t NSPV_gettransaction(int32_t skipvalidation,int32_t vout,uint256 txid,int if ( NSPV_txproofresult.txprooflen > 0 ) { proof.resize(NSPV_txproofresult.txprooflen); - memcpy(&proof[0],NSPV_txproofresult.txproof,txprooflen); + memcpy(&proof[0],NSPV_txproofresult.txproof,NSPV_txproofresult.txprooflen); + fprintf(stderr,"copy txproof[%d]\n",txprooflen); } NSPV_notarizations(height); // gets the prev and next notarizations if ( NSPV_inforesult.notarization.height >= height && (NSPV_ntzsresult.prevntz.height == 0 || NSPV_ntzsresult.prevntz.height >= NSPV_ntzsresult.nextntz.height) ) diff --git a/src/komodo_nSPV_wallet.h b/src/komodo_nSPV_wallet.h index 13339122c..d0d079e61 100644 --- a/src/komodo_nSPV_wallet.h +++ b/src/komodo_nSPV_wallet.h @@ -164,7 +164,7 @@ std::string NSPV_signtx(UniValue &retcodes,CMutableTransaction &mtx,uint64_t txf utxovout = mtx.vin[i].prevout.n; if ( i > 0 ) sleep(1); - validation = NSPV_gettransaction(0,utxovout,mtx.vin[i].prevout.hash,used[i].height,vintx); + validation = NSPV_gettransaction(NSPV_FULLVALIDATION,utxovout,mtx.vin[i].prevout.hash,used[i].height,vintx); retcodes.push_back(validation); if ( validation != -1 ) // most others are degraded security {