From b148643e801300b19740e69ab5f2f09a41a7c972 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Jan 2017 12:46:04 +0200 Subject: [PATCH] test --- src/komodo.h | 4 ++-- src/komodo_bitcoind.h | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 39a40ca02..29f7ecb26 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -302,7 +302,7 @@ void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotar else if ( height != 0 ) { //printf("ht.%d func N ht.%d errs.%d\n",height,NOTARIZED_HEIGHT,errs); - if ( sp != 0 && (height < sp->CURRENT_HEIGHT-1000 || komodo_verifynotarization(symbol,dest,height,sp->NOTARIZED_HEIGHT,sp->NOTARIZED_HASH,sp->NOTARIZED_DESTTXID) == 0) ) + if ( sp != 0 ) { fputc('N',fp); if ( fwrite(&height,1,sizeof(height),fp) != sizeof(height) ) @@ -376,7 +376,7 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr len += iguana_rwbignum(0,&scriptbuf[len],32,(uint8_t *)&kmdtxid); len += iguana_rwnum(0,&scriptbuf[len],sizeof(*notarizedheightp),(uint8_t *)notarizedheightp); len += iguana_rwbignum(0,&scriptbuf[len],32,(uint8_t *)&desttxid); - if ( notarized != 0 && *notarizedheightp > sp->NOTARIZED_HEIGHT && *notarizedheightp < height ) + if ( notarized != 0 && *notarizedheightp > sp->NOTARIZED_HEIGHT && *notarizedheightp < height && (height < sp->CURRENT_HEIGHT-1000 || komodo_verifynotarization(symbol,dest,height,*notarizedheightp,kmdtxid,desttxid) == 0) ) { sp->NOTARIZED_HEIGHT = *notarizedheightp; sp->NOTARIZED_HASH = kmdtxid; diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 165cc0657..9031d89c1 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -368,9 +368,17 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t char params[256],*jsonstr,*hexstr; uint8_t script[8192]; int32_t n,len,retval = -1; cJSON *txjson,*vouts,*vout,*skey; sprintf(params,"[\"%s\", 1]",NOTARIZED_DESTTXID.ToString().c_str()); if ( strcmp(dest,"KMD") == 0 ) - jsonstr = komodo_issuemethod(KMDUSERPASS,(char *)"getrawtransaction",params,7771); + { + if ( KMDUSERPASS[0] != 0 ) + jsonstr = komodo_issuemethod(KMDUSERPASS,(char *)"getrawtransaction",params,7771); + //else jsonstr = _dex_getrawtransaction(); + } else if ( strcmp(dest,"BTC") == 0 ) - jsonstr = komodo_issuemethod(BTCUSERPASS,(char *)"getrawtransaction",params,8332); + { + if ( BTCUSERPASS[0] != 0 ) + jsonstr = komodo_issuemethod(BTCUSERPASS,(char *)"getrawtransaction",params,8332); + //else jsonstr = _dex_getrawtransaction(); + } else return(-1); if ( jsonstr != 0 ) { -- 2.42.0