From 8952ee9d114cd5982dd40b2fd77e770b4c09c3c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 22 Dec 2016 23:15:38 +0200 Subject: [PATCH 1/3] test --- src/komodo_gateway.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 040aa4ca9..1ca52ca55 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -855,7 +855,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 //printf(" v%d %.8f k.%d ht.%d base.%d\n",vouts[i],dstr(values[i]),kmdheights[i],otherheights[i],baseids[i]); if ( baseids[i] < 0 ) { - printf("baseids[%d] %d\n",i,baseids[i]); + //printf("baseids[%d] %d\n",i,baseids[i]); continue; } didstats = 0; @@ -926,12 +926,12 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 if ( (pax= komodo_paxfind(txids[i],vouts[i],'X')) != 0 ) { pax->type = opretbuf[0]; - if ( baseids[i] >= 0 && values[i] != 0 && (basesp= komodo_stateptrget(CURRENCIES[baseids[i]])) != 0 ) + if ( baseids[i] >= 0 && srcvalues[i] != 0 && (basesp= komodo_stateptrget(CURRENCIES[baseids[i]])) != 0 ) { - basesp->redeemed += values[i]; + basesp->redeemed += srcvalues[i]; pax->didstats = 1; //if ( strcmp(CURRENCIES[baseids[i]],ASSETCHAINS_SYMBOL) == 0 ) - printf("########### %p redeemed %s += %.8f\n",basesp,CURRENCIES[baseids[i]],dstr(values[i])); + printf("########### %p redeemed %s += %.8f\n",basesp,CURRENCIES[baseids[i]],dstr(srcvalues[i])); } } if ( (pax= komodo_paxmark(height,txids[i],vouts[i],'W',height)) != 0 ) From 0ce26ccf55290ae4aec5a7965a878f99d9d9b252 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 22 Dec 2016 23:25:14 +0200 Subject: [PATCH 2/3] test --- src/komodo_gateway.h | 4 ++-- src/komodo_pax.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 1ca52ca55..1ab9341bc 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -636,7 +636,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above printf(" kht.%d ht.%d %.8f %.8f blockhash couldnt find vout.[%d]\n",kmdheights[i-1],otherheights[i-1],dstr(values[i-1]),dstr(srcvalues[i]),i); } } - if ( matched != num ) + if ( height <= chainActive.Tip()->nHeight && matched != num ) { printf("WOULD REJECT %s: ht.%d (%c) matched.%d vs num.%d\n",symbol,height,opcode,matched,num); // can easily happen depending on order of loading @@ -1011,7 +1011,7 @@ void komodo_passport_iteration() isrealtime = 1; RTmask |= (1LL << baseid); memcpy(refsp->RTbufs[baseid+1],buf,sizeof(refsp->RTbufs[baseid+1])); - } //else fprintf(stderr,"%s not RT\n",base); + } else fprintf(stderr,"%s not RT %u %u %d\n",base,buf[0],buf[1],(int32_t)(time(NULL)-buf[2])); } //else fprintf(stderr,"%s size error RT\n",base); fclose(fp); } //else fprintf(stderr,"%s open error RT\n",base); diff --git a/src/komodo_pax.h b/src/komodo_pax.h index 69f31ae20..53d4f0d2d 100644 --- a/src/komodo_pax.h +++ b/src/komodo_pax.h @@ -481,8 +481,8 @@ uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uin } if ( nonz <= (numvotes >> 1) ) { - printf("kmdbtc %llu btcusd %llu\n",(long long)kmdbtc,(long long)btcusd); - printf("komodo_paxprice nonz.%d of numvotes.%d\n",nonz,numvotes); + //printf("kmdbtc %llu btcusd %llu\n",(long long)kmdbtc,(long long)btcusd); + //printf("komodo_paxprice nonz.%d of numvotes.%d\n",nonz,numvotes); return(0); } return(komodo_paxcorrelation(votes,numvotes,*seedp) * basevolume / 100000); From 5fc94d71a81f5ffb6f29011a70dee4828ef27aac Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 22 Dec 2016 23:33:05 +0200 Subject: [PATCH 3/3] test --- src/komodo_gateway.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 1ab9341bc..cdd300797 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -494,7 +494,7 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to }*/ if ( ASSETCHAINS_SYMBOL[0] != 0 && (strcmp(pax->symbol,symbol) != 0 || pax->validated == 0) ) { - printf("pax->symbol.%s != %s or null pax->validated %.8f\n",pax->symbol,symbol,dstr(pax->validated)); + //printf("pax->symbol.%s != %s or null pax->validated %.8f\n",pax->symbol,symbol,dstr(pax->validated)); continue; } if ( pax->ready == 0 ) @@ -1006,7 +1006,7 @@ void komodo_passport_iteration() if ( fread(buf,1,sizeof(buf),fp) == sizeof(buf) ) { sp->CURRENT_HEIGHT = buf[0]; - if ( buf[0] != 0 && buf[0] == buf[1] && buf[2] > time(NULL)-60 ) + if ( buf[0] != 0 && buf[0] >= buf[1] && buf[2] > time(NULL)-60 ) { isrealtime = 1; RTmask |= (1LL << baseid);