From 146ccc202fb0f962a45fcdeca40176bf50bb9d1a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 3 Jul 2019 23:12:34 -1100 Subject: [PATCH] +print --- src/komodo_nSPV.h | 7 +++++-- src/wallet/rpcdump.cpp | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/komodo_nSPV.h b/src/komodo_nSPV.h index bbe3fb1f5..3fe3f978e 100644 --- a/src/komodo_nSPV.h +++ b/src/komodo_nSPV.h @@ -583,7 +583,8 @@ void komodo_nSPVreq(CNode *pfrom,std::vector request) // received a req ind = (int32_t)(sizeof(pfrom->prevtimes)/sizeof(*pfrom->prevtimes)) - 1; if ( request[0] == NSPV_INFO ) // info { - if ( len == 1 && timestamp > pfrom->prevtimes[ind] + ASSETCHAINS_BLOCKTIME/2 ) + fprintf(stderr,"check info %u vs %u, ind.%d\n",timestamp,pfrom->prevtimes[ind],ind); + if ( timestamp > pfrom->prevtimes[ind] ) { struct NSPV_inforesp I; memset(&I,0,sizeof(I)); @@ -802,7 +803,7 @@ UniValue NSPV_ntz_json(struct NSPV_ntz *ptr) return(result); } -UniValue NSPV_getinfo() +UniValue NSPV_getinfo_json() { UniValue result(UniValue::VOBJ); result.push_back(Pair("result","success")); @@ -940,6 +941,7 @@ void komodo_nSPVresp(CNode *pfrom,std::vector response) // received a r switch ( response[0] ) { case NSPV_INFORESP: + NSPV_inforesp_purge(&NSPV_inforesult); NSPV_rwinforesp(0,&response[1],&NSPV_inforesult); fprintf(stderr,"got info response %u size.%d height.%d\n",timestamp,(int32_t)response.size(),NSPV_inforesult.height); // update current height and ntrz status break; @@ -958,6 +960,7 @@ void komodo_nSPVresp(CNode *pfrom,std::vector response) // received a r fprintf(stderr,"got txproof response %u size.%d\n",timestamp,(int32_t)response.size()); // update utxos[i] break; case NSPV_SPENTINFORESP: + fprintf(stderr,"got spentinfo response %u size.%d\n",timestamp,(int32_t)response.size()); // update utxos[i] break; default: fprintf(stderr,"unexpected response %02x size.%d at %u\n",response[0],(int32_t)response.size(),timestamp); diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 830ecc322..d6863e88b 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -972,7 +972,7 @@ UniValue z_exportviewingkey(const UniValue& params, bool fHelp) return EncodeViewingKey(vk); } -UniValue NSPV_getinfo(); +UniValue NSPV_getinfo_json(); UniValue NSPV_login(char *wifstr); UniValue NSPV_addressutxos(char *coinaddr); UniValue NSPV_spentinfo(uint256 txid,int32_t vout); @@ -983,7 +983,7 @@ UniValue nspv_getinfo(const UniValue& params, bool fHelp) { if ( fHelp || params.size() != 0 ) throw runtime_error("nspv_getinfo\n"); - return(NSPV_getinfo()); + return(NSPV_getinfo_json()); } UniValue nspv_login(const UniValue& params, bool fHelp)