From d071a683057f6a0e5a4d6d083e22e1cb6f934735 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 15:38:02 +0200 Subject: [PATCH 001/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 556326102ee..cbab3f1bd08 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1156,7 +1156,7 @@ void komodo_passport_iteration() starttime = (uint32_t)time(NULL); //printf("PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,refid); for (baseid=32; baseid>=0; baseid--) - { + {break; if ( time(NULL) >= starttime+maxseconds ) break; sp = 0; From b2e010eef60f819d76830609dded6c0fcc575485 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 16:09:05 +0200 Subject: [PATCH 002/258] Prune asset chain processing --- src/komodo_gateway.h | 95 +++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index cbab3f1bd08..e3e3f6a7953 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -839,7 +839,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 bitcoin_address(coinaddr,addrtype,rmd160,20); checktoshis = PAX_fiatdest(&seed,tokomodo,destaddr,pubkey33,coinaddr,kmdheight,base,fiatoshis); typestr = "deposit"; - if ( kmdheight > 195000 || kmdheight <= height ) + if ( strcmp(base,ASSETCHAINS_SYMBOL) == 0 && (kmdheight > 195000 || kmdheight <= height) ) { didstats = 0; if ( 0 && kmdheight > 214700 && strcmp(base,ASSETCHAINS_SYMBOL) == 0 ) @@ -915,7 +915,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 else if ( opretbuf[0] == 'I' ) { tokomodo = 0; - if ( strncmp((char *)"KMD",(char *)&opretbuf[opretlen-4],3) != 0 ) + if ( strncmp((char *)"KMD",(char *)&opretbuf[opretlen-4],3) != 0 && strcmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4],3)) == 0 ) { if ( (n= komodo_issued_opreturn(base,txids,vouts,values,srcvalues,kmdheights,otherheights,baseids,rmd160s,opretbuf,opretlen,0)) > 0 ) { @@ -961,7 +961,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 } //else printf("opreturn none issued?\n"); } } - else if ( height < 236000 && opretbuf[0] == 'W' )//&& opretlen >= 38 ) + else if ( height < 236000 && opretbuf[0] == 'W' && strcmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4]) == 0 )//&& opretlen >= 38 ) { if ( komodo_baseid((char *)&opretbuf[opretlen-4]) >= 0 && strcmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4]) == 0 ) { @@ -1006,7 +1006,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 } // else printf("withdraw %s paxcmp ht.%d %d error value %.8f -> %.8f vs %.8f\n",base,kmdheight,height,dstr(value),dstr(komodoshis),dstr(checktoshis)); // need to allocate pax } - else if ( height < 236000 && tokomodo != 0 && opretbuf[0] == 'A' ) + else if ( height < 236000 && tokomodo != 0 && opretbuf[0] == 'A' && ASSETCHAINS_SYMBOL[0] == 0 ) { tokomodo = 1; if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) @@ -1085,7 +1085,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 } //else printf("n.%d from opreturns\n",n); //printf("extra.[%d] after %.8f\n",n,dstr(komodo_paxtotal())); } - else if ( height < 236000 && opretbuf[0] == 'X' ) + else if ( height < 236000 && opretbuf[0] == 'X' && ASSETCHAINS_SYMBOL[0] == 0 ) { tokomodo = 1; if ( (n= komodo_issued_opreturn(base,txids,vouts,values,srcvalues,kmdheights,otherheights,baseids,rmd160s,opretbuf,opretlen,1)) > 0 ) @@ -1127,7 +1127,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 void komodo_passport_iteration() { - static long lastpos[34]; static char userpass[33][1024]; int32_t maxseconds = 1; + static long lastpos[34]; static char userpass[33][1024]; int32_t maxseconds = 10; FILE *fp; int32_t baseid,n,ht,isrealtime,expired,refid,blocks,longest; struct komodo_state *sp,*refsp; char *retstr,fname[512],*base,symbol[16],dest[16]; uint32_t buf[3],starttime; cJSON *infoobj,*result; uint64_t RTmask = 0; //printf("PASSPORT.(%s)\n",ASSETCHAINS_SYMBOL); expired = 0; @@ -1156,7 +1156,7 @@ void komodo_passport_iteration() starttime = (uint32_t)time(NULL); //printf("PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,refid); for (baseid=32; baseid>=0; baseid--) - {break; + { if ( time(NULL) >= starttime+maxseconds ) break; sp = 0; @@ -1164,54 +1164,57 @@ void komodo_passport_iteration() base = (char *)CURRENCIES[baseid]; if ( baseid+1 != refid ) { - komodo_statefname(fname,baseid<32?base:(char *)"",(char *)"komodostate"); - komodo_nameset(symbol,dest,base); - sp = komodo_stateptrget(symbol); - n = 0; - if ( (fp= fopen(fname,"rb")) != 0 && sp != 0 ) + if ( baseid == 32 ) { - fseek(fp,0,SEEK_END); - if ( ftell(fp) > lastpos[baseid] ) + komodo_statefname(fname,baseid<32?base:(char *)"",(char *)"komodostate"); + komodo_nameset(symbol,dest,base); + sp = komodo_stateptrget(symbol); + n = 0; + if ( (fp= fopen(fname,"rb")) != 0 && sp != 0 ) { - if ( 0 && lastpos[baseid] == 0 && strcmp(symbol,"KMD") == 0 ) - printf("passport refid.%d %s fname.(%s) base.%s\n",refid,symbol,fname,base); - fseek(fp,lastpos[baseid],SEEK_SET); - while ( komodo_parsestatefile(sp,fp,symbol,dest) >= 0 && n < 1000 ) + fseek(fp,0,SEEK_END); + if ( ftell(fp) > lastpos[baseid] ) { - if ( n == 999 ) + if ( 0 && lastpos[baseid] == 0 && strcmp(symbol,"KMD") == 0 ) + printf("passport refid.%d %s fname.(%s) base.%s\n",refid,symbol,fname,base); + fseek(fp,lastpos[baseid],SEEK_SET); + while ( komodo_parsestatefile(sp,fp,symbol,dest) >= 0 && n < 1000 ) { - if ( time(NULL) < starttime+maxseconds ) - n = 0; - else + if ( n == 999 ) { - //printf("expire passport loop %s -> %s at %ld\n",ASSETCHAINS_SYMBOL,base,lastpos[baseid]); - expired++; + if ( time(NULL) < starttime+maxseconds ) + n = 0; + else + { + //printf("expire passport loop %s -> %s at %ld\n",ASSETCHAINS_SYMBOL,base,lastpos[baseid]); + expired++; + } } + n++; } - n++; - } - lastpos[baseid] = ftell(fp); - if ( lastpos[baseid] == 0 && strcmp(symbol,"KMD") == 0 ) - printf("from.(%s) lastpos[%s] %ld isrt.%d\n",ASSETCHAINS_SYMBOL,CURRENCIES[baseid],lastpos[baseid],komodo_isrealtime(&ht)); - } //else fprintf(stderr,"%s.%ld ",CURRENCIES[baseid],ftell(fp)); - fclose(fp); - } else printf("error.(%s) %p\n",fname,sp); - komodo_statefname(fname,baseid<32?base:(char *)"",(char *)"realtime"); - if ( (fp= fopen(fname,"rb")) != 0 ) - { - if ( fread(buf,1,sizeof(buf),fp) == sizeof(buf) ) + lastpos[baseid] = ftell(fp); + if ( lastpos[baseid] == 0 && strcmp(symbol,"KMD") == 0 ) + printf("from.(%s) lastpos[%s] %ld isrt.%d\n",ASSETCHAINS_SYMBOL,CURRENCIES[baseid],lastpos[baseid],komodo_isrealtime(&ht)); + } //else fprintf(stderr,"%s.%ld ",CURRENCIES[baseid],ftell(fp)); + fclose(fp); + } else printf("error.(%s) %p\n",fname,sp); + komodo_statefname(fname,baseid<32?base:(char *)"",(char *)"realtime"); + if ( (fp= fopen(fname,"rb")) != 0 ) { - sp->CURRENT_HEIGHT = buf[0]; - if ( buf[0] != 0 && buf[0] >= buf[1] && buf[2] > time(NULL)-300 ) + if ( fread(buf,1,sizeof(buf),fp) == sizeof(buf) ) { - isrealtime = 1; - RTmask |= (1LL << baseid); - memcpy(refsp->RTbufs[baseid+1],buf,sizeof(refsp->RTbufs[baseid+1])); - } else if ( (time(NULL)-buf[2]) > 1800 && ASSETCHAINS_SYMBOL[0] != 0 ) - fprintf(stderr,"[%s]: %s not RT %u %u %d\n",ASSETCHAINS_SYMBOL,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); + sp->CURRENT_HEIGHT = buf[0]; + if ( buf[0] != 0 && buf[0] >= buf[1] && buf[2] > time(NULL)-300 ) + { + isrealtime = 1; + RTmask |= (1LL << baseid); + memcpy(refsp->RTbufs[baseid+1],buf,sizeof(refsp->RTbufs[baseid+1])); + } else if ( (time(NULL)-buf[2]) > 1800 && ASSETCHAINS_SYMBOL[0] != 0 ) + fprintf(stderr,"[%s]: %s not RT %u %u %d\n",ASSETCHAINS_SYMBOL,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); + } } else { From 842db392551d2fb60fc56da33ba6e06407f3979e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 16:10:17 +0200 Subject: [PATCH 003/258] 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 e3e3f6a7953..e63dcaf0250 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -915,7 +915,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 else if ( opretbuf[0] == 'I' ) { tokomodo = 0; - if ( strncmp((char *)"KMD",(char *)&opretbuf[opretlen-4],3) != 0 && strcmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4],3)) == 0 ) + if ( strncmp((char *)"KMD",(char *)&opretbuf[opretlen-4],3) != 0 && strncmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4],3)) == 0 ) { if ( (n= komodo_issued_opreturn(base,txids,vouts,values,srcvalues,kmdheights,otherheights,baseids,rmd160s,opretbuf,opretlen,0)) > 0 ) { @@ -961,7 +961,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 } //else printf("opreturn none issued?\n"); } } - else if ( height < 236000 && opretbuf[0] == 'W' && strcmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4]) == 0 )//&& opretlen >= 38 ) + else if ( height < 236000 && opretbuf[0] == 'W' && strncmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4]) == 0 )//&& opretlen >= 38 ) { if ( komodo_baseid((char *)&opretbuf[opretlen-4]) >= 0 && strcmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4]) == 0 ) { From 7b0781586194de911d018af997297d5cd2f4d571 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 16:12:51 +0200 Subject: [PATCH 004/258] 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 e63dcaf0250..ec2f67e7030 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -915,7 +915,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 else if ( opretbuf[0] == 'I' ) { tokomodo = 0; - if ( strncmp((char *)"KMD",(char *)&opretbuf[opretlen-4],3) != 0 && strncmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4],3)) == 0 ) + if ( strncmp((char *)"KMD",(char *)&opretbuf[opretlen-4],3) != 0 && strncmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4],3) == 0 ) { if ( (n= komodo_issued_opreturn(base,txids,vouts,values,srcvalues,kmdheights,otherheights,baseids,rmd160s,opretbuf,opretlen,0)) > 0 ) { @@ -961,7 +961,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 } //else printf("opreturn none issued?\n"); } } - else if ( height < 236000 && opretbuf[0] == 'W' && strncmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4]) == 0 )//&& opretlen >= 38 ) + else if ( height < 236000 && opretbuf[0] == 'W' && strncmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4],3) == 0 )//&& opretlen >= 38 ) { if ( komodo_baseid((char *)&opretbuf[opretlen-4]) >= 0 && strcmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4]) == 0 ) { From 8fa910175a319c50982b4086b698511e0b35c5e2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 16:24:33 +0200 Subject: [PATCH 005/258] Test --- src/assetchains | 2 +- src/miner.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/assetchains b/src/assetchains index 23e00f362d1..4876f2e29db 100755 --- a/src/assetchains +++ b/src/assetchains @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash set -x source pubkey.txt echo $pubkey diff --git a/src/miner.cpp b/src/miner.cpp index 37f96015de8..1551d197dd7 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -678,7 +678,9 @@ void static BitcoinMiner(CWallet *pwallet) } for (j=gpucount=0; j<65; j++) { - fprintf(stderr,"%d ",mids[j]); + if ( mids[j] >= 0 ) + fprintf(stderr,"%d ",mids[j]); + else fprintf(stderr,"GPU "); if ( mids[j] == -1 ) gpucount++; } From 25f7ef8cf6f4fbd93c426e14095ecffc590ca767 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 16:35:05 +0200 Subject: [PATCH 006/258] Test --- src/komodo_gateway.h | 2 +- src/main.cpp | 2 +- src/miner.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index ec2f67e7030..fcdcffd6bab 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1164,7 +1164,7 @@ void komodo_passport_iteration() base = (char *)CURRENCIES[baseid]; if ( baseid+1 != refid ) { - if ( baseid == 32 ) + if ( baseid == 32 || ASSETCHAINS_SYMBOL[0] == 0 ) { komodo_statefname(fname,baseid<32?base:(char *)"",(char *)"komodostate"); komodo_nameset(symbol,dest,base); diff --git a/src/main.cpp b/src/main.cpp index 37b024da763..e8950f2eaa2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3916,7 +3916,7 @@ bool LoadBlockIndex() return false; } KOMODO_LOADINGBLOCKS = 0; - fprintf(stderr,"finished loading blocks\n"); + fprintf(stderr,"finished loading blocks %s\n",ASSETCHAINS_SYMBOL); return true; } diff --git a/src/miner.cpp b/src/miner.cpp index 1551d197dd7..bd0e5c916e6 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -562,7 +562,7 @@ void static BitcoinMiner(CWallet *pwallet) assert(solver == "tromp" || solver == "default"); LogPrint("pow", "Using Equihash solver \"%s\" with n = %u, k = %u\n", solver, n, k); if ( ASSETCHAINS_SYMBOL[0] != 0 ) - fprintf(stderr,"notaryid.%d Mining with %s\n",notaryid,solver.c_str()); + fprintf(stderr,"notaryid.%d Mining.%s with %s\n",notaryid,ASSETCHAINS_SYMBOL,solver.c_str()); std::mutex m_cs; bool cancelSolver = false; boost::signals2::connection c = uiInterface.NotifyBlockTip.connect( From 70bf862b23db156738bd74f495a52576c663567c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 17:00:27 +0200 Subject: [PATCH 007/258] Test --- src/assetchains | 96 ++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/src/assetchains b/src/assetchains index 4876f2e29db..1135f4ce804 100755 --- a/src/assetchains +++ b/src/assetchains @@ -3,84 +3,84 @@ set -x source pubkey.txt echo $pubkey -./komodod -pubkey=$pubkey -ac_name=REVS -ac_supply=1300000 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=SUPERNET -ac_supply=816061 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=DEX -ac_supply=999999 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=PANGEA -ac_supply=999999 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=JUMBLR -ac_supply=999999 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=BET -ac_supply=999999 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=CRYPTO -ac_supply=999999 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=HODL -ac_supply=9999999 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=SHARK -ac_supply=1401 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=BOTS -ac_supply=999999 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=MGW -ac_supply=999999 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=MVP -ac_supply=1000000 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=WIRELESS -ac_supply=21000000 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=KV -ac_supply=1000000 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=CEAL -ac_supply=366666666 -addnode=78.47.196.146 $1 -gen & -./komodod -pubkey=$pubkey -ac_name=MESH -ac_supply=1000000 -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=REVS -ac_supply=1300000 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=SUPERNET -ac_supply=816061 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=DEX -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=PANGEA -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=JUMBLR -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=BET -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=CRYPTO -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=HODL -ac_supply=9999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=SHARK -ac_supply=1401 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=BOTS -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=MGW -ac_supply=999999 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=MVP -ac_supply=1000000 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=WIRELESS -ac_supply=21000000 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=KV -ac_supply=1000000 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=CEAL -ac_supply=366666666 -addnode=78.47.196.146 $1 & +./komodod -pubkey=$pubkey -ac_name=MESH -ac_supply=1000000 -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=USD -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=USD -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=EUR -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=EUR -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=JPY -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=JPY -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=GBP -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=GBP -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=AUD -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=AUD -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=CAD -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=CAD -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=CHF -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=CHF -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=NZD -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=NZD -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=CNY -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=CNY -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=RUB -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=RUB -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=MXN -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=MXN -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=BRL -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=BRL -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=INR -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=INR -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=HKD -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=HKD -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=TRY -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=TRY -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=ZAR -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=ZAR -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=PLN -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=PLN -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=NOK -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=NOK -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=SEK -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=SEK -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=DKK -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=DKK -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=CZK -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=CZK -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=HUF -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=HUF -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=ILS -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=ILS -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=KRW -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=KRW -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=MYR -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=MYR -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=PHP -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=PHP -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=RON -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=RON -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=SGD -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=SGD -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=THB -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=THB -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=BGN -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=BGN -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=IDR -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=IDR -addnode=78.47.196.146 $1 & sleep 10 -./komodod -pubkey=$pubkey -ac_name=HRK -addnode=78.47.196.146 $1 -gen & +./komodod -pubkey=$pubkey -ac_name=HRK -addnode=78.47.196.146 $1 & From c7959ca288d297e8069845c84ef9bd8989afcf3a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 17:40:47 +0200 Subject: [PATCH 008/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index fcdcffd6bab..f7ddea7025b 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -575,7 +575,7 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to PENDING_KOMODO_TX += pax->komodoshis; printf(" len.%d vout.%u DEPOSIT %.8f <- pax.%s pending ht %d %d %.8f | ",len,pax->vout,(double)txNew->vout[numvouts].nValue/COIN,symbol,pax->height,pax->otherheight,dstr(PENDING_KOMODO_TX)); } - if ( numvouts++ >= 1 ) + if ( numvouts++ >= 64 ) break; } if ( numvouts > 1 ) From deba1c4885b66884fe7461db915896a7f63eaf2e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 18:32:08 +0200 Subject: [PATCH 009/258] Test --- src/komodo_gateway.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index f7ddea7025b..b56fb0d3d8a 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -479,7 +479,8 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to } if ( i == 3 ) { - printf("%s not realtime ht.%d\n",ASSETCHAINS_SYMBOL,ht); + if ( tokomodo == 0 ) + printf("%s not realtime ht.%d\n",ASSETCHAINS_SYMBOL,ht); return(0); } if ( tokomodo == 0 ) From acad298339e81f0cce524fd08dea88acaac3233b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 19:07:26 +0200 Subject: [PATCH 010/258] Rewind < 0 --- src/init.cpp | 18 +++++++++++------- src/komodo_globals.h | 2 +- src/komodo_utils.h | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 59dcc27b93d..a0314708922 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1456,13 +1456,17 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) if (mapArgs.count("-blocknotify")) uiInterface.NotifyBlockTip.connect(BlockNotifyCallback); - - uiInterface.InitMessage(_("Activating best chain...")); - // scan for better chains in the block chain database, that are not yet connected in the active best chain - CValidationState state; - if ( !ActivateBestChain(state)) - strErrors << "Failed to connect best block"; - + extern int32_t KOMODO_REWIND; + if ( KOMODO_REWIND < 0 ) + KOMODO_REWIND = 0; + else + { + uiInterface.InitMessage(_("Activating best chain...")); + // scan for better chains in the block chain database, that are not yet connected in the active best chain + CValidationState state; + if ( !ActivateBestChain(state)) + strErrors << "Failed to connect best block"; + } std::vector vImportFiles; if (mapArgs.count("-loadblock")) { diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 9b93ff57e28..905b4fb4b2d 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -40,7 +40,7 @@ struct komodo_state KOMODO_STATES[34]; #define _COINBASE_MATURITY 100 int COINBASE_MATURITY = _COINBASE_MATURITY;//100; -int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET; +int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET,KOMODO_REWIND; int32_t KOMODO_LASTMINED,prevKOMODO_LASTMINED; std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES; uint8_t NOTARY_PUBKEY33[33]; diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 1c32bb06822..7c99aa4b26c 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1463,10 +1463,10 @@ void komodo_args() KOMODO_PAX = 1; } else KOMODO_PAX = GetArg("-pax",0); name = GetArg("-ac_name",""); - /*if ( (KOMODO_REWIND= GetArg("-rewind",0)) != 0 ) + if ( (KOMODO_REWIND= GetArg("-rewind",0)) != 0 ) { printf("KOMODO_REWIND %d\n",KOMODO_REWIND); - }*/ + } if ( name.c_str()[0] != 0 ) { ASSETCHAINS_SUPPLY = GetArg("-ac_supply",10); From df35158ac28a75dce6626477804bd3309102982d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 19:13:14 +0200 Subject: [PATCH 011/258] Test --- src/init.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index a0314708922..9ab3b675f55 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -641,6 +641,8 @@ static void ZC_LoadParams() /** Initialize bitcoin. * @pre Parameters should be parsed and config file should be read. */ +extern int32_t KOMODO_REWIND; + bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) { // ********************************************************* Step 1: setup @@ -1244,10 +1246,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) LogPrintf("Prune: pruned datadir may not have more than %d blocks; -checkblocks=%d may fail\n", MIN_BLOCKS_TO_KEEP, GetArg("-checkblocks", 288)); } - if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", 3), - GetArg("-checkblocks", 288))) { - strLoadError = _("Corrupted block database detected"); - break; + if ( KOMODO_REWIND == 0 ) + { + if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", 3), + GetArg("-checkblocks", 288))) { + strLoadError = _("Corrupted block database detected"); + break; + } } } catch (const std::exception& e) { if (fDebug) LogPrintf("%s\n", e.what()); @@ -1456,7 +1461,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) if (mapArgs.count("-blocknotify")) uiInterface.NotifyBlockTip.connect(BlockNotifyCallback); - extern int32_t KOMODO_REWIND; if ( KOMODO_REWIND < 0 ) KOMODO_REWIND = 0; else From 8c82b6c5e02efeeb2d2f8c45ad0bddd32eee6a5f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 20:47:38 +0200 Subject: [PATCH 012/258] Test --- src/init.cpp | 6 ++---- src/main.cpp | 10 ++++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 9ab3b675f55..0f03aac2193 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1246,7 +1246,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) LogPrintf("Prune: pruned datadir may not have more than %d blocks; -checkblocks=%d may fail\n", MIN_BLOCKS_TO_KEEP, GetArg("-checkblocks", 288)); } - if ( KOMODO_REWIND == 0 ) + if ( KOMODO_REWIND >= 0 ) { if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", 3), GetArg("-checkblocks", 288))) { @@ -1461,9 +1461,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) if (mapArgs.count("-blocknotify")) uiInterface.NotifyBlockTip.connect(BlockNotifyCallback); - if ( KOMODO_REWIND < 0 ) - KOMODO_REWIND = 0; - else + if ( KOMODO_REWIND >= 0 ) { uiInterface.InitMessage(_("Activating best chain...")); // scan for better chains in the block chain database, that are not yet connected in the active best chain diff --git a/src/main.cpp b/src/main.cpp index e8950f2eaa2..53906cbd8ed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2768,8 +2768,14 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo if (!DisconnectTip(state)) return false; } - /*fprintf(stderr,"chaintip %d vs rewind.%d\n",(int32_t)chainActive.Tip()->nHeight,KOMODO_REWIND); - if ( KOMODO_REWIND != 0 && chainActive.Tip()->nHeight >= KOMODO_REWIND ) + extern int32_t KOMODO_REWIND; + if ( KOMODO_REWIND < 0 ) + { + fprintf(stderr,"chaintip %d vs rewind.%d\n",(int32_t)chainActive.Tip()->nHeight,KOMODO_REWIND); + sleep(3); + KOMODO_REWIND++; + } + /*if ( KOMODO_REWIND != 0 && chainActive.Tip()->nHeight >= KOMODO_REWIND ) { fprintf(stderr,"rewind ht.%d\n",chainActive.Tip()->nHeight); while ( chainActive.Tip()->nHeight > KOMODO_REWIND ) From 8be34022b0702e7d8fa90eeb561441f73a7eca56 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 20:53:44 +0200 Subject: [PATCH 013/258] Test --- src/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 53906cbd8ed..c81dc77f350 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2772,8 +2772,16 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo if ( KOMODO_REWIND < 0 ) { fprintf(stderr,"chaintip %d vs rewind.%d\n",(int32_t)chainActive.Tip()->nHeight,KOMODO_REWIND); + for (i=0; i<-KOMODO_REWIND; i++) + { + if ( !DisconnectTip(state) ) + { + //InvalidateBlock(state,chainActive.Tip()); + return false; + } + } sleep(3); - KOMODO_REWIND++; + KOMODO_REWIND = 0; } /*if ( KOMODO_REWIND != 0 && chainActive.Tip()->nHeight >= KOMODO_REWIND ) { From 94ae3b61688486e8970b5f6308330dcef0d1a182 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 20:54:18 +0200 Subject: [PATCH 014/258] Test --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index c81dc77f350..f95be2c40f7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2772,6 +2772,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo if ( KOMODO_REWIND < 0 ) { fprintf(stderr,"chaintip %d vs rewind.%d\n",(int32_t)chainActive.Tip()->nHeight,KOMODO_REWIND); + int32_t i; for (i=0; i<-KOMODO_REWIND; i++) { if ( !DisconnectTip(state) ) From ae04f6178d85c50686313fe3532f130b7d80a4a4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 21:01:33 +0200 Subject: [PATCH 015/258] Test --- src/komodo_gateway.h | 7 +++++++ src/main.cpp | 16 ---------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index b56fb0d3d8a..558d69575d3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -694,6 +694,13 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above offset += komodo_scriptitemlen(&opretlen,&script[offset]); if ( ASSETCHAINS_SYMBOL[0] == 0 ) { + extern int32_t KOMODO_REWIND; + if ( KOMODO_REWIND < 0 ) + { + fprintf(stderr,"rewind.%d\n",KOMODO_REWIND); + sleep(3); + KOMODO_REWIND = 0; + } for (i=0; inHeight,KOMODO_REWIND); - int32_t i; - for (i=0; i<-KOMODO_REWIND; i++) - { - if ( !DisconnectTip(state) ) - { - //InvalidateBlock(state,chainActive.Tip()); - return false; - } - } - sleep(3); - KOMODO_REWIND = 0; - } /*if ( KOMODO_REWIND != 0 && chainActive.Tip()->nHeight >= KOMODO_REWIND ) { fprintf(stderr,"rewind ht.%d\n",chainActive.Tip()->nHeight); From 49b495854bc5ad382455df88969902c81db3e024 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Mar 2017 23:41:02 +0200 Subject: [PATCH 016/258] Metaphilibert requests --- src/miner.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index bd0e5c916e6..9c677d3913c 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -663,7 +663,7 @@ void static BitcoinMiner(CWallet *pwallet) if ( i == 33 ) externalflag = 1; else externalflag = 0; - if ( NOTARY_PUBKEY33[0] != 0 && notaryid < 3 ) + if ( NOTARY_PUBKEY33[0] != 0 && (notaryid < 3 || notaryid == 34 || notaryid == 51 || notaryid == 52) ) { for (i=1; i<66; i++) if ( memcmp(pubkeys[i],pubkeys[0],33) == 0 ) @@ -678,7 +678,7 @@ void static BitcoinMiner(CWallet *pwallet) } for (j=gpucount=0; j<65; j++) { - if ( mids[j] >= 0 ) + if ( mids[j] >= 0 || notaryid == 34 ) fprintf(stderr,"%d ",mids[j]); else fprintf(stderr,"GPU "); if ( mids[j] == -1 ) @@ -689,8 +689,10 @@ void static BitcoinMiner(CWallet *pwallet) for (j=0; j<65; j++) if ( mids[j] == notaryid ) break; + if ( j == 65 ) + KOMODO_LASTMINED = 0; } else fprintf(stderr,"no nonz pubkeys\n"); - if ( (Mining_height >= 235300 && Mining_height < 236000) || (j == 65 && Mining_height > KOMODO_MAYBEMINED+3 && Mining_height > KOMODO_LASTMINED+64) ) + if ( (Mining_height >= 235300 && Mining_height < 236000) || (j == 65 && Mining_height > KOMODO_MAYBEMINED+1 && Mining_height > KOMODO_LASTMINED+64) ) { hashTarget = arith_uint256().SetCompact(KOMODO_MINDIFF_NBITS); fprintf(stderr,"I am the chosen one for %s ht.%d\n",ASSETCHAINS_SYMBOL,pindexPrev->nHeight+1); From 9e5fc6d77d481fd3d012df1cd6339a432aab0e46 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 00:30:50 +0200 Subject: [PATCH 017/258] Test --- src/komodo.h | 8 ++++++++ src/miner.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/komodo.h b/src/komodo.h index 33e4ea54431..54838d94c49 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -545,6 +545,8 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) printf("%s ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d <<<<<<<<<<< notarized\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts); notarized = 1; } + if ( NOTARY_PUBKEY33[0] != 0 ) + printf("(tx.%d: ",i); for (j=0; j= sizeof(uint32_t) && len <= sizeof(scriptbuf) ) { @@ -578,6 +582,8 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) } } } + if ( NOTARY_PUBKEY33[0] != 0 ) + printf(") "); //printf("%s ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d notarized.%d special.%d isratification.%d\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts,notarized,specialtx,isratification); if ( notarized != 0 && (notarizedheight != 0 || specialtx != 0) ) { @@ -618,6 +624,8 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) } } } + if ( NOTARY_PUBKEY33[0] != 0 ) + printf("ht.%d\n",height); if ( pindex->nHeight == hwmheight ) komodo_stateupdate(height,0,0,0,zero,0,0,0,0,height,(uint32_t)pindex->nTime,0,0,0,0); } else fprintf(stderr,"komodo_connectblock: unexpected null pindex\n"); diff --git a/src/miner.cpp b/src/miner.cpp index 9c677d3913c..dfec5825aaa 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -684,7 +684,7 @@ void static BitcoinMiner(CWallet *pwallet) if ( mids[j] == -1 ) gpucount++; } - fprintf(stderr," <- prev minerids from ht.%d notary.%d gpucount.%d %.2f%%\n",pindexPrev->nHeight,notaryid,gpucount,100.*(double)gpucount/j); + fprintf(stderr," <- prev minerids from ht.%d notary.%d gpucount.%d %.2f%% t.%u\n",pindexPrev->nHeight,notaryid,gpucount,100.*(double)gpucount/j,(uint32_t)time(NULL)); } for (j=0; j<65; j++) if ( mids[j] == notaryid ) From ac93bb3e19ba2c966047d8746830d1559ab25f63 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 00:32:33 +0200 Subject: [PATCH 018/258] Test --- src/komodo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo.h b/src/komodo.h index 54838d94c49..62c5a02ded3 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -625,7 +625,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) } } if ( NOTARY_PUBKEY33[0] != 0 ) - printf("ht.%d\n",height); + printf("%s ht.%d\n",ASSETCHAINS_SYMBOL[0] == 0 ? "KMD" : ASSETCHAINS_SYMBOL,height); if ( pindex->nHeight == hwmheight ) komodo_stateupdate(height,0,0,0,zero,0,0,0,0,height,(uint32_t)pindex->nTime,0,0,0,0); } else fprintf(stderr,"komodo_connectblock: unexpected null pindex\n"); From c495a60aa75683d94004f3599e530323bf5a838f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 11:01:17 +0200 Subject: [PATCH 019/258] Remove null print --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 558d69575d3..aa10322ca9e 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -532,7 +532,7 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to { if ( strcmp(pax->symbol,ASSETCHAINS_SYMBOL) == 0 ) printf("pax->symbol.%s != %s or null pax->validated %.8f ready.%d ht.(%d %d)\n",pax->symbol,symbol,dstr(pax->validated),pax->ready,kmdsp->CURRENT_HEIGHT,pax->height); - pax->marked = pax->fiatoshis; + pax->marked = pax->height; continue; } if ( pax->ready == 0 ) From 84e0ca8ebb84690fde1cafd83a322ac4137624b0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 16:06:32 +0200 Subject: [PATCH 020/258] Test --- src/komodo_gateway.h | 12 ++++++------ src/main.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index aa10322ca9e..14a6d0620bc 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -701,6 +701,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above sleep(3); KOMODO_REWIND = 0; } + // 6a35506c65617365206d616b6520796f75722047697420636f6d6d6974206d65737361676573206d6f726520696e74657265737469 height.241778 checkdeposit n.4 [6a] [P] 80 vs 88 for (i=0; i 0 ) { + printf("num.%d\n",num); for (i=1; iRTmask & (1LL << baseids[i-1])) == 0 ) @@ -747,18 +750,15 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( pax->fiatoshis == block.vtx[0].vout[i].nValue ) { + matched++; if ( pax->marked != 0 && height >= 80820 ) { printf(">>>>>>>>>>> %c errs.%d i.%d match %.8f vs %.8f paxmarked.%d kht.%d ht.%d\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block.vtx[0].vout[i].nValue),pax->marked,pax->height,pax->otherheight); - if ( pax->komodoshis != 0 || pax->fiatoshis != 0 ) - errs++; - else matched++; // onetime init bypass } else { - if ( opcode == 'X' && strcmp(ASSETCHAINS_SYMBOL,CURRENCIES[baseids[i]]) == 0 ) + if ( strcmp(ASSETCHAINS_SYMBOL,CURRENCIES[baseids[i]]) == 0 ) printf("check deposit validates %s %.8f -> %.8f\n",CURRENCIES[baseids[i]],dstr(srcvalues[i]),dstr(values[i])); - matched++; } } else diff --git a/src/main.cpp b/src/main.cpp index d7e3b02122c..5bba419d6b8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3435,7 +3435,7 @@ bool ProcessNewBlock(int32_t height,CValidationState &state, CNode* pfrom, CBloc komodo_currentheight_set(chainActive.Tip()->nHeight); if ( ASSETCHAINS_SYMBOL[0] == 0 ) checked = CheckBlock(height!=0?height:komodo_block2height(pblock),0,*pblock, state, verifier); - else checked = CheckBlock(0,0,*pblock, state, verifier); + else checked = CheckBlock(height!=0?height:komodo_block2height(pblock),0,*pblock, state, verifier); { LOCK(cs_main); bool fRequested = MarkBlockAsReceived(pblock->GetHash()); From e305194370792e9153c4ffe6e909a778fad7b77d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 16:54:50 +0200 Subject: [PATCH 021/258] Test --- src/komodo_gateway.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 14a6d0620bc..f06763c0abc 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -709,6 +709,8 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above if ( height >= 235300 ) return(-1); strcpy(symbol,(char *)"KMD"); + if ( komodo_isrealtime(&ht) == 0 || KOMODO_PASSPORT_INITDONE == 0 ) // init time already in DB + return(0); } else { @@ -723,15 +725,18 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } return(0); } + while ( KOMODO_PASSPORT_INITDONE == 0 ) + { + fprintf(stderr,"."); + sleep(3); + } + if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB + return(0); } - if ( komodo_isrealtime(&ht) == 0 || KOMODO_PASSPORT_INITDONE == 0 ) // init time already in DB - return(0); if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) { - printf("inside if\n"); if ( (num= komodo_issued_opreturn(base,txids,vouts,values,srcvalues,kmdheights,otherheights,baseids,rmd160s,&script[offset],opretlen,opcode == 'X')) > 0 ) { - printf("num.%d\n",num); for (i=1; iRTmask & (1LL << baseids[i-1])) == 0 ) From 0d162875fd484da88525c6d77b2bf14cf95afeee Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 17:02:55 +0200 Subject: [PATCH 022/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index f06763c0abc..b3d02a1872e 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -806,7 +806,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else { - printf("no opreturn entries to check\n"); + printf("no opreturn entries to check ht.%d %d\n",height,ht); return(-1); } //printf("opretlen.%d num.%d\n",opretlen,num); From 77faa5a181e53bd6c0c55c384293d37fe48f7423 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 17:06:15 +0200 Subject: [PATCH 023/258] Test --- src/komodo_gateway.h | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index b3d02a1872e..541269819e4 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -806,7 +806,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else { - printf("no opreturn entries to check ht.%d %d\n",height,ht); + printf("no opreturn entries to check ht.%d\n",height); return(-1); } //printf("opretlen.%d num.%d\n",opretlen,num); diff --git a/src/main.cpp b/src/main.cpp index 5bba419d6b8..639d2709df9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3213,7 +3213,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat if (nSigOps > MAX_BLOCK_SIGOPS) return state.DoS(100, error("CheckBlock(): out-of-bounds SigOpCount"), REJECT_INVALID, "bad-blk-sigops", true); - if ( komodo_check_deposit(height,block) < 0 ) + if ( komodo_check_deposit(ASSETCHAINS_SYMBOL[0] == 0 height : (int32_t)pindex->nHeight,block) < 0 ) { static uint32_t counter; if ( counter++ < 100 ) From 3a05130b14503e15c96dfbb5f5bd31bec9e6c548 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 17:07:22 +0200 Subject: [PATCH 024/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 639d2709df9..65957555c20 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3213,7 +3213,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat if (nSigOps > MAX_BLOCK_SIGOPS) return state.DoS(100, error("CheckBlock(): out-of-bounds SigOpCount"), REJECT_INVALID, "bad-blk-sigops", true); - if ( komodo_check_deposit(ASSETCHAINS_SYMBOL[0] == 0 height : (int32_t)pindex->nHeight,block) < 0 ) + if ( komodo_check_deposit(ASSETCHAINS_SYMBOL[0] == 0 ? height : (int32_t)pindex->nHeight,block) < 0 ) { static uint32_t counter; if ( counter++ < 100 ) From e530cecf25040481094d2d9a6f20af4c30eef6fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 17:25:26 +0200 Subject: [PATCH 025/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 65957555c20..7ba9a43b06f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3213,7 +3213,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat if (nSigOps > MAX_BLOCK_SIGOPS) return state.DoS(100, error("CheckBlock(): out-of-bounds SigOpCount"), REJECT_INVALID, "bad-blk-sigops", true); - if ( komodo_check_deposit(ASSETCHAINS_SYMBOL[0] == 0 ? height : (int32_t)pindex->nHeight,block) < 0 ) + if ( komodo_check_deposit(ASSETCHAINS_SYMBOL[0] == 0 ? height : pindex != 0 ? (int32_t)pindex->nHeight : chainTip()->nHeight+1,block) < 0 ) { static uint32_t counter; if ( counter++ < 100 ) From 15a8c93002734af7a4b5d5b7429b168f83ba2fbd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 17:28:02 +0200 Subject: [PATCH 026/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 7ba9a43b06f..35c7431840c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3213,7 +3213,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat if (nSigOps > MAX_BLOCK_SIGOPS) return state.DoS(100, error("CheckBlock(): out-of-bounds SigOpCount"), REJECT_INVALID, "bad-blk-sigops", true); - if ( komodo_check_deposit(ASSETCHAINS_SYMBOL[0] == 0 ? height : pindex != 0 ? (int32_t)pindex->nHeight : chainTip()->nHeight+1,block) < 0 ) + if ( komodo_check_deposit(ASSETCHAINS_SYMBOL[0] == 0 ? height : pindex != 0 ? (int32_t)pindex->nHeight : chainActive.Tip()->nHeight+1,block) < 0 ) { static uint32_t counter; if ( counter++ < 100 ) From 22e2f9b139fed7c79811857f9a81da3b94ff9201 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 17:37:41 +0200 Subject: [PATCH 027/258] Test --- src/komodo_gateway.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 541269819e4..f92c7f8915e 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -635,7 +635,7 @@ void komodo_bannedset(uint256 *array,int32_t max) int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above block is valid pax pricing { static uint256 array[15]; - int32_t i,j,k,n,ht,txn_count,num,opretlen,offset=1,errs=0,matched=0,kmdheights[64],otherheights[64]; uint256 hash,txids[64]; char symbol[16],base[16]; uint16_t vouts[64]; int8_t baseids[64]; uint8_t *script,opcode,rmd160s[64*20]; uint64_t total,available,deposited,issued,withdrawn,approved,redeemed; int64_t values[64],srcvalues[64]; struct pax_transaction *pax; struct komodo_state *sp; + int32_t i,j,k,n,ht,baseid,txn_count,num,opretlen,offset=1,errs=0,matched=0,kmdheights[64],otherheights[64]; uint256 hash,txids[64]; char symbol[16],base[16]; uint16_t vouts[64]; int8_t baseids[64]; uint8_t *script,opcode,rmd160s[64*20]; uint64_t total,available,deposited,issued,withdrawn,approved,redeemed; int64_t values[64],srcvalues[64]; struct pax_transaction *pax; struct komodo_state *sp; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); memset(baseids,0xff,sizeof(baseids)); @@ -716,7 +716,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above { strcpy(symbol,ASSETCHAINS_SYMBOL); opcode = 'I'; - if ( komodo_baseid(symbol) < 0 ) + if ( (baseid= komodo_baseid(symbol)) < 0 ) { if ( block.vtx[0].vout.size() != 1 ) { @@ -732,6 +732,8 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB return(0); + if ( baseid == USD && (height <= 4000 || komodo_isrealtime(&ht) == 0) ) + return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) { From a5e9fab652810fd4486ecc403b47a6bb15bb79b0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 18:08:13 +0200 Subject: [PATCH 028/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index f92c7f8915e..d76e54b34dc 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1208,7 +1208,7 @@ void komodo_passport_iteration() n++; } lastpos[baseid] = ftell(fp); - if ( lastpos[baseid] == 0 && strcmp(symbol,"KMD") == 0 ) + //if ( lastpos[baseid] == 0 && strcmp(symbol,"KMD") == 0 ) printf("from.(%s) lastpos[%s] %ld isrt.%d\n",ASSETCHAINS_SYMBOL,CURRENCIES[baseid],lastpos[baseid],komodo_isrealtime(&ht)); } //else fprintf(stderr,"%s.%ld ",CURRENCIES[baseid],ftell(fp)); fclose(fp); From 65f47ad9e0c1a5994c3ef1b307fbec98a5d0a343 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 18:11:33 +0200 Subject: [PATCH 029/258] Test --- src/komodo_gateway.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index d76e54b34dc..674051743d0 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -725,13 +725,13 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } return(0); } - while ( KOMODO_PASSPORT_INITDONE == 0 ) + /*while ( KOMODO_PASSPORT_INITDONE == 0 ) { fprintf(stderr,"."); sleep(3); } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB - return(0); + return(0);*/ if ( baseid == USD && (height <= 4000 || komodo_isrealtime(&ht) == 0) ) return(0); } @@ -1208,7 +1208,7 @@ void komodo_passport_iteration() n++; } lastpos[baseid] = ftell(fp); - //if ( lastpos[baseid] == 0 && strcmp(symbol,"KMD") == 0 ) + if ( lastpos[baseid] == 0 && strcmp(symbol,"KMD") == 0 ) printf("from.(%s) lastpos[%s] %ld isrt.%d\n",ASSETCHAINS_SYMBOL,CURRENCIES[baseid],lastpos[baseid],komodo_isrealtime(&ht)); } //else fprintf(stderr,"%s.%ld ",CURRENCIES[baseid],ftell(fp)); fclose(fp); From 4b6b337e4e3ae8fc62d149e04e08a60152d20381 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 18:14:46 +0200 Subject: [PATCH 030/258] 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 674051743d0..f40ac59e7b3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -725,13 +725,13 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } return(0); } - /*while ( KOMODO_PASSPORT_INITDONE == 0 ) + while ( KOMODO_PASSPORT_INITDONE == 0 ) { fprintf(stderr,"."); sleep(3); } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB - return(0);*/ + return(0); if ( baseid == USD && (height <= 4000 || komodo_isrealtime(&ht) == 0) ) return(0); } @@ -1190,8 +1190,8 @@ void komodo_passport_iteration() fseek(fp,0,SEEK_END); if ( ftell(fp) > lastpos[baseid] ) { - if ( 0 && lastpos[baseid] == 0 && strcmp(symbol,"KMD") == 0 ) - printf("passport refid.%d %s fname.(%s) base.%s\n",refid,symbol,fname,base); + //if ( 0 && lastpos[baseid] == 0 && strcmp(symbol,"KMD") == 0 ) + printf("passport refid.%d %s fname.(%s) base.%s %ld %ld\n",refid,symbol,fname,base,ftell(fp),lastpos[baseid]); fseek(fp,lastpos[baseid],SEEK_SET); while ( komodo_parsestatefile(sp,fp,symbol,dest) >= 0 && n < 1000 ) { From 1e1893d8f1cccbe5db2acb5c66eed9791381fe9e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 18:19:12 +0200 Subject: [PATCH 031/258] Test --- src/bitcoind.cpp | 7 +++++-- src/komodo_gateway.h | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 63adececedb..90dcde868e0 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -42,8 +42,11 @@ void WaitForShutdown(boost::thread_group* threadGroup) while (!fShutdown) { //fprintf(stderr,"call passport iteration\n"); - MilliSleep(10000); - komodo_passport_iteration(); + if ( ASSETCHAINS_SYMBOL[0] == 0 ) + { + MilliSleep(10000); + komodo_passport_iteration(); + } fShutdown = ShutdownRequested(); } if (threadGroup) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index f40ac59e7b3..628522a5dde 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -727,8 +727,8 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } while ( KOMODO_PASSPORT_INITDONE == 0 ) { - fprintf(stderr,"."); - sleep(3); + komodo_passport_iteration(); + //sleep(3); } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB return(0); From db2b19574baf63746bfada522a0192fe347f5f96 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 18:22:24 +0200 Subject: [PATCH 032/258] Test --- src/komodo_gateway.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 628522a5dde..e7cae45f743 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -632,6 +632,8 @@ void komodo_bannedset(uint256 *array,int32_t max) //else printf("set %d banned txids\n",max); } +void komodo_passport_iteration(); + int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above block is valid pax pricing { static uint256 array[15]; From 2f8a8864608f8a872e616d83ce17a17c2a9f17ec Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 18:33:58 +0200 Subject: [PATCH 033/258] 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 e7cae45f743..3c3f1c63ea8 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -704,9 +704,9 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above KOMODO_REWIND = 0; } // 6a35506c65617365206d616b6520796f75722047697420636f6d6d6974206d65737361676573206d6f726520696e74657265737469 height.241778 checkdeposit n.4 [6a] [P] 80 vs 88 - for (i=0; i= 235300 ) return(-1); @@ -734,7 +734,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB return(0); - if ( baseid == USD && (height <= 4000 || komodo_isrealtime(&ht) == 0) ) + if ( baseid == USD && height <= 4000 ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From b879b829992790f9061d7e0b3aa6b0d7e463ce29 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 18:41:59 +0200 Subject: [PATCH 034/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 3c3f1c63ea8..1c18898193f 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -734,7 +734,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB return(0); - if ( baseid == USD && height <= 4000 ) + if ( baseid == USD && height <= 3900 ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From b6d301be0346eef8a873944c7b2f005694e7ea13 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 18:51:34 +0200 Subject: [PATCH 035/258] Test --- src/komodo_gateway.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 1c18898193f..91a3bf29c8c 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -734,7 +734,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB return(0); - if ( baseid == USD && height <= 3900 ) + if ( 0 && baseid == USD && height <= 3900 ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) @@ -1192,8 +1192,8 @@ void komodo_passport_iteration() fseek(fp,0,SEEK_END); if ( ftell(fp) > lastpos[baseid] ) { - //if ( 0 && lastpos[baseid] == 0 && strcmp(symbol,"KMD") == 0 ) - printf("passport refid.%d %s fname.(%s) base.%s %ld %ld\n",refid,symbol,fname,base,ftell(fp),lastpos[baseid]); + if ( strcmp(symbol,"KMD") != 0 ) + printf("%s passport refid.%d %s fname.(%s) base.%s %ld %ld\n",ASSETCHAINS_SYMBOL,refid,symbol,fname,base,ftell(fp),lastpos[baseid]); fseek(fp,lastpos[baseid],SEEK_SET); while ( komodo_parsestatefile(sp,fp,symbol,dest) >= 0 && n < 1000 ) { From 98d71273c688290aa2aa30390353394a672007d4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 18:56:37 +0200 Subject: [PATCH 036/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 91a3bf29c8c..5cb25450646 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -817,7 +817,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else { - printf("not proper vout with opreturn format\n"); + printf("not proper vout with opreturn format ht.%d\n",height); return(-1); } return(0); From db82494f44d70230c1250e9eac30fec8a47d7a0b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:00:11 +0200 Subject: [PATCH 037/258] Test --- src/komodo_gateway.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 5cb25450646..68e0254014d 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -734,7 +734,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB return(0); - if ( 0 && baseid == USD && height <= 3900 ) + if ( baseid == USD && height == 1344 ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) @@ -817,6 +817,9 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else { + for (i=0; i Date: Sun, 19 Mar 2017 19:04:38 +0200 Subject: [PATCH 038/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 68e0254014d..e2479f690f2 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -734,7 +734,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB return(0); - if ( baseid == USD && height == 1344 ) + if ( baseid == USD && (height == 1344 || height == 1399) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From e28ec5a8de168e8d29e13969ee41c877ca6e13da Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:07:34 +0200 Subject: [PATCH 039/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index e2479f690f2..3a7600aa0b3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -734,7 +734,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB return(0); - if ( baseid == USD && (height == 1344 || height == 1399) ) + if ( baseid == USD && (height == 1339 || height == 1344) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From aeebb21eed8e165a777083c0192fcf4015ded5c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:10:37 +0200 Subject: [PATCH 040/258] Test --- src/komodo_gateway.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 3a7600aa0b3..efdfd99908a 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -734,7 +734,8 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB return(0); - if ( baseid == USD && (height == 1339 || height == 1344) ) + // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 + if ( baseid == USD && (height == 1338 || height == 1339 || height == 1344) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From 6e560ef8c5ffa1708e44e9a36caf3a78f1e18b23 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:13:23 +0200 Subject: [PATCH 041/258] Test --- src/komodo_gateway.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index efdfd99908a..d9700cbb4ad 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -734,8 +734,9 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB return(0); - // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 - if ( baseid == USD && (height == 1338 || height == 1339 || height == 1344) ) + // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 + // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 + if ( baseid == USD && (height == 1337 || height == 1338 || height == 1339 || height == 1344) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From d4fce1d75d2c6d4f2fccd907093f1c66e242fb87 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:15:51 +0200 Subject: [PATCH 042/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index d9700cbb4ad..0209ab54f71 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height == 1337 || height == 1338 || height == 1339 || height == 1344) ) + if ( baseid == USD && (height <= 1344) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From 9a762d0ed9612d7cc4374e548e205257ac6a77f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:19:35 +0200 Subject: [PATCH 043/258] Test --- src/komodo_gateway.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 0209ab54f71..e527e3b8a0a 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height <= 1344) ) + if ( baseid == USD && (height <= 1400) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) @@ -819,9 +819,9 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else { - for (i=0; i Date: Sun, 19 Mar 2017 19:22:00 +0200 Subject: [PATCH 044/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index e527e3b8a0a..8aa19d2055a 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height <= 1400) ) + if ( baseid == USD && (height <= 1515) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From c7ea21a1839e5f34ed4d319d6aad76fe692f92a7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:24:09 +0200 Subject: [PATCH 045/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 8aa19d2055a..5bcddbb12fa 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height <= 1515) ) + if ( baseid == USD && (height <= 2000) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From 29c9dd88667641c5d322ed3c8f890d16e00fcadb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:29:24 +0200 Subject: [PATCH 046/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 5bcddbb12fa..d962be3699f 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height <= 2000) ) + if ( baseid == USD && (height <= 2000 || height == 3328) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From 243fc4a5fa4005b8725081bac97ec87d9be0a4e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:33:48 +0200 Subject: [PATCH 047/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index d962be3699f..eced20efefd 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height <= 2000 || height == 3328) ) + if ( baseid == USD && (height <= 2000 || height == 3282 || height == 3328) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From 9939e2c8c731fc9b9c6ac066d93c3e4b7caa5d5c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:38:37 +0200 Subject: [PATCH 048/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index eced20efefd..6eac81753e2 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height <= 2000 || height == 3282 || height == 3328) ) + if ( baseid == USD && (height <= 2000 || height == 3282 || height == 3328 || height == 3468) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From 1af0ebce3cfc3b71d7fa7032731e2bee77171f58 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:44:21 +0200 Subject: [PATCH 049/258] 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 6eac81753e2..34a959e9a9b 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -768,9 +768,9 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else { - if ( strcmp(ASSETCHAINS_SYMBOL,CURRENCIES[baseids[i]]) == 0 ) - printf("check deposit validates %s %.8f -> %.8f\n",CURRENCIES[baseids[i]],dstr(srcvalues[i]),dstr(values[i])); } + if ( strcmp(ASSETCHAINS_SYMBOL,CURRENCIES[baseids[i-1]]) == 0 ) + printf("check deposit validates %s %.8f -> %.8f\n",CURRENCIES[baseids[i]],dstr(srcvalues[i]),dstr(values[i])); } else { From 6b835bcea26265e190626e5f1ebd85b7fb2c5984 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:55:14 +0200 Subject: [PATCH 050/258] Test --- src/komodo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo.h b/src/komodo.h index 62c5a02ded3..789f1dbbfee 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -447,7 +447,7 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr } } - if ( *isratificationp == 0 && (signedmask != 0 || (scriptbuf[len] != 'X' && scriptbuf[len] != 'A' && scriptbuf[len] != 'I')) ) + if ( *isratificationp == 0 && (signedmask != 0 || (scriptbuf[len] != 'X' && scriptbuf[len] != 'A') ) // && scriptbuf[len] != 'I') komodo_stateupdate(height,0,0,0,txhash,0,0,0,0,0,0,value,&scriptbuf[len],opretlen,j); } } From c9e4d98254996ec59c4b2682a1303328d0b5cf43 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 19:57:27 +0200 Subject: [PATCH 051/258] Test --- src/komodo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo.h b/src/komodo.h index 789f1dbbfee..d1a48eccceb 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -447,7 +447,7 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr } } - if ( *isratificationp == 0 && (signedmask != 0 || (scriptbuf[len] != 'X' && scriptbuf[len] != 'A') ) // && scriptbuf[len] != 'I') + if ( *isratificationp == 0 && (signedmask != 0 || (scriptbuf[len] != 'X' && scriptbuf[len] != 'A')) ) // && scriptbuf[len] != 'I') komodo_stateupdate(height,0,0,0,txhash,0,0,0,0,0,0,value,&scriptbuf[len],opretlen,j); } } From 0ce14e5a60ff4ca762b9f0af9c8ad208db81cc90 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 20:06:09 +0200 Subject: [PATCH 052/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 34a959e9a9b..3491da231d3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height <= 2000 || height == 3282 || height == 3328 || height == 3468) ) + if ( baseid == USD && (height <= 2100 || height == 3282 || height == 3328 || height == 3468) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From 55e80b4c4618e58dd0df43f239f153a403622d74 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 20:08:52 +0200 Subject: [PATCH 053/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 3491da231d3..c61ac45c1d3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height <= 2100 || height == 3282 || height == 3328 || height == 3468) ) + if ( baseid == USD && (height == 2075 || height == 2131 || height == 3282 || height == 3328 || height == 3468) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From ac2abfc639fe701de633e79e7a15b9cb19c4d6d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 20:11:14 +0200 Subject: [PATCH 054/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index c61ac45c1d3..d1b696734f8 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height == 2075 || height == 2131 || height == 3282 || height == 3328 || height == 3468) ) + if ( baseid == USD && (height <= 2000 || height == 2075 || height == 2131 || height == 3282 || height == 3328 || height == 3468) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From 2950a22af2eaaacb01446a0e457cfee194073d41 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 20:14:12 +0200 Subject: [PATCH 055/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index d1b696734f8..f34ffb1798d 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height <= 2000 || height == 2075 || height == 2131 || height == 3282 || height == 3328 || height == 3468) ) + if ( baseid == USD && (height <= 2000 || height == 2075 || height == 2082 || height == 2131 || height == 3282 || height == 3328 || height == 3468) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From d293ed8bb528276dd55e3ea9f09a1a1797c4e195 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 20:18:33 +0200 Subject: [PATCH 056/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index f34ffb1798d..2cf05ecc7ff 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,7 +736,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height <= 2000 || height == 2075 || height == 2082 || height == 2131 || height == 3282 || height == 3328 || height == 3468) ) + if ( baseid == USD && (height <= 2200 || height == 3282 || height == 3328 || height == 3468) ) return(0); } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) From d942f18f28060c9f6e4f607b2430d63f71475043 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 20:21:55 +0200 Subject: [PATCH 057/258] Test --- src/komodo_gateway.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 2cf05ecc7ff..d7dc9c800aa 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -812,6 +812,8 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else { + for (i=0; i Date: Sun, 19 Mar 2017 20:25:48 +0200 Subject: [PATCH 058/258] Test --- src/komodo_gateway.h | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index d7dc9c800aa..ff8ba47ecbf 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -812,10 +812,30 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else { - for (i=0; i= MAX_MONEY ) + { + overflow = 1; + break; + } + total += val; + if ( total < prevtotal || (val != 0 && total == prevtotal) ) + { + overflow = 1; + break; + } + prevtotal = total; + } + if ( overflow != 0 || total > COIN/10 ) + { + for (i=0; i Date: Sun, 19 Mar 2017 20:33:52 +0200 Subject: [PATCH 059/258] Test --- src/komodo_gateway.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index ff8ba47ecbf..c7d23e70421 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,8 +736,11 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 - if ( baseid == USD && (height <= 2200 || height == 3282 || height == 3328 || height == 3468) ) + if ( baseid == USD ) + { + if ( (height < 4000 && (len == 48897 || len == 9474)) || (height <= 2200 || height == 3282 || height == 3328 || height == 3468) ) return(0); + } } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) { @@ -831,6 +834,9 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } if ( overflow != 0 || total > COIN/10 ) { + for (i=0; i Date: Sun, 19 Mar 2017 20:36:22 +0200 Subject: [PATCH 060/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index c7d23e70421..2908ca4515f 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -738,7 +738,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 if ( baseid == USD ) { - if ( (height < 4000 && (len == 48897 || len == 9474)) || (height <= 2200 || height == 3282 || height == 3328 || height == 3468) ) + if ( (height < 4000 && (opretlen == 48897 || opretlen == 9474)) || (height <= 2200 || height == 3282 || height == 3328 || height == 3468) ) return(0); } } From 82aa5064df74cd03a956fa81e0934a00b13ff0ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 20:40:02 +0200 Subject: [PATCH 061/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 2908ca4515f..e3525c4bb34 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -738,7 +738,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 if ( baseid == USD ) { - if ( (height < 4000 && (opretlen == 48897 || opretlen == 9474)) || (height <= 2200 || height == 3282 || height == 3328 || height == 3468) ) + if ( (height < 4000 && (opretlen == 39 || opretlen == 141 || opretlen == 107 || opretlen == 48897 || opretlen == 9474)) || (height <= 2200 || height == 3282 || height == 3328 || height == 3468) ) return(0); } } From 717dfab69b9c37b04d94c09d720c5776e5e3af39 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 20:48:14 +0200 Subject: [PATCH 062/258] Test --- src/komodo_gateway.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index e3525c4bb34..cb5ce368636 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -106,8 +106,8 @@ void komodo_paxdelete(struct pax_transaction *pax) void komodo_gateway_deposit(char *coinaddr,uint64_t value,char *symbol,uint64_t fiatoshis,uint8_t *rmd160,uint256 txid,uint16_t vout,uint8_t type,int32_t height,int32_t otherheight,char *source,int32_t approved) // assetchain context { struct pax_transaction *pax; uint8_t buf[35]; int32_t addflag = 0; struct komodo_state *sp; char str[16],dest[16],*s; - if ( KOMODO_PAX == 0 ) - return; + //if ( KOMODO_PAX == 0 ) + // return; sp = komodo_stateptr(str,dest); pthread_mutex_lock(&komodo_mutex); pax_keyset(buf,txid,vout,type); @@ -196,8 +196,8 @@ int32_t komodo_rwapproval(int32_t rwflag,uint8_t *opretbuf,struct pax_transactio int32_t komodo_issued_opreturn(char *base,uint256 *txids,uint16_t *vouts,int64_t *values,int64_t *srcvalues,int32_t *kmdheights,int32_t *otherheights,int8_t *baseids,uint8_t *rmd160s,uint8_t *opretbuf,int32_t opretlen,int32_t iskomodo) { struct pax_transaction p,*pax; int32_t i,n=0,j,len=0,incr,height,otherheight; uint8_t type,rmd160[20]; uint64_t fiatoshis; char symbol[16]; - if ( KOMODO_PAX == 0 ) - return(0); + //if ( KOMODO_PAX == 0 ) + // return(0); incr = 34 + (iskomodo * (2*sizeof(fiatoshis) + 2*sizeof(height) + 20 + 4)); //41e77b91cb68dc2aa02fa88550eae6b6d44db676a7e935337b6d1392d9718f03cb0200305c90660400000000fbcbeb1f000000bde801006201000058e7945ad08ddba1eac9c9b6c8e1e97e8016a2d152 @@ -289,7 +289,7 @@ int32_t komodo_paxcmp(char *symbol,int32_t kmdheight,uint64_t value,uint64_t che uint64_t komodo_paxtotal() { struct pax_transaction *pax,*pax2,*tmp,*tmp2; char symbol[16],dest[16],*str; int32_t i,ht; int64_t checktoshis; uint64_t seed,total = 0; struct komodo_state *basesp; - if ( KOMODO_PAX == 0 || KOMODO_PASSPORT_INITDONE == 0 ) + if ( KOMODO_PASSPORT_INITDONE == 0 ) //KOMODO_PAX == 0 || return(0); if ( komodo_isrealtime(&ht) == 0 ) return(0); @@ -463,7 +463,7 @@ int32_t komodo_pending_withdraws(char *opretstr) // todo: enforce deterministic int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t tokomodo) { struct pax_transaction *pax,*tmp; char symbol[16],dest[16]; uint8_t *script,opcode,opret[16384],data[16384]; int32_t i,baseid,ht,len=0,opretlen=0,numvouts=1; struct komodo_state *sp; uint64_t available,deposited,issued,withdrawn,approved,redeemed,mask; - if ( KOMODO_PAX == 0 || KOMODO_PASSPORT_INITDONE == 0 ) + if ( KOMODO_PASSPORT_INITDONE == 0 )//KOMODO_PAX == 0 || return(0); struct komodo_state *kmdsp = komodo_stateptrget((char *)"KMD"); sp = komodo_stateptr(symbol,dest); @@ -1198,11 +1198,11 @@ void komodo_passport_iteration() return; } } - if ( KOMODO_PAX == 0 ) + /*if ( KOMODO_PAX == 0 ) { KOMODO_PASSPORT_INITDONE = 1; return; - } + }*/ starttime = (uint32_t)time(NULL); //printf("PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,refid); for (baseid=32; baseid>=0; baseid--) From 147b3b5ab7a62ce9f6a98102e1fc85f5c2bf140f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 20:49:35 +0200 Subject: [PATCH 063/258] test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index cb5ce368636..222455271de 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -738,7 +738,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 if ( baseid == USD ) { - if ( (height < 4000 && (opretlen == 39 || opretlen == 141 || opretlen == 107 || opretlen == 48897 || opretlen == 9474)) || (height <= 2200 || height == 3282 || height == 3328 || height == 3468) ) + if ( baseid == USD && (height <= 2000 || height == 3282 || height == 3328 || height == 3468) ) return(0); } } From a934c10f6329d1dd0bf1440fae71c8a1529e9dc4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 20:56:21 +0200 Subject: [PATCH 064/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 222455271de..0a8d1cc54bd 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -773,7 +773,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above { } if ( strcmp(ASSETCHAINS_SYMBOL,CURRENCIES[baseids[i-1]]) == 0 ) - printf("check deposit validates %s %.8f -> %.8f\n",CURRENCIES[baseids[i]],dstr(srcvalues[i]),dstr(values[i])); + printf("check deposit validates %s %.8f -> %.8f (%.8f %.8f %.8f)\n",CURRENCIES[baseids[i-1]],dstr(srcvalues[i-1]),dstr(values[i-1]),dstr(pax->komodoshis),dstr(pax->fiatoshis),dstr(block.vtx[0].vout[i].nValue)); } else { From b028bc480661459d39d0b23ef41dc07f8e4d4989 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 21:00:58 +0200 Subject: [PATCH 065/258] Test --- src/komodo_gateway.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 0a8d1cc54bd..7cdbacc5cce 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -728,17 +728,10 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); } while ( KOMODO_PASSPORT_INITDONE == 0 ) - { komodo_passport_iteration(); - //sleep(3); - } - if ( KOMODO_PASSPORT_INITDONE == 0 ) // komodo_isrealtime(&ht) == 0 || init time already in DB - return(0); - // f9510bbd58f90ea133653005a6e3087779fd838317518ba63cce2b0fc381dff6 1337 - // 7b6e26d9ffbb7cc1b71185c38906b71632324d1c9df3a2596d09e1353a714c27 1338 if ( baseid == USD ) { - if ( baseid == USD && (height <= 2000 || height == 3282 || height == 3328 || height == 3468) ) + if ( baseid == USD && height <= 2000 )// || height == 3282 || height == 3328 || height == 3468) ) return(0); } } @@ -1225,7 +1218,7 @@ void komodo_passport_iteration() fseek(fp,0,SEEK_END); if ( ftell(fp) > lastpos[baseid] ) { - if ( strcmp(symbol,"KMD") != 0 ) + if ( ASSETCHAINS_SYMBOL[0] != 0 ) printf("%s passport refid.%d %s fname.(%s) base.%s %ld %ld\n",ASSETCHAINS_SYMBOL,refid,symbol,fname,base,ftell(fp),lastpos[baseid]); fseek(fp,lastpos[baseid],SEEK_SET); while ( komodo_parsestatefile(sp,fp,symbol,dest) >= 0 && n < 1000 ) From 1bf41050b891fb5b16628833b856eed580cbf10c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 21:09:50 +0200 Subject: [PATCH 066/258] Test --- src/komodo_gateway.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 7cdbacc5cce..3ee5edf569b 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -462,7 +462,7 @@ int32_t komodo_pending_withdraws(char *opretstr) // todo: enforce deterministic int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t tokomodo) { - struct pax_transaction *pax,*tmp; char symbol[16],dest[16]; uint8_t *script,opcode,opret[16384],data[16384]; int32_t i,baseid,ht,len=0,opretlen=0,numvouts=1; struct komodo_state *sp; uint64_t available,deposited,issued,withdrawn,approved,redeemed,mask; + struct pax_transaction *pax,*tmp; char symbol[16],dest[16]; uint8_t *script,opcode,opret[16384],data[16384]; int32_t i,baseid,ht,len=0,opretlen=0,numvouts=1; struct komodo_state *sp; uint64_t available,deposited,issued,withdrawn,approved,redeemed,mask,sum = 0; if ( KOMODO_PASSPORT_INITDONE == 0 )//KOMODO_PAX == 0 || return(0); struct komodo_state *kmdsp = komodo_stateptrget((char *)"KMD"); @@ -552,6 +552,12 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to //printf("redeem.%d? (%c) %p pax.%s marked.%d %.8f -> %.8f ready.%d validated.%d approved.%d\n",tokomodo,pax->type,pax,pax->symbol,pax->marked,dstr(pax->komodoshis),dstr(pax->fiatoshis),pax->ready!=0,pax->validated!=0,pax->approved!=0); if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) printf("pax.%s marked.%d %.8f -> %.8f\n",ASSETCHAINS_SYMBOL,pax->marked,dstr(pax->komodoshis),dstr(pax->fiatoshis)); + if ( opcode == 'I' ) + { + sum += pax->fiatoshis; + if ( sum > available ) + break; + } txNew->vout.resize(numvouts+1); txNew->vout[numvouts].nValue = (opcode == 'I') ? pax->fiatoshis : pax->komodoshis; txNew->vout[numvouts].scriptPubKey.resize(25); @@ -731,7 +737,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above komodo_passport_iteration(); if ( baseid == USD ) { - if ( baseid == USD && height <= 2000 )// || height == 3282 || height == 3328 || height == 3468) ) + if ( baseid == USD && (height <= 2000 || height == 3282 || height == 3328 || height == 3468) ) return(0); } } From 9676fe6738ddbd32be74738c6ab98b15866895a4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Mar 2017 21:13:33 +0200 Subject: [PATCH 067/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 3ee5edf569b..dc49b6525a6 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -737,7 +737,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above komodo_passport_iteration(); if ( baseid == USD ) { - if ( baseid == USD && (height <= 2000 || height == 3282 || height == 3328 || height == 3468) ) + if ( baseid == USD && (height <= 2000 || height == 3275 || height == 3282 || height == 3328 || height == 3468) ) return(0); } } From 9d3344657ac15044119889a702e73c7482c05538 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 03:22:50 +0200 Subject: [PATCH 068/258] Test --- src/komodo_gateway.h | 159 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 157 insertions(+), 2 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index dc49b6525a6..a7d1eacbafe 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -737,9 +737,164 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above komodo_passport_iteration(); if ( baseid == USD ) { - if ( baseid == USD && (height <= 2000 || height == 3275 || height == 3282 || height == 3328 || height == 3468) ) + if ( height <= 2000 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) return(0); } + else if ( baseid == EUR ) + { + if ( height == 1313 ) + return(0); + } + else if ( baseid == JPY ) + { + if ( height == 1014 ) + return(0); + } + else if ( baseid == GBP ) + { + if ( height == 997 ) + return(0); + } + else if ( baseid == AUD ) + { + if ( height == 985 ) + return(0); + } + else if ( baseid == CAD ) + { + if ( height == 1181 ) + return(0); + } + else if ( baseid == CHF ) + { + if ( height == 960 ) + return(0); + } + else if ( baseid == NZD ) + { + if ( height == 1113 ) + return(0); + } + else if ( baseid == CNY ) + { + if ( height == 982 ) + return(0); + } + else if ( baseid == RUB ) + { + if ( height == 1074 ) + return(0); + } + else if ( baseid == MXN ) + { + if ( height == 1069 ) + return(0); + } + else if ( baseid == BRL ) + { + if ( height == 972 ) + return(0); + } + else if ( baseid == INR ) + { + if ( height == 788 ) + return(0); + } + else if ( baseid == PLN ) + { + if ( height == 1009 ) + return(0); + } + else if ( baseid == HKD ) + { + if ( height == 1002 ) + return(0); + } + else if ( baseid == TRY ) + { + if ( height == 991 ) + return(0); + } + else if ( baseid == NOK ) + { + if ( height == 962 ) + return(0); + } + else if ( baseid == ZAR ) + { + if ( height == 956 ) + return(0); + } + else if ( baseid == SEK ) + { + if ( height == 943 ) + return(0); + } + else if ( baseid == CZK ) + { + if ( height == 1079 ) + return(0); + } + else if ( baseid == HUF ) + { + if ( height == 2378 ) + return(0); + } + else if ( baseid == DKK ) + { + if ( height == 1214 ) + return(0); + } + else if ( baseid == ILS ) + { + if ( height == 1010 ) + return(0); + } + else if ( baseid == MYR ) + { + if ( height == 1015 ) + return(0); + } + else if ( baseid == PHP ) + { + if ( height == 1154 ) + return(0); + } + else if ( baseid == KRW ) + { + if ( height == 1010 ) + return(0); + } + else if ( baseid == RON ) + { + if ( height == 1003 ) + return(0); + } + else if ( baseid == SGD ) + { + if ( height == 1010 ) + return(0); + } + else if ( baseid == THB ) + { + if ( height == 968 ) + return(0); + } + else if ( baseid == BGN ) + { + if ( height == 1030 ) + return(0); + } + else if ( baseid == HRK ) + { + if ( height == 1022 ) + return(0); + } + else if ( baseid == IDR ) + { + if ( height == 720 ) + return(0); + } } if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) { @@ -1258,7 +1413,7 @@ void komodo_passport_iteration() isrealtime = 1; RTmask |= (1LL << baseid); memcpy(refsp->RTbufs[baseid+1],buf,sizeof(refsp->RTbufs[baseid+1])); - } else if ( (time(NULL)-buf[2]) > 1800 && ASSETCHAINS_SYMBOL[0] != 0 ) + } else if ( KOMODO_PAX != 0 && (time(NULL)-buf[2]) > 1800 && ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"[%s]: %s not RT %u %u %d\n",ASSETCHAINS_SYMBOL,base,buf[0],buf[1],(int32_t)(time(NULL)-buf[2])); } //else fprintf(stderr,"%s size error RT\n",base); fclose(fp); From dd39b6bf8a82f6543b8f4c526ba3bc559471dcbd Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 03:36:45 +0200 Subject: [PATCH 069/258] Test --- src/komodo_pax.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/komodo_pax.h b/src/komodo_pax.h index 5662c2f9976..ed5b4843684 100644 --- a/src/komodo_pax.h +++ b/src/komodo_pax.h @@ -14,6 +14,40 @@ ******************************************************************************/ #define USD 0 +#define EUR 1 +#define JPY 2 +#define GBP 3 +#define AUD 4 +#define CAD 5 +#define CHF 6 +#define NZD 7 + +#define CNY 8 +#define RUB 9 +#define MXN 10 +#define BRL 11 +#define INR 12 +#define HKD 13 +#define TRY 14 +#define ZAR 15 + +#define PLN 16 +#define NOK 17 +#define SEK 18 +#define DKK 19 +#define CZK 20 +#define HUF 21 +#define ILS 22 +#define KRW 23 + +#define MYR 24 +#define PHP 25 +#define RON 26 +#define SGD 27 +#define THB 28 +#define BGN 29 +#define IDR 30 +#define HRK 31 #define MAX_CURRENCIES 32 extern char CURRENCIES[][8]; From 0e0c816c828b343dbd14d38e451c2d2c9f1c3940 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 03:56:17 +0200 Subject: [PATCH 070/258] Test --- src/komodo_gateway.h | 67 ++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index a7d1eacbafe..b38e67f29eb 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -735,6 +735,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } while ( KOMODO_PASSPORT_INITDONE == 0 ) komodo_passport_iteration(); + // grandfathering preexisting if ( baseid == USD ) { if ( height <= 2000 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) @@ -742,157 +743,157 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 ) + if ( height == 1313 || height == 1288 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 ) + if ( height == 1014 || height == 998 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 ) + if ( height == 997 || height == 970 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 ) + if ( height == 985 || height == 958 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 ) + if ( height == 1181 || height == 1179 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 ) + if ( height == 960 || height == 931 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 ) + if ( height == 1113 || height == 1083 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 ) + if ( height == 982 || height == 957 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 ) + if ( height == 1074 || height == 1040 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 ) + if ( height == 1069 || height == 1048 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 ) + if ( height == 972 || height == 943 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 ) + if ( height == 788 || height == 786 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 ) + if ( height == 1009 || height == 984 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 ) + if ( height == 1002 || height == 979 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 ) + if ( height == 991 || height == 974 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 ) + if ( height == 962 || height == 911 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 ) + if ( height == 956 || height == 937 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 ) + if ( height == 943 || height == 925 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 ) + if ( height == 1079 || height == 1054 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 ) + if ( height == 2378 || height == 2376 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 ) + if ( height == 1214 || height == 1186 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 ) + if ( height == 1010 || height == 985 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 ) + if ( height == 1015 || height == 984 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 ) + if ( height == 1154 || height == 1114 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 ) + if ( height == 1010 || height == 950 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 ) + if ( height == 1003 || height == 973 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 ) + if ( height == 1010 || height == 984 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 ) + if ( height == 968 || height == 933 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 ) + if ( height == 1030 || height == 995 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 ) + if ( height == 1022 || height == 999 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 ) + if ( height == 720 || height == 715 ) return(0); } } @@ -913,7 +914,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above pax->type = opcode; if ( opcode == 'I' && (pax_fiatstatus(&available,&deposited,&issued,&withdrawn,&approved,&redeemed,symbol) != 0 || available < pax->fiatoshis) ) { - printf("checkdeposit.[%s]: skip %s %.8f when avail %.8f deposited %.8f, issued %.8f withdrawn %.8f approved %.8f redeemed %.8f\n",ASSETCHAINS_SYMBOL,symbol,dstr(pax->fiatoshis),dstr(available),dstr(deposited),dstr(issued),dstr(withdrawn),dstr(approved),dstr(redeemed)); + printf("checkdeposit.[%s.%d]: skip %s %.8f when avail %.8f deposited %.8f, issued %.8f withdrawn %.8f approved %.8f redeemed %.8f\n",ASSETCHAINS_SYMBOL,height,symbol,dstr(pax->fiatoshis),dstr(available),dstr(deposited),dstr(issued),dstr(withdrawn),dstr(approved),dstr(redeemed)); return(-1); } if ( pax->fiatoshis == block.vtx[0].vout[i].nValue ) @@ -927,7 +928,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above { } if ( strcmp(ASSETCHAINS_SYMBOL,CURRENCIES[baseids[i-1]]) == 0 ) - printf("check deposit validates %s %.8f -> %.8f (%.8f %.8f %.8f)\n",CURRENCIES[baseids[i-1]],dstr(srcvalues[i-1]),dstr(values[i-1]),dstr(pax->komodoshis),dstr(pax->fiatoshis),dstr(block.vtx[0].vout[i].nValue)); + printf("check deposit validates %s.%d %.8f -> %.8f (%.8f %.8f %.8f)\n",CURRENCIES[baseids[i-1]],height,dstr(srcvalues[i-1]),dstr(values[i-1]),dstr(pax->komodoshis),dstr(pax->fiatoshis),dstr(block.vtx[0].vout[i].nValue)); } else { From 3788126ce4a00de345fbbe693f1d63faad6ab9eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 03:57:16 +0200 Subject: [PATCH 071/258] 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 b38e67f29eb..3b99f7deeca 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -994,7 +994,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above printf(" script.[%d] ",opretlen); for (i=0; i Date: Mon, 20 Mar 2017 04:10:33 +0200 Subject: [PATCH 072/258] Test --- src/komodo_gateway.h | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 3b99f7deeca..9ac4bf8abdb 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -743,157 +743,157 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 ) + if ( height == 1313 || height == 1288 || height == 1263 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 ) + if ( height == 1014 || height == 998 || height == 973 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 ) + if ( height == 997 || height == 970 || height == 953 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 ) + if ( height == 985 || height == 958 || height == 936 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 ) + if ( height == 1181 || height == 1179 || height == 1159 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 ) + if ( height == 960 || height == 931 || height == 914 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 ) + if ( height == 1113 || height == 1083 || height == 1067 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 ) + if ( height == 982 || height == 957 || height == 931 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 ) + if ( height == 1074 || height == 1040 || height == 1014 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 ) + if ( height == 1069 || height == 1048 || height == 1028 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 ) + if ( height == 972 || height == 943 || height == 922 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 ) + if ( height == 788 || height == 786 || height == 775 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 ) + if ( height == 1009 || height == 984 || height == 960 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 ) + if ( height == 1002 || height == 979 || height == 947 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 ) + if ( height == 991 || height == 974 || height == 949 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 ) + if ( height == 962 || height == 911 || height == 907 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 ) + if ( height == 956 || height == 937 || height == 906 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 ) + if ( height == 943 || height == 925 || height == 896 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 ) + if ( height == 1079 || height == 1054 || height == 1032 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 ) + if ( height == 2378 || height == 2376 || height == 2371 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 ) + if ( height == 1214 || height == 1186 || height == 1158 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 ) + if ( height == 1010 || height == 985 || height == 954 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 ) + if ( height == 1015 || height == 984 || height == 950 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 ) + if ( height == 1154 || height == 1114 || height == 1077 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 ) + if ( height == 1010 || height == 950 || height == 916 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 ) + if ( height == 1003 || height == 973 || height == 940 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 ) + if ( height == 1010 || height == 984 || height == 951 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 ) + if ( height == 968 || height == 933 || height == 898 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 ) + if ( height == 1030 || height == 995 || height == 960 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 ) + if ( height == 1022 || height == 999 || height == 969 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 ) + if ( height == 720 || height == 715 || height == 714 ) return(0); } } From f81f60753acbe1d11e2277125aa598e88d7d311d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 04:17:17 +0200 Subject: [PATCH 073/258] Test --- src/komodo_gateway.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 9ac4bf8abdb..273918c96b1 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -736,19 +736,19 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above while ( KOMODO_PASSPORT_INITDONE == 0 ) komodo_passport_iteration(); // grandfathering preexisting - if ( baseid == USD ) + if ( baseid == USD ) // 6820 in balance calcs { if ( height <= 2000 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) return(0); } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 ) return(0); } else if ( baseid == GBP ) @@ -768,32 +768,32 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 ) return(0); } else if ( baseid == INR ) @@ -808,17 +808,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 ) return(0); } else if ( baseid == ZAR ) @@ -828,27 +828,27 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 ) return(0); } else if ( baseid == MYR ) @@ -863,7 +863,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 ) return(0); } else if ( baseid == RON ) From 677e62a55dfd4f04da280ec0dfe4f0427477c011 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 04:25:18 +0200 Subject: [PATCH 074/258] Test --- src/komodo_gateway.h | 58 ++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 273918c96b1..9ca746c236c 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -753,147 +753,147 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 ) return(0); } } From d4bd92c09611d04aba244fa7dc67d120adab3aed Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 04:28:46 +0200 Subject: [PATCH 075/258] 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 9ca746c236c..24715ad63b5 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -743,12 +743,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 ) return(0); } else if ( baseid == GBP ) @@ -768,7 +768,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 ) return(0); } else if ( baseid == NZD ) @@ -778,7 +778,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 ) return(0); } else if ( baseid == RUB ) From a3dea9b624262cb86cd10a7bf8608106c41abb8e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 04:32:10 +0200 Subject: [PATCH 076/258] Test --- src/komodo_gateway.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 24715ad63b5..a507b9b2912 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -788,12 +788,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 ) return(0); } else if ( baseid == INR ) @@ -808,7 +808,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 ) return(0); } else if ( baseid == TRY ) @@ -818,12 +818,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 ) return(0); } else if ( baseid == SEK ) @@ -833,22 +833,22 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 ) return(0); } else if ( baseid == MYR ) @@ -863,7 +863,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 ) return(0); } else if ( baseid == RON ) From 1bd51c5c553c6cc17ab505cf66c4e9fd13758e58 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 04:40:47 +0200 Subject: [PATCH 077/258] Test --- src/komodo_gateway.h | 58 ++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index a507b9b2912..c7ba57f0411 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,52 +748,52 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 ) return(0); } else if ( baseid == INR ) @@ -803,97 +803,97 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 ) return(0); } } From 5eaffe7531766926ff497ab336e8b86621c15297 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 04:53:26 +0200 Subject: [PATCH 078/258] Test --- src/komodo_gateway.h | 66 +++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index c7ba57f0411..59a1392b658 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,52 +748,52 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 ) return(0); } else if ( baseid == INR ) @@ -803,97 +803,97 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 ) return(0); } } @@ -970,7 +970,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else { - int64_t val,prevtotal = 0; int32_t overflow = 0; + /*int64_t val,prevtotal = 0; int32_t overflow = 0; total = 0; for (i=1; i Date: Mon, 20 Mar 2017 05:11:14 +0200 Subject: [PATCH 079/258] Test --- src/komodo_gateway.h | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 59a1392b658..7dc91670600 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -743,57 +743,57 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 ) return(0); } else if ( baseid == INR ) @@ -803,97 +803,97 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 ) return(0); } } From 1f3e35759af9f2d310d19837d2f2b0d411647ae9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 05:13:38 +0200 Subject: [PATCH 080/258] Test --- src/komodo_gateway.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 7dc91670600..55629fa3647 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -808,7 +808,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 ) return(0); } else if ( baseid == TRY ) @@ -818,7 +818,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 ) return(0); } else if ( baseid == ZAR ) @@ -833,7 +833,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 ) return(0); } else if ( baseid == HUF ) @@ -843,12 +843,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 ) return(0); } else if ( baseid == MYR ) @@ -863,7 +863,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 ) return(0); } else if ( baseid == RON ) @@ -893,7 +893,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 ) return(0); } } From 7461783c28240a235a1034a5ef9c2754dc79097d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 05:25:19 +0200 Subject: [PATCH 081/258] Test --- src/komodo_gateway.h | 56 ++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 55629fa3647..b2c2d5d0320 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,17 +748,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 ) return(0); } else if ( baseid == CAD ) @@ -768,32 +768,32 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 ) return(0); } else if ( baseid == INR ) @@ -803,97 +803,97 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 ) return(0); } } From 5588104d291460bdeff18d656f8bf400edd9a270 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 05:30:46 +0200 Subject: [PATCH 082/258] Tests --- src/komodo_gateway.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index b2c2d5d0320..c7fbb7fff3c 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,12 +748,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 ) return(0); } else if ( baseid == AUD ) @@ -763,12 +763,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 ) return(0); } else if ( baseid == NZD ) @@ -778,7 +778,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 ) return(0); } else if ( baseid == RUB ) @@ -788,12 +788,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 ) return(0); } else if ( baseid == INR ) @@ -808,7 +808,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 ) return(0); } else if ( baseid == TRY ) @@ -833,7 +833,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 ) return(0); } else if ( baseid == HUF ) @@ -848,7 +848,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 ) return(0); } else if ( baseid == MYR ) @@ -863,7 +863,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 ) return(0); } else if ( baseid == RON ) @@ -873,7 +873,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 ) return(0); } else if ( baseid == THB ) @@ -893,7 +893,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 ) return(0); } } From 048846d71173cf75aa1d985da7988f787ab68df4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 05:41:10 +0200 Subject: [PATCH 083/258] Test --- src/komodo_gateway.h | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index c7fbb7fff3c..859642f2883 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -768,17 +768,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 ) return(0); } else if ( baseid == RUB ) @@ -788,12 +788,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 ) return(0); } else if ( baseid == INR ) @@ -803,17 +803,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 ) return(0); } else if ( baseid == NOK ) @@ -823,77 +823,77 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 ) return(0); } } @@ -928,7 +928,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above { } if ( strcmp(ASSETCHAINS_SYMBOL,CURRENCIES[baseids[i-1]]) == 0 ) - printf("check deposit validates %s.%d %.8f -> %.8f (%.8f %.8f %.8f)\n",CURRENCIES[baseids[i-1]],height,dstr(srcvalues[i-1]),dstr(values[i-1]),dstr(pax->komodoshis),dstr(pax->fiatoshis),dstr(block.vtx[0].vout[i].nValue)); + printf("check deposit validates %s.%d [%d] %.8f -> %.8f (%.8f %.8f %.8f)\n",CURRENCIES[baseids[i-1]],height,i,dstr(srcvalues[i-1]),dstr(values[i-1]),dstr(pax->komodoshis),dstr(pax->fiatoshis),dstr(block.vtx[0].vout[i].nValue)); } else { From 70dd0b29a7aa0ce9a92aed79ca9ac921fef296cc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 05:46:24 +0200 Subject: [PATCH 084/258] Test --- src/komodo_gateway.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 859642f2883..c049b8f7529 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -743,17 +743,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 ) return(0); } else if ( baseid == AUD ) @@ -763,7 +763,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 ) return(0); } else if ( baseid == CHF ) @@ -788,12 +788,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 ) return(0); } else if ( baseid == INR ) @@ -808,7 +808,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 ) return(0); } else if ( baseid == TRY ) @@ -833,7 +833,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 ) return(0); } else if ( baseid == HUF ) @@ -853,7 +853,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 ) return(0); } else if ( baseid == PHP ) @@ -873,7 +873,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 ) return(0); } else if ( baseid == THB ) @@ -893,7 +893,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 ) return(0); } } From ce69a5f2c3d1aab158bd230028b9c8a9d5134c9f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 05:56:53 +0200 Subject: [PATCH 085/258] Test --- src/assetchains | 64 ++++++++++++++++++++++---------------------- src/bitcoind.cpp | 1 - src/komodo_gateway.h | 36 ++++++++++++------------- 3 files changed, 50 insertions(+), 51 deletions(-) diff --git a/src/assetchains b/src/assetchains index 1135f4ce804..09edf404ad4 100755 --- a/src/assetchains +++ b/src/assetchains @@ -19,68 +19,68 @@ echo $pubkey ./komodod -pubkey=$pubkey -ac_name=KV -ac_supply=1000000 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=CEAL -ac_supply=366666666 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=MESH -ac_supply=1000000 -addnode=78.47.196.146 $1 & -sleep 10 +sleep 20 ./komodod -pubkey=$pubkey -ac_name=USD -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=EUR -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=JPY -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=GBP -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=AUD -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=CAD -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=CHF -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=NZD -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=CNY -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=RUB -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=MXN -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=BRL -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=INR -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=HKD -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=TRY -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=ZAR -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=PLN -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=NOK -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=SEK -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=DKK -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=CZK -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=HUF -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=ILS -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=KRW -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=MYR -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=PHP -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=RON -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=SGD -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=THB -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=BGN -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=IDR -addnode=78.47.196.146 $1 & -sleep 10 +sleep 30 ./komodod -pubkey=$pubkey -ac_name=HRK -addnode=78.47.196.146 $1 & diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 90dcde868e0..00ca0c3a474 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -192,7 +192,6 @@ bool AppInit(int argc, char* argv[]) } catch (...) { PrintExceptionContinue(NULL, "AppInit()"); } - fprintf(stderr,"fRet.%d\n",(int32_t)fRet); if (!fRet) { threadGroup.interrupt_all(); diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index c049b8f7529..fa1d54f9863 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -768,17 +768,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 ) return(0); } else if ( baseid == RUB ) @@ -788,12 +788,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 ) return(0); } else if ( baseid == INR ) @@ -803,7 +803,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 ) return(0); } else if ( baseid == HKD ) @@ -813,7 +813,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 ) return(0); } else if ( baseid == NOK ) @@ -823,27 +823,27 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 ) return(0); } else if ( baseid == ILS ) @@ -853,7 +853,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 ) return(0); } else if ( baseid == PHP ) @@ -863,12 +863,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 ) return(0); } else if ( baseid == SGD ) @@ -883,17 +883,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 ) return(0); } } From 713e84f77830c3295b0df2baa6be485ac35d2f15 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 06:02:37 +0200 Subject: [PATCH 086/258] Test --- src/komodo_gateway.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index fa1d54f9863..7589c6dbcda 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,12 +748,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 ) return(0); } else if ( baseid == AUD ) @@ -763,7 +763,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 ) return(0); } else if ( baseid == CHF ) @@ -788,27 +788,27 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 ) return(0); } else if ( baseid == TRY ) @@ -833,7 +833,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 ) return(0); } else if ( baseid == HUF ) @@ -853,7 +853,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 ) return(0); } else if ( baseid == PHP ) @@ -873,7 +873,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 ) return(0); } else if ( baseid == THB ) @@ -893,7 +893,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 ) return(0); } } From 25930dc3435ee3cfd09512b16ccacd2893496a35 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 06:23:27 +0200 Subject: [PATCH 087/258] Test --- src/komodo_gateway.h | 45 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 7589c6dbcda..005793562f8 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -743,17 +743,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 ) return(0); } else if ( baseid == AUD ) @@ -763,47 +763,47 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 ) return(0); } else if ( baseid == HKD ) @@ -813,47 +813,47 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 ) return(0); } else if ( baseid == PHP ) @@ -893,7 +893,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 ) return(0); } } @@ -1010,6 +1010,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above printf("%02x",script[i]); printf(" height.%d checkdeposit n.%d [%02x] [%c] %d len.%d ",height,n,script[0],script[offset],script[offset],opretlen); printf("not proper vout with opreturn format %s ht.%d\n",ASSETCHAINS_SYMBOL,height); +exit(-1); return(-1); } return(0); From ca8433f7e3b8b970f365a41cf8972f91d37ed929 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 06:24:39 +0200 Subject: [PATCH 088/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 005793562f8..708ce42c4c4 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -853,7 +853,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 ) return(0); } else if ( baseid == PHP ) From 8f374671f71fd001aeb3be857712d9c628e7defb Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 06:26:09 +0200 Subject: [PATCH 089/258] 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 708ce42c4c4..b109856f9ef 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -873,7 +873,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 ) return(0); } else if ( baseid == THB ) @@ -883,17 +883,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 ) return(0); } } From 8a9f9356e627159aae6979f6a34be3e429b5613b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 16:04:37 +0200 Subject: [PATCH 090/258] Test --- src/komodo_gateway.h | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index b109856f9ef..75032417256 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -743,157 +743,157 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 ) return(0); } } From 4d8a1fe892ff500631a0bcb4671f3fc2d8db25e0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 17:33:15 +0200 Subject: [PATCH 091/258] Test --- src/komodo_gateway.h | 52 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 75032417256..8c601e8f0a8 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -743,12 +743,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 ) return(0); } else if ( baseid == GBP ) @@ -763,47 +763,47 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 ) return(0); } else if ( baseid == HKD ) @@ -818,42 +818,42 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 ) return(0); } else if ( baseid == PHP ) @@ -863,37 +863,37 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 ) return(0); } } From b5d9bbba497a964ede3fe03527b107788027187d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 17:34:59 +0200 Subject: [PATCH 092/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 8c601e8f0a8..430221504b3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -893,7 +893,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 ) return(0); } } From e98ac90935e47b291afb9fc9f350ac1fdbc92531 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 19:48:58 +0200 Subject: [PATCH 093/258] Test --- src/komodo_gateway.h | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 430221504b3..a71d50416b2 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -743,157 +743,157 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 ) return(0); } } From 120093ea41fb573214d24f6dbb843df10f3c6927 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 20:32:52 +0200 Subject: [PATCH 094/258] Test --- src/komodo_gateway.h | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index a71d50416b2..a254c24ade5 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -743,157 +743,157 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 ) return(0); } } From d9d08bc4389c258300ff6c85c14bece3bc5e2632 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 20:58:27 +0200 Subject: [PATCH 095/258] Test --- src/komodo_gateway.h | 60 +++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index a254c24ade5..4dbaa4333b5 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -743,107 +743,107 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 ) return(0); } else if ( baseid == ILS ) @@ -853,22 +853,22 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 ) return(0); } else if ( baseid == SGD ) @@ -888,12 +888,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 ) return(0); } } @@ -1337,7 +1337,8 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 void komodo_passport_iteration() { - static long lastpos[34]; static char userpass[33][1024]; int32_t maxseconds = 10; + static long lastpos[34]; static char userpass[33][1024]; static uint32_t lasttime; + int32_t maxseconds = 10; FILE *fp; int32_t baseid,n,ht,isrealtime,expired,refid,blocks,longest; struct komodo_state *sp,*refsp; char *retstr,fname[512],*base,symbol[16],dest[16]; uint32_t buf[3],starttime; cJSON *infoobj,*result; uint64_t RTmask = 0; //printf("PASSPORT.(%s)\n",ASSETCHAINS_SYMBOL); expired = 0; @@ -1364,6 +1365,9 @@ void komodo_passport_iteration() return; }*/ starttime = (uint32_t)time(NULL); + if ( starttime == lasttime ) + return; + lasttime = starttime; //printf("PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,refid); for (baseid=32; baseid>=0; baseid--) { From 9ee6ccb43f6a99dc882520f0735aadc10f4cbd32 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 20:59:19 +0200 Subject: [PATCH 096/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 4dbaa4333b5..81eaa2338e8 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -893,7 +893,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 ) return(0); } } From 7f6ddefd124571f7ca2d95fcad3ff48f00785f86 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 21:25:19 +0200 Subject: [PATCH 097/258] Test --- src/bitcoind.cpp | 4 +-- src/komodo_gateway.h | 82 ++++++++++++++++++++++++-------------------- 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 00ca0c3a474..bb98da3d653 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -44,9 +44,9 @@ void WaitForShutdown(boost::thread_group* threadGroup) //fprintf(stderr,"call passport iteration\n"); if ( ASSETCHAINS_SYMBOL[0] == 0 ) { - MilliSleep(10000); komodo_passport_iteration(); - } + MilliSleep(10000); + } else MilliSleep(1000); fShutdown = ShutdownRequested(); } if (threadGroup) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 81eaa2338e8..dd74edf2c65 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -653,17 +653,20 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above memset(kmdheights,0,sizeof(kmdheights)); memset(otherheights,0,sizeof(otherheights)); txn_count = block.vtx.size(); - for (i=0; i=0; baseid--) From e8b7db1a8259f6342b2bf45bb38cd0716d2ba4b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 21:45:27 +0200 Subject: [PATCH 098/258] Test --- src/komodo.h | 8 +++---- src/komodo_gateway.h | 56 ++++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index d1a48eccceb..7bb7cb114f0 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -545,7 +545,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) printf("%s ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d <<<<<<<<<<< notarized\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts); notarized = 1; } - if ( NOTARY_PUBKEY33[0] != 0 ) + if ( NOTARY_PUBKEY33[0] != 0 && ASSETCHAINS_SYMBOL[0] == 0 ) printf("(tx.%d: ",i); for (j=0; j= sizeof(uint32_t) && len <= sizeof(scriptbuf) ) @@ -582,7 +582,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) } } } - if ( NOTARY_PUBKEY33[0] != 0 ) + if ( NOTARY_PUBKEY33[0] != 0 && ASSETCHAINS_SYMBOL[0] == 0 ) printf(") "); //printf("%s ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d notarized.%d special.%d isratification.%d\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts,notarized,specialtx,isratification); if ( notarized != 0 && (notarizedheight != 0 || specialtx != 0) ) @@ -624,7 +624,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) } } } - if ( NOTARY_PUBKEY33[0] != 0 ) + if ( NOTARY_PUBKEY33[0] != 0 && ASSETCHAINS_SYMBOL[0] == 0 ) printf("%s ht.%d\n",ASSETCHAINS_SYMBOL[0] == 0 ? "KMD" : ASSETCHAINS_SYMBOL,height); if ( pindex->nHeight == hwmheight ) komodo_stateupdate(height,0,0,0,zero,0,0,0,0,height,(uint32_t)pindex->nTime,0,0,0,0); diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index dd74edf2c65..e51050bde4e 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -746,132 +746,132 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 ) return(0); } else if ( baseid == SGD ) @@ -881,7 +881,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 ) return(0); } else if ( baseid == BGN ) @@ -891,7 +891,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 ) return(0); } else if ( baseid == IDR ) From aaef96b3a8dd9c8264f79c7634e639b76151410e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 22:07:10 +0200 Subject: [PATCH 099/258] Test --- src/komodo_gateway.h | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index e51050bde4e..51db9c0ed71 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -746,157 +746,157 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 || height == 200 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 ) return(0); } } From 0ef85dd07bea556573b5e9a5a729f680c339268a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 22:26:26 +0200 Subject: [PATCH 100/258] Test --- src/komodo.h | 2 +- src/komodo_gateway.h | 62 ++++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 7bb7cb114f0..663edb1e2b3 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -335,7 +335,7 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr return(-1); if ( scriptlen == 35 && scriptbuf[0] == 33 && scriptbuf[34] == 0xac ) { - if ( i == 0 && j == 0 && memcmp(NOTARY_PUBKEY33,scriptbuf+1,33) == 0 ) + if ( i == 0 && j == 0 && memcmp(NOTARY_PUBKEY33,scriptbuf+1,33) == 0 && NOTARY_PUBKEY33[0] != 0 ) { printf("%s KOMODO_LASTMINED.%d -> %d\n",ASSETCHAINS_SYMBOL,KOMODO_LASTMINED,height); prevKOMODO_LASTMINED = KOMODO_LASTMINED; diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 51db9c0ed71..fd28a1e1838 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -746,157 +746,157 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 || height == 201 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 || height == 289 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 || height == 342 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 || height == 319 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 || height == 284 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 || height == 265 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 || height == 286 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 || height == 293 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 || height == 229 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 || height == 253 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 || height == 277 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 || height == 256 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 || height == 676 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 || height == 290 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 || height == 196 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 || height == 217 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 || height == 299 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 || height == 200 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 || height == 200 || height == 214 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 || height == 256 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 || height == 242 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 || height == 175 ) return(0); } } From 9d7a78cca6c27ebebdb4e451cbaa71d884393c5c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 22:44:55 +0200 Subject: [PATCH 101/258] Test --- src/assetchains | 64 ++++++++++++++++++++++---------------------- src/komodo_gateway.h | 62 +++++++++++++++++++++--------------------- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/assetchains b/src/assetchains index 09edf404ad4..1135f4ce804 100755 --- a/src/assetchains +++ b/src/assetchains @@ -19,68 +19,68 @@ echo $pubkey ./komodod -pubkey=$pubkey -ac_name=KV -ac_supply=1000000 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=CEAL -ac_supply=366666666 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=MESH -ac_supply=1000000 -addnode=78.47.196.146 $1 & -sleep 20 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=USD -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=EUR -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=JPY -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=GBP -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=AUD -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=CAD -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=CHF -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=NZD -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=CNY -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=RUB -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=MXN -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=BRL -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=INR -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=HKD -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=TRY -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=ZAR -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=PLN -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=NOK -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=SEK -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=DKK -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=CZK -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=HUF -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=ILS -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=KRW -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=MYR -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=PHP -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=RON -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=SGD -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=THB -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=BGN -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=IDR -addnode=78.47.196.146 $1 & -sleep 30 +sleep 10 ./komodod -pubkey=$pubkey -ac_name=HRK -addnode=78.47.196.146 $1 & diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index fd28a1e1838..5b81dcf09d7 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -746,157 +746,157 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 || height == 233 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 || height == 201 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 || height == 201 || height == 210 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 || height == 289 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 || height == 289 || height == 292 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 || height == 342 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 || height == 342 || height == 613 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 || height == 319 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 || height == 319 || height == 318 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 || height == 284 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 || height == 284 || height == 300 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 || height == 265 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 || height == 265 || height == 292 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 || height == 286 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 || height == 286 || height == 231 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 || height == 293 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 || height == 293 || height == 310 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 || height == 229 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 || height == 229 || height == 280 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 || height == 253 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 || height == 253 || height == 278 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 || height == 277 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 || height == 277 || height == 287 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 || height == 256 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 || height == 256 || height == 257 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 || height == 323 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 || height == 676 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 || height == 676 || height == 702 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 || height == 290 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 || height == 290 || height == 242 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 || height == 196 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 || height == 196 || height == 209 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 || height == 217 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 || height == 217 || height == 240 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 || height == 299 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 || height == 299 || height == 316 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 || height == 200 || height == 214 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 || height == 200 || height == 214 || height == 260 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 || height == 256 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 || height == 256 || height == 260 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 || height == 242 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 || height == 242 || height == 261 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 || height == 175 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 || height == 175 || height == 245 ) return(0); } } From 8de77430c5fc040fa3181192f1415e03748ca9fd Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 23:01:46 +0200 Subject: [PATCH 102/258] Test --- src/komodo_gateway.h | 70 +++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 5b81dcf09d7..db70f8399da 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -746,157 +746,157 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 || height == 688 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 || height == 233 ) + if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 || height == 233 || height == 294 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 || height == 201 || height == 210 ) + if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 || height == 201 || height == 210 || height == 192 ) return(0); } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 ) + if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 375 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 || height == 289 || height == 292 ) + if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 || height == 289 || height == 292 || height == 349 ) return(0); } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 ) + if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 || height == 342 || height == 613 ) + if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 || height == 342 || height == 613 || height == 525 ) return(0); } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 ) + if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 || height == 187 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 || height == 319 || height == 318 ) + if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 || height == 319 || height == 318 || height == 569 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 || height == 284 || height == 300 ) + if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 || height == 284 || height == 300 || height == 640 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 || height == 265 || height == 292 ) + if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 || height == 265 || height == 292 || height == 300 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 || height == 286 || height == 231 ) + if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 || height == 286 || height == 231 || height == 292 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 || height == 293 || height == 310 ) + if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 || height == 293 || height == 310 || height == 654 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 || height == 229 || height == 280 ) + if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 || height == 229 || height == 280 || height == 145 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 || height == 253 || height == 278 ) + if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 || height == 253 || height == 278 || height == 283 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 || height == 277 || height == 287 ) + if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 || height == 277 || height == 287 || height == 215 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 || height == 256 || height == 257 ) + if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 || height == 256 || height == 257 || height == 268 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 || height == 323 ) + if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 || height == 323 || height == 276 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 ) + if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 ) + if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 || height == 676 || height == 702 ) + if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 || height == 676 || height == 702 || height == 406 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 || height == 290 || height == 242 ) + if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 || height == 290 || height == 242 || height == 312 ) return(0); } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 ) + if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 || height == 196 || height == 209 ) + if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 || height == 196 || height == 209 || height == 238 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 || height == 217 || height == 240 ) + if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 || height == 217 || height == 240 || height == 276 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 || height == 299 || height == 316 ) + if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 || height == 299 || height == 316 || height == 233 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 || height == 200 || height == 214 || height == 260 ) + if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 || height == 200 || height == 214 || height == 260 || height == 263 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 || height == 256 || height == 260 ) + if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 || height == 256 || height == 260 || height == 280 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 || height == 242 || height == 261 ) + if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 || height == 242 || height == 261 || height == 336 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 || height == 175 || height == 245 ) + if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 || height == 175 || height == 245 || height == 260 ) return(0); } } @@ -938,15 +938,19 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above for (j=0; j<32; j++) printf("%02x",((uint8_t *)&txids[i-1])[j]); printf(" cant paxfind %c txid\n",opcode); - printf(">>>>>>>>>>> %c errs.%d i.%d match %.8f vs %.8f pax.%p\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block.vtx[0].vout[i].nValue),pax); + printf(">>>>>>>>>>> %c errs.%d i.%d match %.8f vs %.8f pax.%p ht.%d\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block.vtx[0].vout[i].nValue),pax,height); + if ( height > 200000 ) + return(-1); } } - else if ( kmdheights[i-1] > 0 && otherheights[i-1] > 0 ) + else //if ( kmdheights[i-1] > 0 && otherheights[i-1] > 0 ) { hash = block.GetHash(); for (j=0; j<32; j++) printf("%02x",((uint8_t *)&hash)[j]); 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 ( height > 200000 ) + return(-1); } } if ( ASSETCHAINS_SYMBOL[0] == 0 ) From de3f09d9f6ddbdd151d666c0c0904f39c43525e0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 23:08:08 +0200 Subject: [PATCH 103/258] Test --- src/komodo_gateway.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index db70f8399da..5cb062c8bee 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -741,17 +741,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above // grandfathering preexisting if ( baseid == USD ) // 6820 in balance calcs { - if ( height <= 2000 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) + if ( height <= 2000 || height == 3275 || height == 3282 || height == 3328 || height == 3468 || height == 6820 ) return(0); } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 || height == 688 ) + if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 || height == 688 || height == 468 ) return(0); } else if ( baseid == GBP ) @@ -939,7 +939,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above printf("%02x",((uint8_t *)&txids[i-1])[j]); printf(" cant paxfind %c txid\n",opcode); printf(">>>>>>>>>>> %c errs.%d i.%d match %.8f vs %.8f pax.%p ht.%d\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block.vtx[0].vout[i].nValue),pax,height); - if ( height > 200000 ) + if ( height > 200000 || pax->height > 200000 ) return(-1); } } @@ -949,7 +949,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above for (j=0; j<32; j++) printf("%02x",((uint8_t *)&hash)[j]); 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 ( height > 200000 ) + if ( height > 200000 || pax->height > 200000 ) return(-1); } } From 8f2acb176e9c6a2e8885ef781c24687f5781fecf Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 23:10:36 +0200 Subject: [PATCH 104/258] Test --- src/komodo_gateway.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 5cb062c8bee..8159e1a3d03 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -739,6 +739,8 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above while ( KOMODO_PASSPORT_INITDONE == 0 ) komodo_passport_iteration(); // grandfathering preexisting + if ( height < 300 ) + return(0); if ( baseid == USD ) // 6820 in balance calcs { if ( height <= 2000 || height == 3275 || height == 3282 || height == 3328 || height == 3468 || height == 6820 ) @@ -746,7 +748,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height == 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) From e862063a6ee01a78420a8260b695c9f8e5199c3a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 23:14:05 +0200 Subject: [PATCH 105/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 8159e1a3d03..623a8544257 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -739,7 +739,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above while ( KOMODO_PASSPORT_INITDONE == 0 ) komodo_passport_iteration(); // grandfathering preexisting - if ( height < 300 ) + if ( height < 500 ) return(0); if ( baseid == USD ) // 6820 in balance calcs { From d0d1b1a2d1552041a23fd4ad3550af9a8787f217 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 23:22:46 +0200 Subject: [PATCH 106/258] 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 623a8544257..60944b1ac63 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -950,8 +950,8 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above hash = block.GetHash(); for (j=0; j<32; j++) printf("%02x",((uint8_t *)&hash)[j]); - 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 ( height > 200000 || pax->height > 200000 ) + printf(" kht.%d ht.%d %.8f %.8f blockhash couldnt find vout.[%d] ht.%d\n",kmdheights[i-1],otherheights[i-1],dstr(values[i-1]),dstr(srcvalues[i]),i,height); + //if ( height > 200000 || pax->height > 200000 ) return(-1); } } From f64cbe8d5c4b1e71eb44f67b0f1cda1b64c57ec1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 23:23:16 +0200 Subject: [PATCH 107/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 60944b1ac63..72c20dc30d7 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -739,7 +739,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above while ( KOMODO_PASSPORT_INITDONE == 0 ) komodo_passport_iteration(); // grandfathering preexisting - if ( height < 500 ) + if ( height < 777 ) return(0); if ( baseid == USD ) // 6820 in balance calcs { From 6e3d5db82a25a7715754d7afaac4e60baa77f5ed Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 23:35:00 +0200 Subject: [PATCH 108/258] Test --- src/komodo_gateway.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 72c20dc30d7..3e6e1509be3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -743,12 +743,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); if ( baseid == USD ) // 6820 in balance calcs { - if ( height <= 2000 || height == 3275 || height == 3282 || height == 3328 || height == 3468 || height == 6820 ) + if ( height <= 2000 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) return(0); } else if ( baseid == EUR ) { - if ( height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -768,7 +768,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CAD ) { - if ( height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 375 ) + if ( height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 375 ) return(0); } else if ( baseid == CHF ) @@ -778,7 +778,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == NZD ) { - if ( height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) + if ( height == 777 || height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) return(0); } else if ( baseid == CNY ) @@ -788,7 +788,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == RUB ) { - if ( height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 || height == 187 ) + if ( height == 801 || height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 || height == 187 ) return(0); } else if ( baseid == MXN ) @@ -838,17 +838,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CZK ) { - if ( height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 || height == 323 || height == 276 ) + if ( height == 778 || height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 || height == 323 || height == 276 ) return(0); } else if ( baseid == HUF ) { - if ( height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) @@ -863,7 +863,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == PHP ) { - if ( height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) + if ( height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) return(0); } else if ( baseid == KRW ) @@ -939,7 +939,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above { for (j=0; j<32; j++) printf("%02x",((uint8_t *)&txids[i-1])[j]); - printf(" cant paxfind %c txid\n",opcode); + printf(" cant paxfind %c txid [%d]\n",opcode,height); printf(">>>>>>>>>>> %c errs.%d i.%d match %.8f vs %.8f pax.%p ht.%d\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block.vtx[0].vout[i].nValue),pax,height); if ( height > 200000 || pax->height > 200000 ) return(-1); From cb9c5fd395127931de713c5d63305e4a4fd7050e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 23:44:46 +0200 Subject: [PATCH 109/258] Test --- src/komodo_gateway.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 3e6e1509be3..0090dc25695 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,7 +748,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -768,7 +768,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CAD ) { - if ( height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 375 ) + if ( height == 798 || height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 375 ) return(0); } else if ( baseid == CHF ) @@ -778,7 +778,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == NZD ) { - if ( height == 777 || height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) + if ( height == 785 || height == 777 || height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) return(0); } else if ( baseid == CNY ) @@ -788,7 +788,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == RUB ) { - if ( height == 801 || height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 || height == 187 ) + if ( height == 802 || height == 801 || height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 || height == 187 ) return(0); } else if ( baseid == MXN ) @@ -941,8 +941,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above printf("%02x",((uint8_t *)&txids[i-1])[j]); printf(" cant paxfind %c txid [%d]\n",opcode,height); printf(">>>>>>>>>>> %c errs.%d i.%d match %.8f vs %.8f pax.%p ht.%d\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block.vtx[0].vout[i].nValue),pax,height); - if ( height > 200000 || pax->height > 200000 ) - return(-1); + return(-1); } } else //if ( kmdheights[i-1] > 0 && otherheights[i-1] > 0 ) @@ -951,8 +950,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above for (j=0; j<32; j++) printf("%02x",((uint8_t *)&hash)[j]); printf(" kht.%d ht.%d %.8f %.8f blockhash couldnt find vout.[%d] ht.%d\n",kmdheights[i-1],otherheights[i-1],dstr(values[i-1]),dstr(srcvalues[i]),i,height); - //if ( height > 200000 || pax->height > 200000 ) - return(-1); + return(-1); } } if ( ASSETCHAINS_SYMBOL[0] == 0 ) @@ -972,9 +970,9 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above { if ( height > 0 && (height < chainActive.Tip()->nHeight || (height >= chainActive.Tip()->nHeight && komodo_isrealtime(&ht) != 0)) && matched != num ) { - printf("REJECT %s: ht.%d (%c) matched.%d vs num.%d tip.%d isRT.%d\n",symbol,height,opcode,matched,num,(int32_t)chainActive.Tip()->nHeight,komodo_isrealtime(&ht)); - return(-1); } + printf("REJECT %s: ht.%d (%c) matched.%d vs num.%d tip.%d isRT.%d\n",symbol,height,opcode,matched,num,(int32_t)chainActive.Tip()->nHeight,komodo_isrealtime(&ht)); + return(-1); } } else From e63f3cda3863e146d98aec824c29acfbab49f9ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 20 Mar 2017 23:55:34 +0200 Subject: [PATCH 110/258] Test --- src/komodo_gateway.h | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 0090dc25695..c87a8006bbb 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,157 +748,157 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 || height == 688 || height == 468 ) + if ( height == 1041 || height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 || height == 688 || height == 468 ) return(0); } else if ( baseid == GBP ) { - if ( height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 || height == 233 || height == 294 ) + if ( height == 1028 || height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 || height == 233 || height == 294 ) return(0); } else if ( baseid == AUD ) { - if ( height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 || height == 201 || height == 210 || height == 192 ) + if ( height == 1014 || height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 || height == 201 || height == 210 || height == 192 ) return(0); } else if ( baseid == CAD ) { - if ( height == 798 || height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 375 ) + if ( height == 798 || height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 777 ) return(0); } else if ( baseid == CHF ) { - if ( height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 || height == 289 || height == 292 || height == 349 ) + if ( height == 989 || height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 || height == 289 || height == 292 || height == 349 ) return(0); } else if ( baseid == NZD ) { - if ( height == 785 || height == 777 || height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) + if ( height == 784 || height == 785 || height == 777 || height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) return(0); } else if ( baseid == CNY ) { - if ( height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 || height == 342 || height == 613 || height == 525 ) + if ( height == 989 || height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 || height == 342 || height == 613 || height == 525 ) return(0); } else if ( baseid == RUB ) { - if ( height == 802 || height == 801 || height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 || height == 187 ) + if ( height == 810 || height == 802 || height == 801 || height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 || height == 187 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 || height == 319 || height == 318 || height == 569 ) + if ( height == 1081 || height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 || height == 319 || height == 318 || height == 569 ) return(0); } else if ( baseid == BRL ) { - if ( height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 || height == 284 || height == 300 || height == 640 ) + if ( height == 1005 || height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 || height == 284 || height == 300 || height == 640 ) return(0); } else if ( baseid == INR ) { - if ( height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 || height == 265 || height == 292 || height == 300 ) + if ( height == 1000 || height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 || height == 265 || height == 292 || height == 300 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 || height == 286 || height == 231 || height == 292 ) + if ( height == 1031 || height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 || height == 286 || height == 231 || height == 292 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 || height == 293 || height == 310 || height == 654 ) + if ( height == 1015 || height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 || height == 293 || height == 310 || height == 654 ) return(0); } else if ( baseid == TRY ) { - if ( height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 || height == 229 || height == 280 || height == 145 ) + if ( height == 1051 || height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 || height == 229 || height == 280 || height == 145 ) return(0); } else if ( baseid == NOK ) { - if ( height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 || height == 253 || height == 278 || height == 283 ) + if ( height == 989 || height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 || height == 253 || height == 278 || height == 283 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 || height == 277 || height == 287 || height == 215 ) + if ( height == 981 || height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 || height == 277 || height == 287 || height == 215 ) return(0); } else if ( baseid == SEK ) { - if ( height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 || height == 256 || height == 257 || height == 268 ) + if ( height == 962 || height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 || height == 256 || height == 257 || height == 268 ) return(0); } else if ( baseid == CZK ) { - if ( height == 778 || height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 || height == 323 || height == 276 ) + if ( height == 1086 || height == 778 || height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 || height == 323 || height == 276 ) return(0); } else if ( baseid == HUF ) { - if ( height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 || height == 676 || height == 702 || height == 406 ) + if ( height == 1019 || height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 || height == 676 || height == 702 || height == 406 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 || height == 290 || height == 242 || height == 312 ) + if ( height == 1022 || height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 || height == 290 || height == 242 || height == 312 ) return(0); } else if ( baseid == PHP ) { - if ( height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) + if ( height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 || height == 196 || height == 209 || height == 238 ) + if ( height == 1023 || height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 || height == 196 || height == 209 || height == 238 ) return(0); } else if ( baseid == RON ) { - if ( height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 || height == 217 || height == 240 || height == 276 ) + if ( height == 1010 || height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 || height == 217 || height == 240 || height == 276 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 || height == 299 || height == 316 || height == 233 ) + if ( height == 1018 || height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 || height == 299 || height == 316 || height == 233 ) return(0); } else if ( baseid == THB ) { - if ( height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 || height == 200 || height == 214 || height == 260 || height == 263 ) + if ( height == 978 || height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 || height == 200 || height == 214 || height == 260 || height == 263 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 || height == 256 || height == 260 || height == 280 ) + if ( height == 1046 || height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 || height == 256 || height == 260 || height == 280 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 || height == 242 || height == 261 || height == 336 ) + if ( height == 1029 || height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 || height == 242 || height == 261 || height == 336 ) return(0); } else if ( baseid == IDR ) { - if ( height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 || height == 175 || height == 245 || height == 260 ) + if ( height == 837 || height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 || height == 175 || height == 245 || height == 260 ) return(0); } } From 49d4643c69556fb888ef250275666a3fa28acf88 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 00:06:04 +0200 Subject: [PATCH 111/258] Test --- src/komodo_gateway.h | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index c87a8006bbb..20359082425 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,137 +748,137 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1041 || height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 || height == 688 || height == 468 ) + if ( height == 1040 || height == 1041 || height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 || height == 688 || height == 468 ) return(0); } else if ( baseid == GBP ) { - if ( height == 1028 || height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 || height == 233 || height == 294 ) + if ( height == 1027 || height == 1028 || height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 || height == 233 || height == 294 ) return(0); } else if ( baseid == AUD ) { - if ( height == 1014 || height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 || height == 201 || height == 210 || height == 192 ) + if ( height == 1013 || height == 1014 || height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 || height == 201 || height == 210 || height == 192 ) return(0); } else if ( baseid == CAD ) { - if ( height == 798 || height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 777 ) + if ( height == 779 || height == 798 || height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 777 ) return(0); } else if ( baseid == CHF ) { - if ( height == 989 || height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 || height == 289 || height == 292 || height == 349 ) + if ( height == 988 || height == 989 || height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 || height == 289 || height == 292 || height == 349 ) return(0); } else if ( baseid == NZD ) { - if ( height == 784 || height == 785 || height == 777 || height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) + if ( height == 786 || height == 784 || height == 785 || height == 777 || height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) return(0); } else if ( baseid == CNY ) { - if ( height == 989 || height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 || height == 342 || height == 613 || height == 525 ) + if ( height == 988 || height == 989 || height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 || height == 342 || height == 613 || height == 525 ) return(0); } else if ( baseid == RUB ) { - if ( height == 810 || height == 802 || height == 801 || height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 || height == 187 ) + if ( height == 812 || height == 810 || height == 802 || height == 801 || height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 || height == 187 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1081 || height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 || height == 319 || height == 318 || height == 569 ) + if ( height == 1080 || height == 1081 || height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 || height == 319 || height == 318 || height == 569 ) return(0); } else if ( baseid == BRL ) { - if ( height == 1005 || height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 || height == 284 || height == 300 || height == 640 ) + if ( height == 1004 || height == 1005 || height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 || height == 284 || height == 300 || height == 640 ) return(0); } else if ( baseid == INR ) { - if ( height == 1000 || height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 || height == 265 || height == 292 || height == 300 ) + if ( height == 999 || height == 1000 || height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 || height == 265 || height == 292 || height == 300 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1031 || height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 || height == 286 || height == 231 || height == 292 ) + if ( height == 1030 || height == 1031 || height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 || height == 286 || height == 231 || height == 292 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1015 || height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 || height == 293 || height == 310 || height == 654 ) + if ( height == 1014 || height == 1015 || height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 || height == 293 || height == 310 || height == 654 ) return(0); } else if ( baseid == TRY ) { - if ( height == 1051 || height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 || height == 229 || height == 280 || height == 145 ) + if ( height == 1023 || height == 1051 || height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 || height == 229 || height == 280 || height == 145 ) return(0); } else if ( baseid == NOK ) { - if ( height == 989 || height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 || height == 253 || height == 278 || height == 283 ) + if ( height == 988 || height == 989 || height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 || height == 253 || height == 278 || height == 283 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 981 || height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 || height == 277 || height == 287 || height == 215 ) + if ( height == 980 || height == 981 || height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 || height == 277 || height == 287 || height == 215 ) return(0); } else if ( baseid == SEK ) { - if ( height == 962 || height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 || height == 256 || height == 257 || height == 268 ) + if ( height == 961 || height == 962 || height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 || height == 256 || height == 257 || height == 268 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1086 || height == 778 || height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 || height == 323 || height == 276 ) + if ( height == 1085 || height == 1086 || height == 778 || height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 || height == 323 || height == 276 ) return(0); } else if ( baseid == HUF ) { - if ( height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1019 || height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 || height == 676 || height == 702 || height == 406 ) + if ( height == 1018 || height == 1019 || height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 || height == 676 || height == 702 || height == 406 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1022 || height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 || height == 290 || height == 242 || height == 312 ) + if ( height == 1021 || height == 1022 || height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 || height == 290 || height == 242 || height == 312 ) return(0); } else if ( baseid == PHP ) { - if ( height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) + if ( height == 779 || height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1023 || height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 || height == 196 || height == 209 || height == 238 ) + if ( height == 1022 || height == 1023 || height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 || height == 196 || height == 209 || height == 238 ) return(0); } else if ( baseid == RON ) { - if ( height == 1010 || height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 || height == 217 || height == 240 || height == 276 ) + if ( height == 1009 || height == 1010 || height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 || height == 217 || height == 240 || height == 276 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1018 || height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 || height == 299 || height == 316 || height == 233 ) + if ( height == 1017 || height == 1018 || height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 || height == 299 || height == 316 || height == 233 ) return(0); } else if ( baseid == THB ) @@ -888,17 +888,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == BGN ) { - if ( height == 1046 || height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 || height == 256 || height == 260 || height == 280 ) + if ( height == 1045 || height == 1046 || height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 || height == 256 || height == 260 || height == 280 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1029 || height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 || height == 242 || height == 261 || height == 336 ) + if ( height == 1028 || height == 1029 || height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 || height == 242 || height == 261 || height == 336 ) return(0); } else if ( baseid == IDR ) { - if ( height == 837 || height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 || height == 175 || height == 245 || height == 260 ) + if ( height == 1036 || height == 837 || height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 || height == 175 || height == 245 || height == 260 ) return(0); } } From 184574752806adada83b7b8d48f593532f7eacc4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 00:18:27 +0200 Subject: [PATCH 112/258] Test --- src/komodo_gateway.h | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 20359082425..1dff7c3fe50 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,32 +748,32 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1040 || height == 1041 || height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 || height == 688 || height == 468 ) + if ( height == 1039 || height == 1040 || height == 1041 || height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 || height == 688 || height == 468 ) return(0); } else if ( baseid == GBP ) { - if ( height == 1027 || height == 1028 || height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 || height == 233 || height == 294 ) + if ( height == 1026 || height == 1027 || height == 1028 || height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 || height == 233 || height == 294 ) return(0); } else if ( baseid == AUD ) { - if ( height == 1013 || height == 1014 || height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 || height == 201 || height == 210 || height == 192 ) + if ( height == 1012 || height == 1013 || height == 1014 || height == 985 || height == 958 || height == 936 || height == 933 || height == 790 || height == 788 || height == 778 || height == 124 || height == 777 || height == 122 || height == 140 || height == 142 || height == 143 || height == 186 || height == 196 || height == 198 || height == 201 || height == 210 || height == 192 ) return(0); } else if ( baseid == CAD ) { - if ( height == 779 || height == 798 || height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 777 ) + if ( height == 781 || height == 779 || height == 798 || height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 777 ) return(0); } else if ( baseid == CHF ) { - if ( height == 988 || height == 989 || height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 || height == 289 || height == 292 || height == 349 ) + if ( height == 987 || height == 988 || height == 989 || height == 960 || height == 931 || height == 914 || height == 122 || height == 912 || height == 141 || height == 780 || height == 145 || height == 777 || height == 151 || height == 775 || height == 765 || height == 195 || height == 764 || height == 737 || height == 194 || height == 193 || height == 198 || height == 207 || height == 216 || height == 227 || height == 256 || height == 260 || height == 276 || height == 289 || height == 292 || height == 349 ) return(0); } else if ( baseid == NZD ) @@ -783,122 +783,122 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CNY ) { - if ( height == 988 || height == 989 || height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 || height == 342 || height == 613 || height == 525 ) + if ( height == 987 || height == 988 || height == 989 || height == 982 || height == 957 || height == 931 || height == 119 || height == 929 || height == 134 || height == 782 || height == 137 || height == 775 || height == 143 || height == 772 || height == 186 || height == 763 || height == 761 || height == 734 || height == 183 || height == 190 || height == 192 || height == 211 || height == 203 || height == 226 || height == 263 || height == 264 || height == 277 || height == 342 || height == 613 || height == 525 ) return(0); } else if ( baseid == RUB ) { - if ( height == 812 || height == 810 || height == 802 || height == 801 || height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 || height == 187 ) + if ( height == 819 || height == 812 || height == 810 || height == 802 || height == 801 || height == 1074 || height == 1040 || height == 1014 || height == 163 || height == 1013 || height == 877 || height == 867 || height == 863 || height == 834 || height == 158 || height == 126 || height == 106 || height == 105 || height == 174 || height == 175 || height == 176 || height == 177 || height == 181 || height == 183 || height == 184 || height == 187 ) return(0); } else if ( baseid == MXN ) { - if ( height == 1080 || height == 1081 || height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 || height == 319 || height == 318 || height == 569 ) + if ( height == 1079 || height == 1080 || height == 1081 || height == 1069 || height == 1048 || height == 1028 || height == 121 || height == 1027 || height == 146 || height == 894 || height == 891 || height == 148 || height == 882 || height == 879 || height == 151 || height == 856 || height == 158 || height == 822 || height == 197 || height == 203 || height == 207 || height == 209 || height == 213 || height == 217 || height == 218 || height == 226 || height == 283 || height == 302 || height == 319 || height == 318 || height == 569 ) return(0); } else if ( baseid == BRL ) { - if ( height == 1004 || height == 1005 || height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 || height == 284 || height == 300 || height == 640 ) + if ( height == 1003 || height == 1004 || height == 1005 || height == 972 || height == 943 || height == 922 || height == 118 || height == 920 || height == 145 || height == 787 || height == 783 || height == 147 || height == 781 || height == 774 || height == 148 || height == 771 || height == 154 || height == 751 || height == 156 || height == 188 || height == 193 || height == 195 || height == 199 || height == 203 || height == 225 || height == 230 || height == 262 || height == 266 || height == 284 || height == 300 || height == 640 ) return(0); } else if ( baseid == INR ) { - if ( height == 999 || height == 1000 || height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 || height == 265 || height == 292 || height == 300 ) + if ( height == 998 || height == 999 || height == 1000 || height == 788 || height == 786 || height == 775 || height == 753 || height == 125 || height == 153 || height == 155 || height == 159 || height == 204 || height == 206 || height == 211 || height == 217 || height == 220 || height == 229 || height == 265 || height == 292 || height == 300 ) return(0); } else if ( baseid == PLN ) { - if ( height == 1030 || height == 1031 || height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 || height == 286 || height == 231 || height == 292 ) + if ( height == 1029 || height == 1030 || height == 1031 || height == 1009 || height == 984 || height == 960 || height == 959 || height == 798 || height == 794 || height == 792 || height == 782 || height == 775 || height == 755 || height == 122 || height == 120 || height == 158 || height == 160 || height == 163 || height == 225 || height == 217 || height == 219 || height == 229 || height == 234 || height == 286 || height == 231 || height == 292 ) return(0); } else if ( baseid == HKD ) { - if ( height == 1014 || height == 1015 || height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 || height == 293 || height == 310 || height == 654 ) + if ( height == 1013 || height == 1014 || height == 1015 || height == 1002 || height == 979 || height == 947 || height == 123 || height == 946 || height == 153 || height == 811 || height == 808 || height == 806 || height == 155 || height == 795 || height == 157 || height == 773 || height == 205 || height == 208 || height == 210 || height == 211 || height == 215 || height == 221 || height == 231 || height == 255 || height == 273 || height == 293 || height == 310 || height == 654 ) return(0); } else if ( baseid == TRY ) { - if ( height == 1023 || height == 1051 || height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 || height == 229 || height == 280 || height == 145 ) + if ( height == 1022 || height == 1023 || height == 1051 || height == 991 || height == 974 || height == 949 || height == 141 || height == 948 || height == 783 || height == 153 || height == 781 || height == 779 || height == 776 || height == 768 || height == 765 || height == 121 || height == 142 || height == 144 || height == 143 || height == 149 || height == 204 || height == 210 || height == 216 || height == 229 || height == 280 || height == 145 ) return(0); } else if ( baseid == NOK ) { - if ( height == 988 || height == 989 || height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 || height == 253 || height == 278 || height == 283 ) + if ( height == 987 || height == 988 || height == 989 || height == 962 || height == 911 || height == 907 || height == 125 || height == 765 || height == 150 || height == 762 || height == 760 || height == 753 || height == 152 || height == 751 || height == 151 || height == 154 || height == 160 || height == 195 || height == 203 || height == 207 || height == 211 || height == 220 || height == 236 || height == 253 || height == 278 || height == 283 ) return(0); } else if ( baseid == ZAR ) { - if ( height == 980 || height == 981 || height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 || height == 277 || height == 287 || height == 215 ) + if ( height == 979 || height == 980 || height == 981 || height == 956 || height == 937 || height == 906 || height == 905 || height == 122 || height == 756 || height == 754 || height == 752 || height == 749 || height == 742 || height == 739 || height == 120 || height == 151 || height == 153 || height == 157 || height == 159 || height == 206 || height == 213 || height == 216 || height == 222 || height == 277 || height == 287 || height == 215 ) return(0); } else if ( baseid == SEK ) { - if ( height == 961 || height == 962 || height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 || height == 256 || height == 257 || height == 268 ) + if ( height == 960 || height == 961 || height == 962 || height == 943 || height == 925 || height == 896 || height == 147 || height == 894 || height == 759 || height == 751 || height == 749 || height == 742 || height == 740 || height == 716 || height == 123 || height == 148 || height == 150 || height == 151 || height == 157 || height == 199 || height == 200 || height == 201 || height == 206 || height == 256 || height == 257 || height == 268 ) return(0); } else if ( baseid == CZK ) { - if ( height == 1085 || height == 1086 || height == 778 || height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 || height == 323 || height == 276 ) + if ( height == 1084 || height == 1085 || height == 1086 || height == 778 || height == 1079 || height == 1054 || height == 1032 || height == 121 || height == 1030 || height == 182 || height == 876 || height == 873 || height == 871 || height == 184 || height == 862 || height == 185 || height == 861 || height == 186 || height == 838 || height == 238 || height == 242 || height == 246 || height == 248 || height == 250 || height == 251 || height == 256 || height == 282 || height == 322 || height == 343 || height == 433 || height == 323 || height == 276 ) return(0); } else if ( baseid == HUF ) { - if ( height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) { - if ( height == 1018 || height == 1019 || height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 || height == 676 || height == 702 || height == 406 ) + if ( height == 1017 || height == 1018 || height == 1019 || height == 1010 || height == 985 || height == 954 || height == 120 || height == 952 || height == 143 || height == 819 || height == 817 || height == 808 || height == 145 || height == 786 || height == 155 || height == 753 || height == 151 || height == 149 || height == 199 || height == 193 || height == 201 || height == 209 || height == 284 || height == 305 || height == 676 || height == 702 || height == 406 ) return(0); } else if ( baseid == MYR ) { - if ( height == 1021 || height == 1022 || height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 || height == 290 || height == 242 || height == 312 ) + if ( height == 1020 || height == 1021 || height == 1022 || height == 1015 || height == 984 || height == 950 || height == 949 || height == 823 || height == 820 || height == 818 || height == 812 || height == 809 || height == 126 || height == 789 || height == 144 || height == 746 || height == 146 || height == 147 || height == 148 || height == 150 || height == 205 || height == 210 || height == 215 || height == 219 || height == 222 || height == 290 || height == 242 || height == 312 ) return(0); } else if ( baseid == PHP ) { - if ( height == 779 || height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) + if ( height == 792 || height == 779 || height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) return(0); } else if ( baseid == KRW ) { - if ( height == 1022 || height == 1023 || height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 || height == 196 || height == 209 || height == 238 ) + if ( height == 1021 || height == 1022 || height == 1023 || height == 1010 || height == 950 || height == 916 || height == 138 || height == 914 || height == 140 || height == 785 || height == 782 || height == 781 || height == 142 || height == 775 || height == 148 || height == 772 || height == 751 || height == 147 || height == 146 || height == 159 || height == 175 || height == 181 || height == 184 || height == 186 || height == 188 || height == 196 || height == 209 || height == 238 ) return(0); } else if ( baseid == RON ) { - if ( height == 1009 || height == 1010 || height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 || height == 217 || height == 240 || height == 276 ) + if ( height == 1008 || height == 1009 || height == 1010 || height == 1003 || height == 973 || height == 940 || height == 939 || height == 806 || height == 802 || height == 800 || height == 793 || height == 789 || height == 768 || height == 123 || height == 141 || height == 143 || height == 144 || height == 150 || height == 197 || height == 200 || height == 202 || height == 217 || height == 240 || height == 276 ) return(0); } else if ( baseid == SGD ) { - if ( height == 1017 || height == 1018 || height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 || height == 299 || height == 316 || height == 233 ) + if ( height == 1016 || height == 1017 || height == 1018 || height == 1010 || height == 984 || height == 951 || height == 950 || height == 801 || height == 798 || height == 792 || height == 788 || height == 122 || height == 769 || height == 120 || height == 158 || height == 160 || height == 164 || height == 169 || height == 229 || height == 234 || height == 246 || height == 297 || height == 299 || height == 316 || height == 233 ) return(0); } else if ( baseid == THB ) { - if ( height == 978 || height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 || height == 200 || height == 214 || height == 260 || height == 263 ) + if ( height == 977 || height == 978 || height == 968 || height == 933 || height == 898 || height == 897 || height == 788 || height == 786 || height == 779 || height == 777 || height == 757 || height == 119 || height == 140 || height == 142 || height == 146 || height == 152 || height == 196 || height == 200 || height == 214 || height == 260 || height == 263 ) return(0); } else if ( baseid == BGN ) { - if ( height == 1045 || height == 1046 || height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 || height == 256 || height == 260 || height == 280 ) + if ( height == 1044 || height == 1045 || height == 1046 || height == 1030 || height == 995 || height == 960 || height == 959 || height == 830 || height == 822 || height == 819 || height == 810 || height == 809 || height == 781 || height == 124 || height == 122 || height == 189 || height == 193 || height == 200 || height == 194 || height == 250 || height == 256 || height == 260 || height == 280 ) return(0); } else if ( baseid == HRK ) { - if ( height == 1028 || height == 1029 || height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 || height == 242 || height == 261 || height == 336 ) + if ( height == 1027 || height == 1028 || height == 1029 || height == 1022 || height == 999 || height == 969 || height == 967 || height == 832 || height == 829 || height == 827 || height == 817 || height == 792 || height == 754 || height == 125 || height == 123 || height == 184 || height == 186 || height == 187 || height == 227 || height == 230 || height == 235 || height == 240 || height == 242 || height == 261 || height == 336 ) return(0); } else if ( baseid == IDR ) { - if ( height == 1036 || height == 837 || height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 || height == 175 || height == 245 || height == 260 ) + if ( height == 836 || height == 1036 || height == 837 || height == 720 || height == 715 || height == 714 || height == 696 || height == 695 || height == 694 || height == 693 || height == 119 || height == 689 || height == 120 || height == 669 || height == 123 || height == 662 || height == 122 || height == 634 || height == 121 || height == 609 || height == 124 || height == 174 || height == 603 || height == 595 || height == 166 || height == 176 || height == 589 || height == 172 || height == 587 || height == 179 || height == 239 || height == 175 || height == 245 || height == 260 ) return(0); } } From 02999b6ddfd2f7824cd644987244a104c7c6a07a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 00:23:13 +0200 Subject: [PATCH 113/258] Test --- src/komodo_gateway.h | 12 ++++++------ src/komodo_notary.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 1dff7c3fe50..c2f91e0af69 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,17 +748,17 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) { - if ( height == 1039 || height == 1040 || height == 1041 || height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 || height == 688 || height == 468 ) + if ( height == 1038 || height == 1039 || height == 1040 || height == 1041 || height == 1014 || height == 998 || height == 973 || height == 139 || height == 971 || height == 141 || height == 816 || height == 814 || height == 803 || height == 142 || height == 782 || height == 145 || height == 181 || height == 186 || height == 192 || height == 190 || height == 189 || height == 255 || height == 218 || height == 233 || height == 259 || height == 278 || height == 361 || height == 367 || height == 733 || height == 688 || height == 468 ) return(0); } else if ( baseid == GBP ) { - if ( height == 1026 || height == 1027 || height == 1028 || height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 || height == 233 || height == 294 ) + if ( height == 1025 || height == 1026 || height == 1027 || height == 1028 || height == 997 || height == 970 || height == 953 || height == 951 || height == 803 || height == 800 || height == 786 || height == 123 || height == 771 || height == 137 || height == 139 || height == 140 || height == 146 || height == 194 || height == 200 || height == 202 || height == 203 || height == 205 || height == 210 || height == 216 || height == 271 || height == 233 || height == 294 ) return(0); } else if ( baseid == AUD ) @@ -970,9 +970,9 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above { if ( height > 0 && (height < chainActive.Tip()->nHeight || (height >= chainActive.Tip()->nHeight && komodo_isrealtime(&ht) != 0)) && matched != num ) { + printf("REJECT %s: ht.%d (%c) matched.%d vs num.%d tip.%d isRT.%d\n",symbol,height,opcode,matched,num,(int32_t)chainActive.Tip()->nHeight,komodo_isrealtime(&ht)); + return(-1); } - printf("REJECT %s: ht.%d (%c) matched.%d vs num.%d tip.%d isRT.%d\n",symbol,height,opcode,matched,num,(int32_t)chainActive.Tip()->nHeight,komodo_isrealtime(&ht)); - return(-1); } } else @@ -1345,7 +1345,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 void komodo_passport_iteration() { static long lastpos[34]; static char userpass[33][1024]; static uint32_t lasttime; - int32_t maxseconds = 10; + int32_t maxseconds = 30; FILE *fp; int32_t baseid,n,ht,isrealtime,expired,refid,blocks,longest; struct komodo_state *sp,*refsp; char *retstr,fname[512],*base,symbol[16],dest[16]; uint32_t buf[3],starttime; cJSON *infoobj,*result; uint64_t RTmask = 0; //printf("PASSPORT.(%s)\n",ASSETCHAINS_SYMBOL); expired = 0; diff --git a/src/komodo_notary.h b/src/komodo_notary.h index b727d3f5882..6a77ecb7750 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -208,7 +208,7 @@ void komodo_notarysinit(int32_t origheight,uint8_t pubkeys[64][33],int32_t num) height /= KOMODO_ELECTION_GAP; height = ((height + 1) * KOMODO_ELECTION_GAP); htind = (height / KOMODO_ELECTION_GAP); - printf("htind.%d activation %d from %d vs %d | hwmheight.%d %s\n",htind,height,origheight,(((origheight+KOMODO_ELECTION_GAP/2)/KOMODO_ELECTION_GAP)+1)*KOMODO_ELECTION_GAP,hwmheight,ASSETCHAINS_SYMBOL); + //printf("htind.%d activation %d from %d vs %d | hwmheight.%d %s\n",htind,height,origheight,(((origheight+KOMODO_ELECTION_GAP/2)/KOMODO_ELECTION_GAP)+1)*KOMODO_ELECTION_GAP,hwmheight,ASSETCHAINS_SYMBOL); } else htind = 0; pthread_mutex_lock(&komodo_mutex); for (k=0; k Date: Tue, 21 Mar 2017 00:33:48 +0200 Subject: [PATCH 114/258] Test --- src/komodo_gateway.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index c2f91e0af69..4d81e232835 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,7 +748,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -768,7 +768,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CAD ) { - if ( height == 781 || height == 779 || height == 798 || height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 777 ) + if ( height == 836 || height == 781 || height == 779 || height == 798 || height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 777 ) return(0); } else if ( baseid == CHF ) @@ -778,7 +778,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == NZD ) { - if ( height == 786 || height == 784 || height == 785 || height == 777 || height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) + if ( height == 787 || height == 786 || height == 784 || height == 785 || height == 777 || height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) return(0); } else if ( baseid == CNY ) @@ -843,12 +843,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) @@ -863,7 +863,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == PHP ) { - if ( height == 792 || height == 779 || height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) + if ( height == 811 || height == 792 || height == 779 || height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) return(0); } else if ( baseid == KRW ) From f17ad8c905ecda662493baa53b5401b399230ee5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 00:43:08 +0200 Subject: [PATCH 115/258] Test --- src/komodo_gateway.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 4d81e232835..77760c84ed3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,7 +748,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height < 1000 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -768,7 +768,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == CAD ) { - if ( height == 836 || height == 781 || height == 779 || height == 798 || height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 777 ) + if ( height < 1000 || height == 836 || height == 781 || height == 779 || height == 798 || height == 794 || height == 1181 || height == 1179 || height == 1159 || height == 1134 || height == 1132 || height == 121 || height == 970 || height == 119 || height == 299 || height == 302 || height == 303 || height == 306 || height == 308 || height == 355 || height == 362 || height == 367 || height == 363 || height == 364 || height == 380 || height == 373 || height == 390 || height == 437 || height == 777 ) return(0); } else if ( baseid == CHF ) @@ -778,7 +778,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == NZD ) { - if ( height == 787 || height == 786 || height == 784 || height == 785 || height == 777 || height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) + if ( height < 1000 || height == 787 || height == 786 || height == 784 || height == 785 || height == 777 || height == 1113 || height == 1083 || height == 1067 || height == 265 || height == 1064 || height == 920 || height == 913 || height == 124 || height == 911 || height == 903 || height == 900 || height == 879 || height == 122 || height == 266 || height == 269 || height == 270 || height == 278 || height == 307 || height == 318 || height == 322 || height == 335 || height == 395 || height == 406 || height == 314 ) return(0); } else if ( baseid == CNY ) @@ -843,12 +843,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) @@ -863,7 +863,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == PHP ) { - if ( height == 811 || height == 792 || height == 779 || height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) + if ( height == 812 || height == 811 || height == 792 || height == 779 || height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) return(0); } else if ( baseid == KRW ) From 67b7f846061d57aaa97c60ef3cf6ae76f9a0843d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 00:52:46 +0200 Subject: [PATCH 116/258] 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 77760c84ed3..d83dee30ba7 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,7 +748,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height < 1000 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height < 1000 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -843,12 +843,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) @@ -863,7 +863,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == PHP ) { - if ( height == 812 || height == 811 || height == 792 || height == 779 || height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) + if ( height == 817 || height == 812 || height == 811 || height == 792 || height == 779 || height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) return(0); } else if ( baseid == KRW ) From f19fb8d25ffd8cf593989c0ff03965cbc9ad0e44 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 01:02:46 +0200 Subject: [PATCH 117/258] 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 d83dee30ba7..926e68f174e 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,7 +748,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height < 1000 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height < 1000 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -843,12 +843,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) @@ -863,7 +863,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == PHP ) { - if ( height == 817 || height == 812 || height == 811 || height == 792 || height == 779 || height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) + if ( height == 859 || height == 817 || height == 812 || height == 811 || height == 792 || height == 779 || height == 778 || height == 781 || height == 1154 || height == 1114 || height == 1077 || height == 1076 || height == 931 || height == 927 || height == 925 || height == 918 || height == 891 || height == 127 || height == 125 || height == 272 || height == 275 || height == 276 || height == 278 || height == 328 || height == 330 || height == 335 || height == 344 || height == 315 ) return(0); } else if ( baseid == KRW ) From 94a42d1e0f8a5be30f3b7d2b6c18bcb5b179dbbc Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 08:11:02 +0200 Subject: [PATCH 118/258] Test --- src/assetchains | 65 ++++++++++++++++++++++---------------------- src/komodo_gateway.h | 4 +-- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/assetchains b/src/assetchains index 1135f4ce804..ead749ec78a 100755 --- a/src/assetchains +++ b/src/assetchains @@ -1,5 +1,6 @@ #!/bin/bash set -x +delay=10 source pubkey.txt echo $pubkey @@ -19,68 +20,68 @@ echo $pubkey ./komodod -pubkey=$pubkey -ac_name=KV -ac_supply=1000000 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=CEAL -ac_supply=366666666 -addnode=78.47.196.146 $1 & ./komodod -pubkey=$pubkey -ac_name=MESH -ac_supply=1000000 -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=USD -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=EUR -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=JPY -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=GBP -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=AUD -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=CAD -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=CHF -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=NZD -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=CNY -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=RUB -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=MXN -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=BRL -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=INR -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=HKD -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=TRY -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=ZAR -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=PLN -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=NOK -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=SEK -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=DKK -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=CZK -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=HUF -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=ILS -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=KRW -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=MYR -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=PHP -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=RON -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=SGD -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=THB -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=BGN -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=IDR -addnode=78.47.196.146 $1 & -sleep 10 +sleep $delay ./komodod -pubkey=$pubkey -ac_name=HRK -addnode=78.47.196.146 $1 & diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 926e68f174e..dc7d72faa59 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -843,12 +843,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 866 || height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) From a88f9c80ca36f86a4783fd0ec29aa527e5f79d2f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 08:35:26 +0200 Subject: [PATCH 119/258] 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 dc7d72faa59..44b3fce3078 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -843,12 +843,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 866 || height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 892 || height == 866 || height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) From a308cdb2d4a30a2fdff35da5d39e605452b6c1cf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 08:36:32 +0200 Subject: [PATCH 120/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 44b3fce3078..10fcdde9491 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -949,7 +949,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above hash = block.GetHash(); for (j=0; j<32; j++) printf("%02x",((uint8_t *)&hash)[j]); - printf(" kht.%d ht.%d %.8f %.8f blockhash couldnt find vout.[%d] ht.%d\n",kmdheights[i-1],otherheights[i-1],dstr(values[i-1]),dstr(srcvalues[i]),i,height); + printf(" kht.%d ht.%d %.8f %.8f blockhash couldnt find vout.[%d] ht.%d %s\n",kmdheights[i-1],otherheights[i-1],dstr(values[i-1]),dstr(srcvalues[i]),i,height,ASSETCHAINS_SYMBOL); return(-1); } } From 82315b7dafa77ec17d8a2102a8c4e56fb416ae57 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 08:42:11 +0200 Subject: [PATCH 121/258] Test --- src/komodo_gateway.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 10fcdde9491..5fa3114501d 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,7 +748,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height < 1000 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height < 1000 || height == 1080 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -843,12 +843,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 892 || height == 866 || height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 894 || height == 892 || height == 866 || height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) @@ -1112,8 +1112,8 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 { basesp->issued += pax2->fiatoshis; pax2->didstats = 1; - if ( 0 && strcmp(base,ASSETCHAINS_SYMBOL) == 0 ) - printf("########### %p issueda %s += %.8f kmdheight.%d %.8f other.%d\n",basesp,base,dstr(pax2->fiatoshis),pax2->height,dstr(pax2->komodoshis),pax2->otherheight); + if ( 1 && strcmp(base,"USD") == 0 ) + printf("########### %p issueda %s += %.8f kmdheight.%d %.8f other.%d [%d]\n",basesp,base,dstr(pax2->fiatoshis),pax2->height,dstr(pax2->komodoshis),pax2->otherheight,height); } } } @@ -1164,8 +1164,8 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 pax->didstats = 1; pax->height = pax2->height; pax->otherheight = height; - if ( 0 && strcmp(CURRENCIES[baseids[i]],ASSETCHAINS_SYMBOL) == 0 ) - printf("########### %p issuedb %s += %.8f kmdheight.%d %.8f other.%d\n",basesp,CURRENCIES[baseids[i]],dstr(pax->fiatoshis),pax->height,dstr(pax->komodoshis),pax->otherheight); + if ( 1 && strcmp(CURRENCIES[baseids[i]],"USD") == 0 ) + printf("########### %p issuedb %s += %.8f kmdheight.%d %.8f other.%d [%d]\n",basesp,CURRENCIES[baseids[i]],dstr(pax->fiatoshis),pax->height,dstr(pax->komodoshis),pax->otherheight,height); } } } From c5f423c7605440c436a54693eece54bd9fdd5c74 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 08:46:21 +0200 Subject: [PATCH 122/258] 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 5fa3114501d..aa35fd8ad44 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,7 +748,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height < 1000 || height == 1080 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height < 1000 || height == 1092 || height == 1080 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -843,12 +843,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 894 || height == 892 || height == 866 || height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 898 || height == 894 || height == 892 || height == 866 || height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) @@ -1156,7 +1156,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 pax->fiatoshis = pax2->fiatoshis; pax->komodoshis = pax2->komodoshis; pax->marked = pax2->marked = pax2->height; - if ( pax->didstats == 0 ) + if ( 0 && pax->didstats == 0 ) { if ( (basesp= komodo_stateptrget(CURRENCIES[baseids[i]])) != 0 ) { From 5b62b979f4bdb03cefc390bc375a6ef8a38772f6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 08:49:19 +0200 Subject: [PATCH 123/258] Test --- src/komodo_gateway.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index aa35fd8ad44..74dfb392d67 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,7 +748,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height < 1000 || height == 1092 || height == 1080 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height < 1000 || height == 1094 || height == 1092 || height == 1080 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -843,12 +843,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 898 || height == 894 || height == 892 || height == 866 || height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 945 || height == 898 || height == 894 || height == 892 || height == 866 || height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) @@ -1106,7 +1106,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 pax2->komodoshis = pax->komodoshis; pax->marked = pax2->marked = pax->height; pax2->height = pax->height = height; - if ( pax2->didstats == 0 ) + if ( 0 && pax2->didstats == 0 ) { if ( (basesp= komodo_stateptrget(base)) != 0 ) { @@ -1156,7 +1156,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 pax->fiatoshis = pax2->fiatoshis; pax->komodoshis = pax2->komodoshis; pax->marked = pax2->marked = pax2->height; - if ( 0 && pax->didstats == 0 ) + if ( pax->didstats == 0 ) { if ( (basesp= komodo_stateptrget(CURRENCIES[baseids[i]])) != 0 ) { From c0955f716531ca514591f2405aa6a56a93324de3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 08:57:09 +0200 Subject: [PATCH 124/258] 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 74dfb392d67..5f1cc77b765 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,7 +748,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height < 1000 || height == 1094 || height == 1092 || height == 1080 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height < 1000 || height == 1111 || height == 1094 || height == 1092 || height == 1080 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -843,7 +843,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) @@ -1100,13 +1100,13 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 } // if ( didstats != 0 ) pax->didstats = 1; - if ( (pax2= komodo_paxfind(txid,vout,'I')) != 0 ) + if ( (0 && pax2= komodo_paxfind(txid,vout,'I')) != 0 ) { pax2->fiatoshis = pax->fiatoshis; pax2->komodoshis = pax->komodoshis; pax->marked = pax2->marked = pax->height; pax2->height = pax->height = height; - if ( 0 && pax2->didstats == 0 ) + if ( pax2->didstats == 0 ) { if ( (basesp= komodo_stateptrget(base)) != 0 ) { From a49a8601005dac3b39a765bad18c55a56023aa45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:10:15 +0200 Subject: [PATCH 125/258] 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 5f1cc77b765..ad3409ad3ad 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -748,7 +748,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height < 1000 || height == 1111 || height == 1094 || height == 1092 || height == 1080 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height < 1200 || height == 1111 || height == 1094 || height == 1092 || height == 1080 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -843,7 +843,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height < 1500 || height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) From cbb7cd4b6a8598f70e05eb1cf53f9516a01a39e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:13:10 +0200 Subject: [PATCH 126/258] Test --- src/komodo_gateway.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index ad3409ad3ad..d6db7085d36 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -902,6 +902,8 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); } } + if ( strcmp(ASSETCHAINS_SYMBOL,"EUR") == 0 ) + printf("%s height.%d\n",ASSETCHAINS_SYMBOL,height); if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) { if ( (num= komodo_issued_opreturn(base,txids,vouts,values,srcvalues,kmdheights,otherheights,baseids,rmd160s,&script[offset],opretlen,opcode == 'X')) > 0 ) From 2eceb04b6a2e0085ad10fee08a3aed5e2edb3281 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:16:27 +0200 Subject: [PATCH 127/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index d6db7085d36..4fcd5210192 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -951,7 +951,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above hash = block.GetHash(); for (j=0; j<32; j++) printf("%02x",((uint8_t *)&hash)[j]); - printf(" kht.%d ht.%d %.8f %.8f blockhash couldnt find vout.[%d] ht.%d %s\n",kmdheights[i-1],otherheights[i-1],dstr(values[i-1]),dstr(srcvalues[i]),i,height,ASSETCHAINS_SYMBOL); + printf(" kht.%d ht.%d %.8f %.8f blockhash couldnt find vout.[%d] ht.%d %s for [%s]\n",kmdheights[i-1],otherheights[i-1],dstr(values[i-1]),dstr(srcvalues[i]),i,height,ASSETCHAINS_SYMBOL,CURRENCIES[baseids[i-1]]); return(-1); } } From cdf5f8c86a5c4dc186f441bbaffe85f99330aaf1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:21:50 +0200 Subject: [PATCH 128/258] Test --- src/komodo_gateway.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 4fcd5210192..7fc3e4e71c3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -108,6 +108,8 @@ void komodo_gateway_deposit(char *coinaddr,uint64_t value,char *symbol,uint64_t struct pax_transaction *pax; uint8_t buf[35]; int32_t addflag = 0; struct komodo_state *sp; char str[16],dest[16],*s; //if ( KOMODO_PAX == 0 ) // return; + if ( strcmp(symbol,ASSETCHAINS_SYMBOL) != 0 ) + return; sp = komodo_stateptr(str,dest); pthread_mutex_lock(&komodo_mutex); pax_keyset(buf,txid,vout,type); @@ -902,8 +904,6 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); } } - if ( strcmp(ASSETCHAINS_SYMBOL,"EUR") == 0 ) - printf("%s height.%d\n",ASSETCHAINS_SYMBOL,height); if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) { if ( (num= komodo_issued_opreturn(base,txids,vouts,values,srcvalues,kmdheights,otherheights,baseids,rmd160s,&script[offset],opretlen,opcode == 'X')) > 0 ) @@ -1102,7 +1102,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 } // if ( didstats != 0 ) pax->didstats = 1; - if ( (0 && pax2= komodo_paxfind(txid,vout,'I')) != 0 ) + if ( 0 && (pax2= komodo_paxfind(txid,vout,'I')) != 0 ) { pax2->fiatoshis = pax->fiatoshis; pax2->komodoshis = pax->komodoshis; From e2879b92a99df2b820e603241c98576411302039 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:27:54 +0200 Subject: [PATCH 129/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 7fc3e4e71c3..36ec0735878 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1146,7 +1146,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 continue; } bitcoin_address(coinaddr,60,&rmd160s[i*20],20); - komodo_gateway_deposit(coinaddr,0,0,0,0,txids[i],vouts[i],'I',height,0,CURRENCIES[baseids[i]],0); + komodo_gateway_deposit(coinaddr,0,ASSETCHAINS_SYMBOL,0,0,txids[i],vouts[i],'I',height,0,CURRENCIES[baseids[i]],0); komodo_paxmark(height,txids[i],vouts[i],'I',height); if ( (pax= komodo_paxfind(txids[i],vouts[i],'I')) != 0 ) { From 4333e0d8fee723de7badac925aae33bf1209f272 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:31:27 +0200 Subject: [PATCH 130/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 36ec0735878..7dfe866d698 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -845,7 +845,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height < 1500 || height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height < 1500 || height == 1530 || height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) From 4a6d9acb93b7f0f268292b3953cac07c1c105216 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:38:59 +0200 Subject: [PATCH 131/258] 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 7dfe866d698..789a29284de 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -108,8 +108,8 @@ void komodo_gateway_deposit(char *coinaddr,uint64_t value,char *symbol,uint64_t struct pax_transaction *pax; uint8_t buf[35]; int32_t addflag = 0; struct komodo_state *sp; char str[16],dest[16],*s; //if ( KOMODO_PAX == 0 ) // return; - if ( strcmp(symbol,ASSETCHAINS_SYMBOL) != 0 ) - return; + //if ( strcmp(symbol,ASSETCHAINS_SYMBOL) != 0 ) + // return; sp = komodo_stateptr(str,dest); pthread_mutex_lock(&komodo_mutex); pax_keyset(buf,txid,vout,type); @@ -929,7 +929,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above matched++; if ( pax->marked != 0 && height >= 80820 ) { - printf(">>>>>>>>>>> %c errs.%d i.%d match %.8f vs %.8f paxmarked.%d kht.%d ht.%d\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block.vtx[0].vout[i].nValue),pax->marked,pax->height,pax->otherheight); + printf(">>>>>>>>>>> %c errs.%d i.%d match %.8f vs %.8f paxmarked.%d kht.%d ht.%d [%s].%d\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block.vtx[0].vout[i].nValue),pax->marked,pax->height,pax->otherheight,ASSETCHAINS_SYMBOL,height); } else { @@ -942,7 +942,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above for (j=0; j<32; j++) printf("%02x",((uint8_t *)&txids[i-1])[j]); printf(" cant paxfind %c txid [%d]\n",opcode,height); - printf(">>>>>>>>>>> %c errs.%d i.%d match %.8f vs %.8f pax.%p ht.%d\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block.vtx[0].vout[i].nValue),pax,height); + printf(">>>>>>>>>>> %c errs.%d i.%d match %.8f vs %.8f pax.%p [%s] ht.%d\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block.vtx[0].vout[i].nValue),pax,ASSETCHAINS_SYMBOL,height); return(-1); } } From 0a2584e6af7e4cdf67173525034331fc45396565 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:42:51 +0200 Subject: [PATCH 132/258] Test --- src/komodo_gateway.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 789a29284de..cdbdd3d97b2 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -750,7 +750,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == EUR ) { - if ( height < 1200 || height == 1111 || height == 1094 || height == 1092 || height == 1080 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) + if ( height < 1200 || height == 1408 || height == 1111 || height == 1094 || height == 1092 || height == 1080 || height == 1053 || height == 1005 || height == 822 || height == 821 || height == 810 || height == 797 || height == 790 || height == 787 || height == 785 || height == 1313 || height == 1288 || height == 1263 || height == 1262 || height <= 211 || height == 210 || height == 188 || height == 185 || height == 182 || height == 181 || height == 171 || height == 170 || height == 169 || height == 168 || height == 167 || height == 166 || height == 165 || height == 164 || height == 163 || height == 162 ) return(0); } else if ( baseid == JPY ) @@ -845,12 +845,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height < 1500 || height == 1530 || height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height < 1500 || height == 1528 || height == 1530 || height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) { - if ( height == 945 || height == 898 || height == 894 || height == 892 || height == 866 || height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) + if ( height == 1241 || height == 945 || height == 898 || height == 894 || height == 892 || height == 866 || height == 857 || height == 853 || height == 834 || height == 812 || height == 792 || height == 784 || height == 778 || height == 783 || height == 1214 || height == 1186 || height == 1158 || height == 126 || height == 1156 || height == 329 || height == 1021 || height == 1016 || height == 1014 || height == 333 || height == 1003 || height == 1002 || height == 978 || height == 332 || height == 337 || height == 381 || height == 390 || height == 386 || height == 401 || height == 389 || height == 396 || height == 428 || height == 473 || height == 490 || height == 493 ) return(0); } else if ( baseid == ILS ) From eb706ef8f509b570c196077f028b4d8d68446242 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:46:07 +0200 Subject: [PATCH 133/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index cdbdd3d97b2..5c0b47ea154 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1102,7 +1102,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 } // if ( didstats != 0 ) pax->didstats = 1; - if ( 0 && (pax2= komodo_paxfind(txid,vout,'I')) != 0 ) + if ( (pax2= komodo_paxfind(txid,vout,'I')) != 0 ) { pax2->fiatoshis = pax->fiatoshis; pax2->komodoshis = pax->komodoshis; From 08996da1558e0be1a26c2a628171d01ab2314ee3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:49:59 +0200 Subject: [PATCH 134/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 5c0b47ea154..47c70c386e5 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -845,7 +845,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height < 1500 || height == 1528 || height == 1530 || height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height < 1500 || height == 1531 || height == 1528 || height == 1530 || height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) From f9fdf1991f4cfac3339f9488d083852c098d9976 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:50:50 +0200 Subject: [PATCH 135/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 47c70c386e5..8bc84d72c16 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -845,7 +845,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height < 1500 || height == 1531 || height == 1528 || height == 1530 || height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height < 2000 || height == 1531 || height == 1528 || height == 1530 || height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) From 73dc83900093b70374a8609068727fafa9743cde Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 09:53:10 +0200 Subject: [PATCH 136/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 8bc84d72c16..866064b3dc9 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -845,7 +845,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else if ( baseid == HUF ) { - if ( height < 2000 || height == 1531 || height == 1528 || height == 1530 || height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) + if ( height < 2200 || height == 1531 || height == 1528 || height == 1530 || height == 1451 || height == 1448 || height == 1442 || height == 1418 || height == 1407 || height == 1406 || height == 1392 || height == 1391 || height == 1387 || height == 1383 || height == 1335 || height == 1337 || height == 1338 || height == 1649 || height == 2378 || height == 2376 || height == 2371 || height == 1330 || height == 2326 || height == 1344 || height == 2305 || height == 2304 || height == 2171 || height == 2168 || height == 2166 || height == 2156 || height == 2135 || height == 1343 || height == 1342 || height == 1341 || height == 1340 || height == 1339 || height == 1336 || height == 1334 || height == 1333 || height == 1346 || height == 1400 || height == 1525 || height == 1509 ) return(0); } else if ( baseid == DKK ) From 4c973c666269e6f253236d36e1d378509789eabb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 14:57:38 +0200 Subject: [PATCH 137/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 866064b3dc9..8c68b603003 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -745,7 +745,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); if ( baseid == USD ) // 6820 in balance calcs { - if ( height <= 2000 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) + if ( height <= 2000 || height == 2649 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) return(0); } else if ( baseid == EUR ) From 392126c0cf830b23f37ba24d5712ffa09cafbebf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 15:02:01 +0200 Subject: [PATCH 138/258] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 8c68b603003..2a612bc47e7 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -745,7 +745,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); if ( baseid == USD ) // 6820 in balance calcs { - if ( height <= 2000 || height == 2649 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) + if ( height <= 2000 || height == 2960 || height == 2649 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) return(0); } else if ( baseid == EUR ) From fb50dd55dc9303edeaf98c4a4593d6b94883427d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 15:12:38 +0200 Subject: [PATCH 139/258] Test --- src/komodo_gateway.h | 2 +- src/main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 2a612bc47e7..8970f934d9b 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -745,7 +745,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); if ( baseid == USD ) // 6820 in balance calcs { - if ( height <= 2000 || height == 2960 || height == 2649 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) + if ( height <= 2000 || height == 2968 || height == 2960 || height == 2649 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) return(0); } else if ( baseid == EUR ) diff --git a/src/main.cpp b/src/main.cpp index 35c7431840c..6c73fb2f784 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -710,13 +710,13 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) { if (tx.nLockTime == 0) return true; - if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime)) - return true; if ( (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { fprintf(stderr,"IsFinalTx reject locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx } + if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime)) + return true; BOOST_FOREACH(const CTxIn& txin, tx.vin) { if ( txin.nSequence == 0xfffffffe && (((int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime > nBlockTime) || ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime > nBlockHeight)) ) From e35947199da81a237979cce9e67449d3bd307ee9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 15:16:40 +0200 Subject: [PATCH 140/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 6c73fb2f784..03e85f78bc6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -710,7 +710,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) { if (tx.nLockTime == 0) return true; - if ( (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { fprintf(stderr,"IsFinalTx reject locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx From a27305d43fcfda72074eb086ed65b2078e20cdf2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 15:46:38 +0200 Subject: [PATCH 141/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 03e85f78bc6..70cd630d5ca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -710,7 +710,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) { if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600*3 ) { fprintf(stderr,"IsFinalTx reject locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx From 126bffe09e55e3950b75bacd27f2f127492c1e87 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 16:18:54 +0200 Subject: [PATCH 142/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 70cd630d5ca..8c07217de40 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -710,7 +710,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) { if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600*3 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && nBlockTime != 1477598030 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { fprintf(stderr,"IsFinalTx reject locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx From 0ec3b2dd169f45d4d257db2f29668c64482eadf4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 16:20:04 +0200 Subject: [PATCH 143/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 8c07217de40..3ce70ef79f0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -710,7 +710,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) { if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && nBlockTime != 1477598030 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && nBlockTime != 1477598030 && nBlockTime != 1477269321 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { fprintf(stderr,"IsFinalTx reject locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx From f0279d992f566557f5cbdde6d4856ba68ad56e77 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 18:03:38 +0200 Subject: [PATCH 144/258] Test --- src/komodo_gateway.h | 17 ++++++++++++----- src/komodo_interest.h | 6 ++++-- src/main.cpp | 17 ++++++++++++++--- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 8970f934d9b..8e9af6a0448 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -694,15 +694,22 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } prevtotal = total; } - if ( overflow != 0 || total > COIN/10 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 ) { - //fprintf(stderr,">>>>>>>> <<<<<<<<<< ht.%d illegal nonz output %.8f n.%d\n",height,dstr(block.vtx[0].vout[1].nValue),n); - if ( height >= 235300 ) + if ( overflow != 0 || total > COIN/10 ) + { + //fprintf(stderr,">>>>>>>> <<<<<<<<<< ht.%d illegal nonz output %.8f n.%d\n",height,dstr(block.vtx[0].vout[1].nValue),n); + if ( height >= 235300 ) + return(-1); + } + } + else + { + if ( overflow != 0 || total > 0 ) return(-1); } return(0); } - //fprintf(stderr,"ht.%d n.%d nValue %.8f (%d %d %d)\n",height,n,dstr(block.vtx[0].vout[1].nValue),KOMODO_PAX,komodo_isrealtime(&ht),KOMODO_PASSPORT_INITDONE); offset += komodo_scriptitemlen(&opretlen,&script[offset]); if ( ASSETCHAINS_SYMBOL[0] == 0 ) @@ -745,7 +752,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); if ( baseid == USD ) // 6820 in balance calcs { - if ( height <= 2000 || height == 2968 || height == 2960 || height == 2649 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) + if ( height <= 6821 || height <= 2000 || height == 2968 || height == 2960 || height == 2649 || height == 3275 || height == 3282 || height == 3328 || height == 3468 ) return(0); } else if ( baseid == EUR ) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 2aa74507041..0d11992ab9b 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -75,6 +75,8 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin { if ( minutes > 365 * 24 * 60 ) minutes = 365 * 24 * 60; + if ( txheight >= 275000 ) + minutes -= 59; denominator = (((uint64_t)365 * 24 * 60) / minutes); if ( denominator == 0 ) denominator = 1; // max KOMODO_INTEREST per transfer, do it at least annually! @@ -104,7 +106,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin if ( exception == 0 ) { numerator = (nValue / 20); // assumes 5%! - if ( txheight < 300000 ) + if ( txheight < 275000 ) interest = (numerator / denominator); else interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60); } @@ -117,7 +119,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin else { numerator = (nValue * KOMODO_INTEREST); - if ( txheight < 300000 || numerator * minutes < 365 * 24 * 60 ) + if ( txheight < 275000 || numerator * minutes < 365 * 24 * 60 ) interest = (numerator / denominator) / COIN; else interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / COIN; } diff --git a/src/main.cpp b/src/main.cpp index 3ce70ef79f0..992425f3efe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -708,12 +708,23 @@ bool IsStandardTx(const CTransaction& tx, string& reason) bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) { + static uin32_t grandfathered[] = + { + 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684 + }; + int32_t i; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && nBlockTime != 1477598030 && nBlockTime != 1477269321 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - fprintf(stderr,"IsFinalTx reject locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); - return(false); // need to prevent pastdating tx + for (i=0; i Date: Tue, 21 Mar 2017 18:04:44 +0200 Subject: [PATCH 145/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 992425f3efe..a78b476df31 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -708,7 +708,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) { - static uin32_t grandfathered[] = + static uint32_t grandfathered[] = { 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684 }; From 5c0287f2593ff1c87d3d18b7ca8d58ccfa8a813d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 18:15:36 +0200 Subject: [PATCH 146/258] Test --- src/rpcblockchain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 334d1809019..3d7ce164a24 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -589,7 +589,8 @@ Value paxprice(const Array& params, bool fHelp) std::string rel = params[1].get_str(); int32_t height = atoi(params[2].get_str().c_str()); if ( params.size() == 3 || (basevolume= COIN * atof(params[3].get_str().c_str())) == 0 ) - basevolume = COIN; + basevolume = 1; + basevolume *= COIN; relvolume = komodo_paxprice(&seed,height,(char *)base.c_str(),(char *)rel.c_str(),basevolume); ret.push_back(Pair("base", base)); ret.push_back(Pair("rel", rel)); From 4050a4cecf7e692f7884ab7d4b769482f3d1217b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 18:16:57 +0200 Subject: [PATCH 147/258] Test --- src/rpcblockchain.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 3d7ce164a24..44068cfc54e 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -587,7 +587,10 @@ Value paxprice(const Array& params, bool fHelp) Object ret; uint64_t basevolume=0,relvolume,seed; std::string base = params[0].get_str(); std::string rel = params[1].get_str(); - int32_t height = atoi(params[2].get_str().c_str()); + int32_t height; + if ( params.size() == 2 ) + height = chainActive.Tip()->nHeight; + else height = atoi(params[2].get_str().c_str()); if ( params.size() == 3 || (basevolume= COIN * atof(params[3].get_str().c_str())) == 0 ) basevolume = 1; basevolume *= COIN; @@ -603,7 +606,8 @@ Value paxprice(const Array& params, bool fHelp) else { CBlockIndex *pblockindex = chainActive[height]; - ret.push_back(Pair("timestamp", (int64_t)pblockindex->nTime)); + if ( pblockindex != 0 ) + ret.push_back(Pair("timestamp", (int64_t)pblockindex->nTime)); if ( basevolume != 0 && relvolume != 0 ) { ret.push_back(Pair("price",((double)relvolume / (double)basevolume))); From 7b58c2d5c9221a986830b3ba5ef1533ef6d97223 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 18:36:23 +0200 Subject: [PATCH 148/258] Test --- src/main.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a78b476df31..d916a6bb8f3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -712,18 +712,24 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) { 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684 }; - int32_t i; + int32_t i,txheight=0; uint32_t tiptime=0,locktime; uint64_t value=0; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD ) { - for (i=0; i Date: Tue, 21 Mar 2017 18:37:21 +0200 Subject: [PATCH 149/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d916a6bb8f3..64e10e61f1c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -719,7 +719,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) { locktime = komodo_interest_args(&txheight,&tiptime,&value,hash,0); if ( tiptime == 0 ) - timetime = nBlockTime; + tiptime = nBlockTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { for (i=0; i Date: Tue, 21 Mar 2017 18:38:34 +0200 Subject: [PATCH 150/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 64e10e61f1c..34d5e51c068 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -717,7 +717,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD ) { - locktime = komodo_interest_args(&txheight,&tiptime,&value,hash,0); + locktime = komodo_interest_args(&txheight,&tiptime,&value,tx.GetHash(),0); if ( tiptime == 0 ) tiptime = nBlockTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) From b5284a65d16f2d2982c7f8bce375e7f5767e5bfb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 18:45:22 +0200 Subject: [PATCH 151/258] Test --- src/main.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 34d5e51c068..da7b13e4d03 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -712,24 +712,18 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) { 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684 }; - int32_t i,txheight=0; uint32_t tiptime=0,locktime; uint64_t value=0; + int32_t i; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - locktime = komodo_interest_args(&txheight,&tiptime,&value,tx.GetHash(),0); - if ( tiptime == 0 ) - tiptime = nBlockTime; - if ( (int64_t)tx.nLockTime < tiptime-3600 ) + for (i=0; i Date: Tue, 21 Mar 2017 18:47:16 +0200 Subject: [PATCH 152/258] Test --- src/rpcblockchain.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 44068cfc54e..53761096ab0 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -592,8 +592,7 @@ Value paxprice(const Array& params, bool fHelp) height = chainActive.Tip()->nHeight; else height = atoi(params[2].get_str().c_str()); if ( params.size() == 3 || (basevolume= COIN * atof(params[3].get_str().c_str())) == 0 ) - basevolume = 1; - basevolume *= COIN; + basevolume = 1000; relvolume = komodo_paxprice(&seed,height,(char *)base.c_str(),(char *)rel.c_str(),basevolume); ret.push_back(Pair("base", base)); ret.push_back(Pair("rel", rel)); @@ -612,8 +611,8 @@ Value paxprice(const Array& params, bool fHelp) { ret.push_back(Pair("price",((double)relvolume / (double)basevolume))); ret.push_back(Pair("invprice",((double)basevolume / (double)relvolume))); - ret.push_back(Pair("basevolume", ValueFromAmount(basevolume))); - ret.push_back(Pair("relvolume", ValueFromAmount(relvolume))); + ret.push_back(Pair("basevolume",(COIN/1000) * ValueFromAmount(basevolume))); + ret.push_back(Pair("relvolume",(COIN/1000) * ValueFromAmount(relvolume))); } else ret.push_back(Pair("error", "overflow or error in one or more of parameters")); } return ret; From a821c7eb0b2651d57460b6a86d68074ae53e1240 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 18:48:50 +0200 Subject: [PATCH 153/258] Test --- src/rpcblockchain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 53761096ab0..fe214a3c6d9 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -611,8 +611,8 @@ Value paxprice(const Array& params, bool fHelp) { ret.push_back(Pair("price",((double)relvolume / (double)basevolume))); ret.push_back(Pair("invprice",((double)basevolume / (double)relvolume))); - ret.push_back(Pair("basevolume",(COIN/1000) * ValueFromAmount(basevolume))); - ret.push_back(Pair("relvolume",(COIN/1000) * ValueFromAmount(relvolume))); + ret.push_back(Pair("basevolume",ValueFromAmount((COIN/1000) * basevolume))); + ret.push_back(Pair("relvolume",ValueFromAmount((COIN/1000) * relvolume))); } else ret.push_back(Pair("error", "overflow or error in one or more of parameters")); } return ret; From 6a4a0c47276731c30ed375b0268a0e4ddc7600fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 18:55:26 +0200 Subject: [PATCH 154/258] Test --- src/rpcblockchain.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index fe214a3c6d9..a7bd011710f 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -591,8 +591,8 @@ Value paxprice(const Array& params, bool fHelp) if ( params.size() == 2 ) height = chainActive.Tip()->nHeight; else height = atoi(params[2].get_str().c_str()); - if ( params.size() == 3 || (basevolume= COIN * atof(params[3].get_str().c_str())) == 0 ) - basevolume = 1000; + //if ( params.size() == 3 || (basevolume= COIN * atof(params[3].get_str().c_str())) == 0 ) + basevolume = 1; relvolume = komodo_paxprice(&seed,height,(char *)base.c_str(),(char *)rel.c_str(),basevolume); ret.push_back(Pair("base", base)); ret.push_back(Pair("rel", rel)); @@ -611,8 +611,8 @@ Value paxprice(const Array& params, bool fHelp) { ret.push_back(Pair("price",((double)relvolume / (double)basevolume))); ret.push_back(Pair("invprice",((double)basevolume / (double)relvolume))); - ret.push_back(Pair("basevolume",ValueFromAmount((COIN/1000) * basevolume))); - ret.push_back(Pair("relvolume",ValueFromAmount((COIN/1000) * relvolume))); + ret.push_back(Pair("basevolume",ValueFromAmount(basevolume))); + ret.push_back(Pair("relvolume",ValueFromAmount(relvolume))); } else ret.push_back(Pair("error", "overflow or error in one or more of parameters")); } return ret; From 67a128db46ed349dffb35d3d4ab63a25ed3315f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 18:56:59 +0200 Subject: [PATCH 155/258] Test --- src/rpcblockchain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index a7bd011710f..b9242b71213 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -581,8 +581,8 @@ Value paxpending(const Array& params, bool fHelp) Value paxprice(const Array& params, bool fHelp) { - if ( fHelp || params.size() < 3 || params.size() > 4 ) - throw runtime_error("paxprice \"base\" \"rel\" height amount\n"); + if ( fHelp || params.size() > 3 || params.size() < 2 ) + throw runtime_error("paxprice \"base\" \"rel\" height\n"); LOCK(cs_main); Object ret; uint64_t basevolume=0,relvolume,seed; std::string base = params[0].get_str(); From 83df5c2a76ce7311319aed757f062ee7f0cb5cb0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 19:01:19 +0200 Subject: [PATCH 156/258] Test --- src/main.cpp | 8 ++++---- src/main.h | 2 +- src/miner.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index da7b13e4d03..0a20e77d883 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,7 +706,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return true; } -bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) +bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) { static uint32_t grandfathered[] = { @@ -715,7 +715,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) int32_t i; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { for (i=0; iGetMedianTimePast() : GetAdjustedTime(); - return IsFinalTx(tx, nBlockHeight, nBlockTime); + return IsFinalTx(tx, nBlockHeight, nBlockTime,flags); } /** @@ -3292,7 +3292,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST) ? pindexPrev->GetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(tx, nHeight, nLockTimeCutoff)) { + if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,0)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } diff --git a/src/main.h b/src/main.h index 6f349c7d7b4..0a137188d76 100644 --- a/src/main.h +++ b/src/main.h @@ -351,7 +351,7 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason); * Check if transaction is final and can be included in a block with the * specified height and time. Consensus critical. */ -bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime); +bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime, int flags); /** * Check if transaction will be final in the next block to be created. diff --git a/src/miner.cpp b/src/miner.cpp index dfec5825aaa..f53c7086a8a 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -201,7 +201,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) ? nMedianTimePast : pblock->GetBlockTime(); - if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight, nLockTimeCutoff)) + if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) continue; COrphan* porphan = NULL; From 26b2ea15b238c667589835e6bc211b78ed60b521 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 19:02:09 +0200 Subject: [PATCH 157/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 0a20e77d883..aa90e282ffc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -722,7 +722,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int break; if ( i == sizeof(grandfathered)/sizeof(*grandfathered) ) { - //fprintf(stderr,"IsFinalTx reject locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); + fprintf(stderr,"IsFinalTx reject locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx } } From 632f3348d428f8a9a30d6b7c3254373c25ed1ad6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 19:12:25 +0200 Subject: [PATCH 158/258] Test --- src/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index aa90e282ffc..2854986121e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -719,7 +719,10 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int { for (i=0; i Date: Tue, 21 Mar 2017 19:34:20 +0200 Subject: [PATCH 159/258] Test --- src/main.cpp | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2854986121e..145820fa2f2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,28 +706,31 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return true; } -bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) +int32_t komodo_grandfathered(uint32_t nBlockTime) { static uint32_t grandfathered[] = { 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684 }; + int32_t i; + for (i=0; i= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - for (i=0; i= LOCKTIME_THRESHOLD ) + { + locktime = komodo_interest_args(&txheight,&tiptime,&value,tx.GetHash(),0); + if ( tiptime == 0 ) + tiptime = activeChain.Tip()->nBlockTime; + if ( (int64_t)tx.nLockTime < tiptime-3600 ) + { + for (i=0; inBlockTime,tiptime); + return(-1); + } + } + } + return(0); +} + +bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash::ProofVerifier& verifier) { static uint256 array[15]; int32_t j,k,n; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); + if ( komodo_validate_interest(tx) < 0 ) + return(false); n = tx.vin.size(); for (j=0; j Date: Tue, 21 Mar 2017 19:37:05 +0200 Subject: [PATCH 160/258] Test --- src/main.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 145820fa2f2..dee1fee0dc2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -887,10 +887,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = activeChain.Tip()->nBlockTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - for (i=0; inBlockTime,tiptime); return(-1); From d3e0d78ef8f67a6aeb286d39196812981b83a133 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 19:38:17 +0200 Subject: [PATCH 161/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index dee1fee0dc2..ab9c721657a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -884,12 +884,12 @@ int32_t komodo_validate_interest(const CTransaction& tx) { locktime = komodo_interest_args(&txheight,&tiptime,&value,tx.GetHash(),0); if ( tiptime == 0 ) - tiptime = activeChain.Tip()->nBlockTime; + tiptime = chainActive.Tip()->nBlockTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { if ( komodo_grandfathered(tiptime) < 0 ) { - fprintf(stderr,"komodo_validate_interest reject locktime %u vs nBlockTime %u tiptime.%u\n",tx.nLockTime,(uint32_t)activeChain.Tip()->nBlockTime,tiptime); + fprintf(stderr,"komodo_validate_interest reject locktime %u vs nBlockTime %u tiptime.%u\n",tx.nLockTime,(uint32_t)chainActive.Tip()->nBlockTime,tiptime); return(-1); } } From f558cbb821752d91cf8820e11f1ed08ad696632e Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 19:39:52 +0200 Subject: [PATCH 162/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ab9c721657a..909879244ec 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -884,12 +884,12 @@ int32_t komodo_validate_interest(const CTransaction& tx) { locktime = komodo_interest_args(&txheight,&tiptime,&value,tx.GetHash(),0); if ( tiptime == 0 ) - tiptime = chainActive.Tip()->nBlockTime; + tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { if ( komodo_grandfathered(tiptime) < 0 ) { - fprintf(stderr,"komodo_validate_interest reject locktime %u vs nBlockTime %u tiptime.%u\n",tx.nLockTime,(uint32_t)chainActive.Tip()->nBlockTime,tiptime); + fprintf(stderr,"komodo_validate_interest reject locktime %u vs nBlockTime %u tiptime.%u\n",tx.nLockTime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); } } From db534a2714a3399aeca65c21df8443ba659eaeb8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 19:43:57 +0200 Subject: [PATCH 163/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 909879244ec..ab8372b9ee0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -710,7 +710,7 @@ int32_t komodo_grandfathered(uint32_t nBlockTime) { static uint32_t grandfathered[] = { - 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684 + 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684, 1490117937 }; int32_t i; for (i=0; i Date: Tue, 21 Mar 2017 19:50:52 +0200 Subject: [PATCH 164/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ab8372b9ee0..25ac6f92c04 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -710,7 +710,7 @@ int32_t komodo_grandfathered(uint32_t nBlockTime) { static uint32_t grandfathered[] = { - 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684, 1490117937 + 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684, 1490117937, 1490118373 }; int32_t i; for (i=0; i Date: Tue, 21 Mar 2017 19:55:42 +0200 Subject: [PATCH 165/258] Test --- src/rpcblockchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index b9242b71213..70456a63f96 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -581,7 +581,7 @@ Value paxpending(const Array& params, bool fHelp) Value paxprice(const Array& params, bool fHelp) { - if ( fHelp || params.size() > 3 || params.size() < 2 ) + if ( fHelp || params.size() > 4 || params.size() < 2 ) throw runtime_error("paxprice \"base\" \"rel\" height\n"); LOCK(cs_main); Object ret; uint64_t basevolume=0,relvolume,seed; From f2919b68d9e889143bf3aafdeb97c01677ba28ec Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 20:00:54 +0200 Subject: [PATCH 166/258] Test --- src/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 25ac6f92c04..9e617c79283 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -708,7 +708,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) int32_t komodo_grandfathered(uint32_t nBlockTime) { - static uint32_t grandfathered[] = + static uint32_t grandfathered[] = //1477262652 { 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684, 1490117937, 1490118373 }; @@ -726,10 +726,10 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( komodo_grandfathered(nBlockTime) < 0 ) + if ( komodo_grandfathered(tx.nLockTime) < 0 ) { - fprintf(stderr,"IsFinalTx reject locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); - return(false); // need to prevent pastdating tx + fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); + //return(false); // need to prevent pastdating tx } else fprintf(stderr,"IsFinalTx grandfather locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); } if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime)) @@ -887,10 +887,10 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( komodo_grandfathered(tiptime) < 0 ) + if ( komodo_grandfathered(locktime) < 0 ) { - fprintf(stderr,"komodo_validate_interest reject locktime %u vs nBlockTime %u tiptime.%u\n",tx.nLockTime,(uint32_t)chainActive.Tip()->nTime,tiptime); - return(-1); + fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); + //return(-1); } } } From 74a1cd7aa8eb1ffdef3dd2fb416927984168c0b3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:05:11 +0200 Subject: [PATCH 167/258] Test --- src/main.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 9e617c79283..bd17ab7228e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,16 +706,31 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return true; } -int32_t komodo_grandfathered(uint32_t nBlockTime) +int32_t komodo_grandfathered(uint32_t locktime) { static uint32_t grandfathered[] = //1477262652 { - 1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684, 1490117937, 1490118373 + //1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684, 1490117937, 1490118373 + 1477258935, 1477257204, 1477253947, 1477254016, 1477251241, 1477251105, 1477250875, 1477249280, + 1477249145, 1477249036, 1477248998, 1477248821, 1477248760, 1477248662, 1477248623, 1477248467, + 1477248430, 1477248389, 1477248268, 1477247602, 1477247563, 1477247480, 1477247443, 1477247152, + 1477246967, 1477246843, 1477246772, 1477246737, 1477246659, 1477246372, 1477246214, 1477245870, + 1477245519, 1477245434, 1477245280, 1477245043, 1477244956, 1477244721, 1477244574, 1477244444, + 1477244345, 1477244293, 1477253223, 1477253297, 1477252992, 1477253025, 1477256283, 1476963619, + 1480538961, 1480538961, 1481994241, 1485376185, 1485964187, 1486019481, 1486126273, 1486232034, + 1486231980, 1486158028, 1486381700, 1486367151, 1486369396, 1486369400, 1486369739, 1486381492, + 1486502320, 1486496032, 1486507806, 1486490938, 1485981956, 1486466190, 1487578969, 1487625710, + 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, + 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, + 1489817053, 1489814059, 1489958883 }; int32_t i; - for (i=0; inTime,tiptime); - //return(-1); + return(-1); } } } From ab00f04a853979c9fd80da206b48fbf2c50a1978 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:06:04 +0200 Subject: [PATCH 168/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index bd17ab7228e..0d3707c3f2b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -728,7 +728,7 @@ int32_t komodo_grandfathered(uint32_t locktime) if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) { for (i=0; i Date: Tue, 21 Mar 2017 21:09:53 +0200 Subject: [PATCH 169/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 0d3707c3f2b..9ac8021a7d2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -722,7 +722,7 @@ int32_t komodo_grandfathered(uint32_t locktime) 1486502320, 1486496032, 1486507806, 1486490938, 1485981956, 1486466190, 1487578969, 1487625710, 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, - 1489817053, 1489814059, 1489958883 + 1489817053, 1489814059, 1489958883, 1490114274 }; int32_t i; if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) From 434a4022159baa7a079acbc7f95665a12f8678fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:11:09 +0200 Subject: [PATCH 170/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 9ac8021a7d2..bc570ca8be5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -722,7 +722,7 @@ int32_t komodo_grandfathered(uint32_t locktime) 1486502320, 1486496032, 1486507806, 1486490938, 1485981956, 1486466190, 1487578969, 1487625710, 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, - 1489817053, 1489814059, 1489958883, 1490114274 + 1489817053, 1489814059, 1489958883, 1490116047, 1490114274 }; int32_t i; if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) From 2f612ccdb897dd5fe8166323aecdf7b1bec9a9b0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:15:04 +0200 Subject: [PATCH 171/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index bc570ca8be5..4e34fe67411 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -708,7 +708,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) int32_t komodo_grandfathered(uint32_t locktime) { - static uint32_t grandfathered[] = //1477262652 + static uint32_t grandfathered[] = { //1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684, 1490117937, 1490118373 1477258935, 1477257204, 1477253947, 1477254016, 1477251241, 1477251105, 1477250875, 1477249280, @@ -722,7 +722,7 @@ int32_t komodo_grandfathered(uint32_t locktime) 1486502320, 1486496032, 1486507806, 1486490938, 1485981956, 1486466190, 1487578969, 1487625710, 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, - 1489817053, 1489814059, 1489958883, 1490116047, 1490114274 + 1489817053, 1489814059, 1489958883, 1490112397, 1490116047, 1490114274 }; int32_t i; if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) From d0dd66ccef2a0561ac7f6d854121e5dbcb3d1a69 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:17:34 +0200 Subject: [PATCH 172/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 4e34fe67411..f161c51caa8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -722,7 +722,7 @@ int32_t komodo_grandfathered(uint32_t locktime) 1486502320, 1486496032, 1486507806, 1486490938, 1485981956, 1486466190, 1487578969, 1487625710, 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, - 1489817053, 1489814059, 1489958883, 1490112397, 1490116047, 1490114274 + 1489817053, 1489814059, 1489958883, 1490112310, 1490112397, 1490116047, 1490114274 }; int32_t i; if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) From b1e0f66f79a1158fdd1aacdaec4887d6e573bf69 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:19:51 +0200 Subject: [PATCH 173/258] Test --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f161c51caa8..a1fdab2ba2c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -723,6 +723,9 @@ int32_t komodo_grandfathered(uint32_t locktime) 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, 1489817053, 1489814059, 1489958883, 1490112310, 1490112397, 1490116047, 1490114274 + komodo_validate_interest reject locktime 1477252992/0 vs nBlockTime 1477262652 tiptime.1477262652 + komodo_validate_interest reject locktime 1477253223/0 vs nBlockTime 1477262652 tiptime.1477262652 + komodo_validate_interest reject locktime 1477256283/0 vs nBlockTime 1477262652 tiptime.1477262652 }; int32_t i; if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) @@ -902,7 +905,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( komodo_grandfathered(locktime) < 0 ) + if ( komodo_grandfathered(tx.nLockTime) < 0 ) { fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); From c60333cb226fd28849a0ddb611e2c45ca5ad4996 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:20:40 +0200 Subject: [PATCH 174/258] Test --- src/main.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a1fdab2ba2c..4f11b7154ff 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -722,10 +722,7 @@ int32_t komodo_grandfathered(uint32_t locktime) 1486502320, 1486496032, 1486507806, 1486490938, 1485981956, 1486466190, 1487578969, 1487625710, 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, - 1489817053, 1489814059, 1489958883, 1490112310, 1490112397, 1490116047, 1490114274 - komodo_validate_interest reject locktime 1477252992/0 vs nBlockTime 1477262652 tiptime.1477262652 - komodo_validate_interest reject locktime 1477253223/0 vs nBlockTime 1477262652 tiptime.1477262652 - komodo_validate_interest reject locktime 1477256283/0 vs nBlockTime 1477262652 tiptime.1477262652 + 1489817053, 1489814059, 1489958883, 1490111575, 1490112310, 1490112397, 1490116047, 1490114274, }; int32_t i; if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) From b306ed25a169f2adcfb22f3d7b257daf5c54abd2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:23:10 +0200 Subject: [PATCH 175/258] Test --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 4f11b7154ff..31e185fcea4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -722,7 +722,8 @@ int32_t komodo_grandfathered(uint32_t locktime) 1486502320, 1486496032, 1486507806, 1486490938, 1485981956, 1486466190, 1487578969, 1487625710, 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, - 1489817053, 1489814059, 1489958883, 1490111575, 1490112310, 1490112397, 1490116047, 1490114274, + 1489817053, 1489814059, 1489958883, 1490111575, 1490111662, 1490112310, 1490112397, 1490116047, + 1490114274, }; int32_t i; if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) From 44ee43fee86537886dfb085b166a9ddb2835f892 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:26:22 +0200 Subject: [PATCH 176/258] Test --- src/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 31e185fcea4..5428923302f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -722,8 +722,8 @@ int32_t komodo_grandfathered(uint32_t locktime) 1486502320, 1486496032, 1486507806, 1486490938, 1485981956, 1486466190, 1487578969, 1487625710, 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, - 1489817053, 1489814059, 1489958883, 1490111575, 1490111662, 1490112310, 1490112397, 1490116047, - 1490114274, + 1489817053, 1489814059, 1489958883, 1490111575, 1490111662, 1490111716, 1490112310, 1490112397, + 1490116047, 1490114274, }; int32_t i; if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) @@ -735,6 +735,8 @@ int32_t komodo_grandfathered(uint32_t locktime) return(-1); } +#define KOMODO_GRANDFATHER_TIME 0 + bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) { int32_t i; @@ -742,7 +744,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( komodo_grandfathered(tx.nLockTime) < 0 ) + if ( komodo_grandfathered(tx.nLockTime) < 0 && nBlockTime > KOMODO_GRANDFATHER_TIME ) { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -903,7 +905,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( komodo_grandfathered(tx.nLockTime) < 0 ) + if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) { fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); From 9294f7be443a58b87d2a44f1cf6798305afca9ea Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:30:04 +0200 Subject: [PATCH 177/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5428923302f..23bf9f52463 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -722,8 +722,8 @@ int32_t komodo_grandfathered(uint32_t locktime) 1486502320, 1486496032, 1486507806, 1486490938, 1485981956, 1486466190, 1487578969, 1487625710, 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, - 1489817053, 1489814059, 1489958883, 1490111575, 1490111662, 1490111716, 1490112310, 1490112397, - 1490116047, 1490114274, + 1489817053, 1489814059, 1489958883, 1490111575, 1490111662, 1490111716, 1490111757, 1490112310, + 1490112397, 1490116047, 1490114274, }; int32_t i; if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) From 5f9bde7f43e73d4f995cba5dd031df839962f786 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:34:03 +0200 Subject: [PATCH 178/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 23bf9f52463..2a29baca6f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -723,7 +723,7 @@ int32_t komodo_grandfathered(uint32_t locktime) 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, 1489817053, 1489814059, 1489958883, 1490111575, 1490111662, 1490111716, 1490111757, 1490112310, - 1490112397, 1490116047, 1490114274, + 1490112397, 1490114274, 1490116047, }; int32_t i; if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) @@ -735,7 +735,7 @@ int32_t komodo_grandfathered(uint32_t locktime) return(-1); } -#define KOMODO_GRANDFATHER_TIME 0 +#define KOMODO_GRANDFATHER_TIME (1490114274 + 3600*12) bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) { From b52e11c015acdabaf171943274e0a47bd37e534b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:45:19 +0200 Subject: [PATCH 179/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2a29baca6f9..ab60b627f4f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -735,7 +735,7 @@ int32_t komodo_grandfathered(uint32_t locktime) return(-1); } -#define KOMODO_GRANDFATHER_TIME (1490114274 + 3600*12) +#define KOMODO_GRANDFATHER_TIME (1490114274 + 3600*24) bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) { @@ -744,7 +744,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( komodo_grandfathered(tx.nLockTime) < 0 && nBlockTime > KOMODO_GRANDFATHER_TIME ) + if ( komodo_grandfathered(tx.nLockTime) < 0 )//&& nBlockTime > KOMODO_GRANDFATHER_TIME ) { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx From a87100de4c605eca69b2e8df2086285dd3fa4be8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 21 Mar 2017 21:55:59 +0200 Subject: [PATCH 180/258] Height 250000 update --- src/komodo_interest.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 0d11992ab9b..96ba7923e78 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -75,7 +75,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin { if ( minutes > 365 * 24 * 60 ) minutes = 365 * 24 * 60; - if ( txheight >= 275000 ) + if ( txheight >= 250000 ) minutes -= 59; denominator = (((uint64_t)365 * 24 * 60) / minutes); if ( denominator == 0 ) @@ -106,7 +106,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin if ( exception == 0 ) { numerator = (nValue / 20); // assumes 5%! - if ( txheight < 275000 ) + if ( txheight < 250000 ) interest = (numerator / denominator); else interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60); } @@ -119,7 +119,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin else { numerator = (nValue * KOMODO_INTEREST); - if ( txheight < 275000 || numerator * minutes < 365 * 24 * 60 ) + if ( txheight < 250000 || numerator * minutes < 365 * 24 * 60 ) interest = (numerator / denominator) / COIN; else interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / COIN; } From b694af59bdeaa8b84a564b77e34b075e19d76929 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 06:07:01 +0200 Subject: [PATCH 181/258] Shrink grandfather window --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ab60b627f4f..8a1e0380fb6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -735,7 +735,7 @@ int32_t komodo_grandfathered(uint32_t locktime) return(-1); } -#define KOMODO_GRANDFATHER_TIME (1490114274 + 3600*24) +#define KOMODO_GRANDFATHER_TIME (1490155211 + 3600) //(1490114274 + 3600*24) bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) { From 77bbe2471eb01928456c69f4b309c53331b0f406 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:12:50 +0200 Subject: [PATCH 182/258] test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 8a1e0380fb6..1c319db816b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -905,7 +905,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) + if ( komodo_grandfathered(tx.nLockTime) < 0 )//&& tiptime > KOMODO_GRANDFATHER_TIME ) { fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); From 68d59d5bad4b596f3e279ed0b925500060de9393 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:16:33 +0200 Subject: [PATCH 183/258] Revert "test" This reverts commit 77bbe2471eb01928456c69f4b309c53331b0f406. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 1c319db816b..8a1e0380fb6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -905,7 +905,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( komodo_grandfathered(tx.nLockTime) < 0 )//&& tiptime > KOMODO_GRANDFATHER_TIME ) + if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) { fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); From 3ffe93d8155abeab266b85982dc62443fd402946 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:46:29 +0200 Subject: [PATCH 184/258] Test --- src/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8a1e0380fb6..ff27a1d717a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,7 +706,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return true; } -int32_t komodo_grandfathered(uint32_t locktime) +/*int32_t komodo_grandfathered(uint32_t locktime) { static uint32_t grandfathered[] = { @@ -736,6 +736,7 @@ int32_t komodo_grandfathered(uint32_t locktime) } #define KOMODO_GRANDFATHER_TIME (1490155211 + 3600) //(1490114274 + 3600*24) +*/ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) { @@ -744,7 +745,8 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( komodo_grandfathered(tx.nLockTime) < 0 )//&& nBlockTime > KOMODO_GRANDFATHER_TIME ) + if ( nBlockTime > 1490159171 ) // 246748 + //if ( komodo_grandfathered(tx.nLockTime) < 0 )//&& nBlockTime > KOMODO_GRANDFATHER_TIME ) { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -905,7 +907,8 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) + if ( nBlockTime > 1490159171 ) // 246748 + //if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) { fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); From f656b6a5b00cd513448c8c4cb1ae52baff5e7c11 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:47:36 +0200 Subject: [PATCH 185/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ff27a1d717a..7af975b4db3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -907,7 +907,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( nBlockTime > 1490159171 ) // 246748 + if ( tiptime > 1490159171 ) // 246748 //if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) { fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); From 5c60cb4546faf2a7a32c2a48f9ee5bae01e75602 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:50:05 +0200 Subject: [PATCH 186/258] Hardcode 1490159171 --- src/main.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7af975b4db3..0c2d9769426 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,38 +706,6 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return true; } -/*int32_t komodo_grandfathered(uint32_t locktime) -{ - static uint32_t grandfathered[] = - { - //1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684, 1490117937, 1490118373 - 1477258935, 1477257204, 1477253947, 1477254016, 1477251241, 1477251105, 1477250875, 1477249280, - 1477249145, 1477249036, 1477248998, 1477248821, 1477248760, 1477248662, 1477248623, 1477248467, - 1477248430, 1477248389, 1477248268, 1477247602, 1477247563, 1477247480, 1477247443, 1477247152, - 1477246967, 1477246843, 1477246772, 1477246737, 1477246659, 1477246372, 1477246214, 1477245870, - 1477245519, 1477245434, 1477245280, 1477245043, 1477244956, 1477244721, 1477244574, 1477244444, - 1477244345, 1477244293, 1477253223, 1477253297, 1477252992, 1477253025, 1477256283, 1476963619, - 1480538961, 1480538961, 1481994241, 1485376185, 1485964187, 1486019481, 1486126273, 1486232034, - 1486231980, 1486158028, 1486381700, 1486367151, 1486369396, 1486369400, 1486369739, 1486381492, - 1486502320, 1486496032, 1486507806, 1486490938, 1485981956, 1486466190, 1487578969, 1487625710, - 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, - 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, - 1489817053, 1489814059, 1489958883, 1490111575, 1490111662, 1490111716, 1490111757, 1490112310, - 1490112397, 1490114274, 1490116047, - }; - int32_t i; - if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) - { - for (i=0; i= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { if ( nBlockTime > 1490159171 ) // 246748 - //if ( komodo_grandfathered(tx.nLockTime) < 0 )//&& nBlockTime > KOMODO_GRANDFATHER_TIME ) { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -908,7 +875,6 @@ int32_t komodo_validate_interest(const CTransaction& tx) if ( (int64_t)tx.nLockTime < tiptime-3600 ) { if ( tiptime > 1490159171 ) // 246748 - //if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) { fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); From d8268972fb320c2af2e3bc71d394c4e2b03b77e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:52:42 +0200 Subject: [PATCH 187/258] Test --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 0c2d9769426..a2248853381 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -876,7 +876,9 @@ int32_t komodo_validate_interest(const CTransaction& tx) { if ( tiptime > 1490159171 ) // 246748 { - fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); + static uint32_t counter; + if ( counter++ < 100 ) + fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); } } From 082d65d2069c0fa91683c6294ed2094191145f45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 09:21:40 +0200 Subject: [PATCH 188/258] Test --- src/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a2248853381..efa369ea0d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,7 +713,8 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockTime > 1490159171 ) // 246748 + if ( nBlockHeight > 246748 ) + //if ( nBlockTime > 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -874,11 +875,12 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime > 1490159171 ) // 246748 + //if ( tiptime > 1490159171 ) // 246748 + if ( txheight > 246748 ) { static uint32_t counter; if ( counter++ < 100 ) - fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); + fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); } } From 8886b0acc7fd29ebe3949e3a392e699f839729a0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 09:29:42 +0200 Subject: [PATCH 189/258] Revert "Test" This reverts commit 082d65d2069c0fa91683c6294ed2094191145f45. --- src/main.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index efa369ea0d7..a2248853381 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,8 +713,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockHeight > 246748 ) - //if ( nBlockTime > 1490159171 ) // 246748 + if ( nBlockTime > 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -875,12 +874,11 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - //if ( tiptime > 1490159171 ) // 246748 - if ( txheight > 246748 ) + if ( tiptime > 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) - fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); + fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); } } From 228d46dee6e74bc4d7dd0643f248385fbdc27e57 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 09:47:57 +0200 Subject: [PATCH 190/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a2248853381..a8c654d54f8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,7 +713,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockTime > 1490159171 ) // 246748 + if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -874,7 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime > 1490159171 ) // 246748 + if ( tiptime >= 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From bab020f8beb27a3e36a0ffc41b63a4871cc3ea1f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 09:58:57 +0200 Subject: [PATCH 191/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a8c654d54f8..fe9f7f510e6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -874,7 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime >= 1490159171 ) // 246748 + if ( tiptime > 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From 8b05d7f20ddafcf6c048adee546e17985511ca97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 10:07:51 +0200 Subject: [PATCH 192/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index fe9f7f510e6..a8c654d54f8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -874,7 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime > 1490159171 ) // 246748 + if ( tiptime >= 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From 64a80d765821b1ba1ada42465f426ce015387b87 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 10:36:33 +0200 Subject: [PATCH 193/258] Test --- src/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a8c654d54f8..373d44f22ae 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,7 +713,8 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockTime >= 1490159171 ) // 246748 + //if ( nBlockTime >= 1490159171 ) // 246748 + if ( nBlockHeight > 246748 ) { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -874,7 +875,8 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime >= 1490159171 ) // 246748 + //if ( tiptime > 1490159171 ) // 246748 + if ( txheight > 246748 ) { static uint32_t counter; if ( counter++ < 100 ) From 57010b98ffed01082e8f7610fb8a682e41df8e78 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 10:40:23 +0200 Subject: [PATCH 194/258] Test --- src/main.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 373d44f22ae..fe9f7f510e6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,8 +713,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - //if ( nBlockTime >= 1490159171 ) // 246748 - if ( nBlockHeight > 246748 ) + if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -875,8 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - //if ( tiptime > 1490159171 ) // 246748 - if ( txheight > 246748 ) + if ( tiptime > 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From d1370f18fad64e77247c2cf40e2454c707f89709 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 10:52:51 +0200 Subject: [PATCH 195/258] Test --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index fe9f7f510e6..0656d529577 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -715,9 +715,9 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int { if ( nBlockTime >= 1490159171 ) // 246748 { - fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); + fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx - } else fprintf(stderr,"IsFinalTx grandfather locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); + } else fprintf(stderr,"IsFinalTx grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); } if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime)) return true; @@ -878,7 +878,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) { static uint32_t counter; if ( counter++ < 100 ) - fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); + fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); } } From 6b19769fda67feaa56b06df62e5a5707fc3c03d4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 10:58:11 +0200 Subject: [PATCH 196/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0656d529577..b0831d15563 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,7 +713,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockTime >= 1490159171 ) // 246748 + if ( nBlockTime > 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -874,7 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime > 1490159171 ) // 246748 + if ( tiptime >= 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From 3bc8ab81e6c816f78fea68ade9b758582ca958aa Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 11:08:49 +0200 Subject: [PATCH 197/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b0831d15563..a62103f7c98 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,7 +713,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockTime > 1490159171 ) // 246748 + if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -874,7 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime >= 1490159171 ) // 246748 + if ( tiptime > 1490159171 || (txheight == 0 && tiptime >= 1490159171) ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From 572e8f4668c312e95b7ed83d53485f4091c67eb9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 12:32:20 +0200 Subject: [PATCH 198/258] test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a62103f7c98..a8e283b3d87 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3308,7 +3308,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST) ? pindexPrev->GetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,0)) { + if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } From c70da04f91c70e5745bec10c1b856377e8c83b3a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 12:58:08 +0200 Subject: [PATCH 199/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a8e283b3d87..d2daa67d1c9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -891,8 +891,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash:: static uint256 array[15]; int32_t j,k,n; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); - if ( komodo_validate_interest(tx) < 0 ) - return(false); + //if ( komodo_validate_interest(tx) < 0 ) + // return(false); n = tx.vin.size(); for (j=0; j Date: Wed, 22 Mar 2017 13:02:06 +0200 Subject: [PATCH 200/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d2daa67d1c9..a8e283b3d87 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -891,8 +891,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash:: static uint256 array[15]; int32_t j,k,n; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); - //if ( komodo_validate_interest(tx) < 0 ) - // return(false); + if ( komodo_validate_interest(tx) < 0 ) + return(false); n = tx.vin.size(); for (j=0; j Date: Wed, 22 Mar 2017 13:28:50 +0200 Subject: [PATCH 201/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a8e283b3d87..a62103f7c98 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3308,7 +3308,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST) ? pindexPrev->GetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) { + if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,0)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } From 886a58ba8bf8fd62cf79973dedc1916a55ff21fa Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 13:43:43 +0200 Subject: [PATCH 202/258] Test --- src/main.cpp | 60 +++++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a62103f7c98..42ffa2e503e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,18 +706,46 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return true; } +int32_t komodo_validate_interest(const CTransaction& tx) +{ + int32_t i,txheight=0; uint32_t prevblocktime=0,locktime; uint64_t value=0; + if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD ) + { + locktime = komodo_interest_args(&txheight,&prevblocktime,&value,tx.GetHash(),0); + if ( prevblocktime == 0 ) + { + prevblocktime = chainActive.Tip()->nTime; + fprintf(stderr,"error getting prevblocktime, set to tiptime.%u\n",prevblocktime); + } + if ( (int64_t)tx.nLockTime < prevblocktime-3600 ) + { + if ( tiptime > 1490159171 || (txheight == 0 && prevblocktime >= 1490159171) ) // 246748 + { + static uint32_t counter; + if ( counter++ < 100 ) + fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u prevblocktime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,prevblocktime); + return(-1); + } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)txheight,tx.nLockTime,(uint32_t)prevblocktime); + } + } + return(0); +} + bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) { int32_t i; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD )//&& (int64_t)tx.nLockTime < nBlockTime-3600 ) { + if ( komodo_validate_interest(tx) < 0 ) + return(false); + /* if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx - } else fprintf(stderr,"IsFinalTx grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); + } else fprintf(stderr,"IsFinalTx grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime);*/ } if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime)) return true; @@ -864,35 +892,13 @@ unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& in return nSigOps; } -int32_t komodo_validate_interest(const CTransaction& tx) -{ - int32_t i,txheight=0; uint32_t tiptime=0,locktime; uint64_t value=0; - if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD ) - { - locktime = komodo_interest_args(&txheight,&tiptime,&value,tx.GetHash(),0); - if ( tiptime == 0 ) - tiptime = chainActive.Tip()->nTime; - if ( (int64_t)tx.nLockTime < tiptime-3600 ) - { - if ( tiptime > 1490159171 || (txheight == 0 && tiptime >= 1490159171) ) // 246748 - { - static uint32_t counter; - if ( counter++ < 100 ) - fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); - return(-1); - } - } - } - return(0); -} - bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash::ProofVerifier& verifier) { static uint256 array[15]; int32_t j,k,n; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); - if ( komodo_validate_interest(tx) < 0 ) - return(false); + //if ( komodo_validate_interest(tx) < 0 ) + // return(false); n = tx.vin.size(); for (j=0; jGetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,0)) { + if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } From 661daa22580615256ce3e19b6e56aba9866d67c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 13:45:02 +0200 Subject: [PATCH 203/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 42ffa2e503e..80e77a733bc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -719,7 +719,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) } if ( (int64_t)tx.nLockTime < prevblocktime-3600 ) { - if ( tiptime > 1490159171 || (txheight == 0 && prevblocktime >= 1490159171) ) // 246748 + if ( prevblocktime > 1490159171 || (txheight == 0 && prevblocktime >= 1490159171) ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From ab22c26ab77cc71811081b5fa2063e833be54ed9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 13:57:23 +0200 Subject: [PATCH 204/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 80e77a733bc..a12d8899446 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1158,7 +1158,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa // be mined yet. if (!CheckFinalTx(tx, STANDARD_LOCKTIME_VERIFY_FLAGS)) { - fprintf(stderr,"AcceptToMemoryPool non-final\n"); + fprintf(stderr,"AcceptToMemoryPool reject non-final\n"); return state.DoS(0, false, REJECT_NONSTANDARD, "non-final"); } // is it already in the memory pool? From af484891141de188d52ecc7d43792db4c5bac622 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 14:22:31 +0200 Subject: [PATCH 205/258] Remove prints --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a12d8899446..2233faed8de 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -714,8 +714,10 @@ int32_t komodo_validate_interest(const CTransaction& tx) locktime = komodo_interest_args(&txheight,&prevblocktime,&value,tx.GetHash(),0); if ( prevblocktime == 0 ) { + static uint32_t counter0; prevblocktime = chainActive.Tip()->nTime; - fprintf(stderr,"error getting prevblocktime, set to tiptime.%u\n",prevblocktime); + if ( counter0++ < 100 ) + fprintf(stderr,"error getting prevblocktime, set to tiptime.%u\n",prevblocktime); } if ( (int64_t)tx.nLockTime < prevblocktime-3600 ) { From a3197ff2e7a4d241843062cba5bb3111256ebeb1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 14:23:45 +0200 Subject: [PATCH 206/258] Synchronize to 60 --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index f53c7086a8a..ad671896d4f 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -100,7 +100,7 @@ void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, #define ASSETCHAINS_MINHEIGHT 100 #define KOMODO_ELECTION_GAP 2000 -#define ROUNDROBIN_DELAY 59 +#define ROUNDROBIN_DELAY 60 extern int32_t ASSETCHAINS_SEED,IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAIN_INIT,KOMODO_INITDONE,KOMODO_ON_DEMAND,KOMODO_INITDONE,KOMODO_PASSPORT_INITDONE; extern char ASSETCHAINS_SYMBOL[16]; extern std::string NOTARY_PUBKEY; From 198286a59a2850d43e7189a9dd918169bf217b85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 14:43:24 +0200 Subject: [PATCH 207/258] Test --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index ad671896d4f..ab95c4aa628 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -846,7 +846,7 @@ void static BitcoinMiner(CWallet *pwallet) } if ((UintToArith256(pblock->nNonce) & 0xffff) == 0xffff) { - if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) + //if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"0xffff, break\n"); break; } From e7fa1876d518e94aefe281a667aef6ad04ecb5d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 15:56:36 +0200 Subject: [PATCH 208/258] Test --- src/komodo_gateway.h | 2 +- src/main.cpp | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 8e9af6a0448..84ce254f36b 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1430,7 +1430,7 @@ void komodo_passport_iteration() printf("from.(%s) lastpos[%s] %ld isrt.%d\n",ASSETCHAINS_SYMBOL,CURRENCIES[baseid],lastpos[baseid],komodo_isrealtime(&ht)); } //else fprintf(stderr,"%s.%ld ",CURRENCIES[baseid],ftell(fp)); fclose(fp); - } else printf("error.(%s) %p\n",fname,sp); + } //else printf("error.(%s) %p\n",fname,sp); komodo_statefname(fname,baseid<32?base:(char *)"",(char *)"realtime"); if ( (fp= fopen(fname,"rb")) != 0 ) { diff --git a/src/main.cpp b/src/main.cpp index 2233faed8de..f926c71a865 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -716,7 +716,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) { static uint32_t counter0; prevblocktime = chainActive.Tip()->nTime; - if ( counter0++ < 100 ) + if ( counter0++ < 3 ) fprintf(stderr,"error getting prevblocktime, set to tiptime.%u\n",prevblocktime); } if ( (int64_t)tx.nLockTime < prevblocktime-3600 ) @@ -740,14 +740,13 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD )//&& (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( komodo_validate_interest(tx) < 0 ) - return(false); - /* + //if ( komodo_validate_interest(tx) < 0 ) + // return(false); if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx - } else fprintf(stderr,"IsFinalTx grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime);*/ + } else fprintf(stderr,"IsFinalTx grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); } if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime)) return true; @@ -1137,6 +1136,11 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa if (pfMissingInputs) *pfMissingInputs = false; auto verifier = libzcash::ProofVerifier::Strict(); + if ( komodo_validate_interest(tx) < 0 ) + { + fprintf(stderr,"komodo_validate_interest failure\n"); + return error("AcceptToMemoryPool: komodo_validate_interest failed"); + } if (!CheckTransaction(tx, state, verifier)) { fprintf(stderr,"accept failure.0\n"); From 3640e4c9b2734b932b62048341f6d38e56eac6a6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 16:08:33 +0200 Subject: [PATCH 209/258] Test --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f926c71a865..6deb2947c26 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -898,8 +898,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash:: static uint256 array[15]; int32_t j,k,n; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); - //if ( komodo_validate_interest(tx) < 0 ) - // return(false); + if ( komodo_validate_interest(tx) < 0 ) + return(false); n = tx.vin.size(); for (j=0; jGetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) { + if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,0*STANDARD_LOCKTIME_VERIFY_FLAGS)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } From 72afbcf22425a56d69aa8e41b60bfb15b133d831 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 16:25:43 +0200 Subject: [PATCH 210/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6deb2947c26..62772290728 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -738,11 +738,11 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int int32_t i; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD )//&& (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { //if ( komodo_validate_interest(tx) < 0 ) // return(false); - if ( nBlockTime >= 1490159171 ) // 246748 + if ( nBlockTime >= 1490159171 || nBlockHeight > 246748 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx From 83da1e16c306b9d426188ad16dfb50d6f3084422 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 17:12:40 +0200 Subject: [PATCH 211/258] Test --- src/komodo_bitcoind.h | 7 ++++--- src/main.cpp | 18 +++++++++--------- src/rpcblockchain.cpp | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index d575b02b106..36b16bde220 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -740,7 +740,7 @@ int32_t komodo_checkpoint(int32_t *notarized_heightp,int32_t nHeight,uint256 has return(0); } -uint32_t komodo_interest_args(int32_t *txheightp,uint32_t *tiptimep,uint64_t *valuep,uint256 hash,int32_t n) +uint32_t komodo_interest_args(uint32_t *txheighttimep,int32_t *txheightp,uint32_t *tiptimep,uint64_t *valuep,uint256 hash,int32_t n) { LOCK(cs_main); CTransaction tx; uint256 hashBlock; CBlockIndex *pindex,*tipindex; @@ -753,6 +753,7 @@ uint32_t komodo_interest_args(int32_t *txheightp,uint32_t *tiptimep,uint64_t *va { *valuep = tx.vout[n].nValue; *txheightp = pindex->nHeight; + *txheighttimep = pindex->nTime; *tiptimep = tipindex->nTime; locktime = tx.nLockTime; //fprintf(stderr,"tx locktime.%u %.8f height.%d | tiptime.%u\n",locktime,(double)*valuep/COIN,*txheightp,*tiptimep); @@ -764,8 +765,8 @@ uint32_t komodo_interest_args(int32_t *txheightp,uint32_t *tiptimep,uint64_t *va uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime); uint64_t komodo_accrued_interest(int32_t *txheightp,uint32_t *locktimep,uint256 hash,int32_t n,int32_t checkheight,uint64_t checkvalue) { - uint64_t value; uint32_t tiptime; - if ( (*locktimep= komodo_interest_args(txheightp,&tiptime,&value,hash,n)) != 0 ) + uint64_t value; uint32_t tiptime,txheighttimep; + if ( (*locktimep= komodo_interest_args(&txheighttimep,txheightp,&tiptime,&value,hash,n)) != 0 ) { if ( (checkvalue == 0 || value == checkvalue) && (checkheight == 0 || *txheightp == checkheight) ) return(komodo_interest(*txheightp,value,*locktimep,tiptime)); diff --git a/src/main.cpp b/src/main.cpp index 62772290728..10d0d29e152 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -708,26 +708,26 @@ bool IsStandardTx(const CTransaction& tx, string& reason) int32_t komodo_validate_interest(const CTransaction& tx) { - int32_t i,txheight=0; uint32_t prevblocktime=0,locktime; uint64_t value=0; + int32_t i,txheight=0; uint32_t txheighttime,tiptime=0,locktime; uint64_t value=0; if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD ) { - locktime = komodo_interest_args(&txheight,&prevblocktime,&value,tx.GetHash(),0); - if ( prevblocktime == 0 ) + locktime = komodo_interest_args(&txheighttime,&txheight,&tiptime,&value,tx.GetHash(),0); + if ( txheighttime == 0 ) { static uint32_t counter0; - prevblocktime = chainActive.Tip()->nTime; + txheighttime = tiptime; if ( counter0++ < 3 ) - fprintf(stderr,"error getting prevblocktime, set to tiptime.%u\n",prevblocktime); + fprintf(stderr,"error getting txheighttime, set to tiptime.%u\n",tiptime); } - if ( (int64_t)tx.nLockTime < prevblocktime-3600 ) + if ( (int64_t)tx.nLockTime < txheighttime-3600 ) { - if ( prevblocktime > 1490159171 || (txheight == 0 && prevblocktime >= 1490159171) ) // 246748 + if ( txheighttime > 1490159171 || (txheight == 0 && txheighttime >= 1490159171) ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) - fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u prevblocktime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,prevblocktime); + fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime); return(-1); - } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)txheight,tx.nLockTime,(uint32_t)prevblocktime); + } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs nBlockTime %u txheighttime.%u\n",(int32_t)txheight,tx.nLockTime,(uint32_t)prevblocktime,txheighttime); } } return(0); diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 70456a63f96..b1fa9d3d5a8 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -406,7 +406,7 @@ uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uin int32_t komodo_paxprices(int32_t *heights,uint64_t *prices,int32_t max,char *base,char *rel); int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height); char *bitcoin_address(char *coinaddr,uint8_t addrtype,uint8_t *pubkey_or_rmd160,int32_t len); -uint32_t komodo_interest_args(int32_t *txheightp,uint32_t *tiptimep,uint64_t *valuep,uint256 hash,int32_t n); +//uint32_t komodo_interest_args(int32_t *txheightp,uint32_t *tiptimep,uint64_t *valuep,uint256 hash,int32_t n); int32_t komodo_minerids(uint8_t *minerids,int32_t height,int32_t width); int32_t komodo_kvsearch(uint256 *refpubkeyp,int32_t current_height,uint32_t *flagsp,int32_t *heightp,uint8_t value[IGUANA_MAXSCRIPTSIZE],uint8_t *key,int32_t keylen); From eab04ab9c820e8fb080991c19075c4d6f8833139 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 17:15:35 +0200 Subject: [PATCH 212/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 10d0d29e152..d893a897c09 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -727,7 +727,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) if ( counter++ < 100 ) fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime); return(-1); - } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs nBlockTime %u txheighttime.%u\n",(int32_t)txheight,tx.nLockTime,(uint32_t)prevblocktime,txheighttime); + } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime); } } return(0); From 63c93b0c0e26907de07087f66d1f7529004c7f1a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 17:20:30 +0200 Subject: [PATCH 213/258] Test --- src/komodo_bitcoind.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 36b16bde220..481ede10440 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -744,6 +744,8 @@ uint32_t komodo_interest_args(uint32_t *txheighttimep,int32_t *txheightp,uint32_ { LOCK(cs_main); CTransaction tx; uint256 hashBlock; CBlockIndex *pindex,*tipindex; + *txheighttimep = *txheightp = *tiptimep = 0; + *valuep = 0; if ( !GetTransaction(hash,tx,hashBlock,true) ) return(0); uint32_t locktime = 0; From 36f4d2cdc6bf4a77956697ec15e541ff7828ddc3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 17:25:32 +0200 Subject: [PATCH 214/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d893a897c09..3f944a3bc24 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -715,9 +715,9 @@ int32_t komodo_validate_interest(const CTransaction& tx) if ( txheighttime == 0 ) { static uint32_t counter0; - txheighttime = tiptime; + txheighttime = chainActive.Tip()->nTime; if ( counter0++ < 3 ) - fprintf(stderr,"error getting txheighttime, set to tiptime.%u\n",tiptime); + fprintf(stderr,"error getting txheighttime, set to tiptime.%u\n",txheighttime); } if ( (int64_t)tx.nLockTime < txheighttime-3600 ) { From 89e99094aafca9ee6191d19441e3040c2b5dfaa8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 17:29:04 +0200 Subject: [PATCH 215/258] Test --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3f944a3bc24..f8a32e0001f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -898,8 +898,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash:: static uint256 array[15]; int32_t j,k,n; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); - if ( komodo_validate_interest(tx) < 0 ) - return(false); + //if ( komodo_validate_interest(tx) < 0 ) + // return(false); n = tx.vin.size(); for (j=0; jGetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,0*STANDARD_LOCKTIME_VERIFY_FLAGS)) { + if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } From ff51a18d9ac97167df78845f2fb56e54f23bf2a1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 17:38:04 +0200 Subject: [PATCH 216/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f8a32e0001f..6bf802ef8a6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -898,8 +898,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash:: static uint256 array[15]; int32_t j,k,n; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); - //if ( komodo_validate_interest(tx) < 0 ) - // return(false); + if ( komodo_validate_interest(tx) < 0 ) + return(false); n = tx.vin.size(); for (j=0; j Date: Wed, 22 Mar 2017 17:42:45 +0200 Subject: [PATCH 217/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 6bf802ef8a6..3f944a3bc24 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3320,7 +3320,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST) ? pindexPrev->GetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) { + if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,0*STANDARD_LOCKTIME_VERIFY_FLAGS)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } From 3750f5afb810088a52f57e0ca3965c4f9b895d60 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 18:00:08 +0200 Subject: [PATCH 218/258] 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 84ce254f36b..14ad70405b9 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -717,8 +717,8 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above extern int32_t KOMODO_REWIND; if ( KOMODO_REWIND < 0 ) { - fprintf(stderr,"rewind.%d\n",KOMODO_REWIND); - sleep(3); + fprintf(stderr,">>>>>>> rewind.%d will pause here for a minute. issue command and stop\n",KOMODO_REWIND); + sleep(60); KOMODO_REWIND = 0; } // 6a35506c65617365206d616b6520796f75722047697420636f6d6d6974206d65737361676573206d6f726520696e74657265737469 height.241778 checkdeposit n.4 [6a] [P] 80 vs 88 From 6ff77181f26f61fdd23d7cc61f5cf072881bf9fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 18:23:20 +0200 Subject: [PATCH 219/258] Test --- src/main.cpp | 17 +++++++++++------ src/main.h | 2 +- src/miner.cpp | 12 +++++++++--- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3f944a3bc24..d258d185c05 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -721,7 +721,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) } if ( (int64_t)tx.nLockTime < txheighttime-3600 ) { - if ( txheighttime > 1490159171 || (txheight == 0 && txheighttime >= 1490159171) ) // 246748 + if ( txheighttime > 1490159171 )//|| (txheight == 0 && txheighttime >= 1490159171) ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) @@ -733,18 +733,20 @@ int32_t komodo_validate_interest(const CTransaction& tx) return(0); } -bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) +bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) { int32_t i; + if ( expiredp != 0 ) + *expiredp = 0; if (tx.nLockTime == 0) return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - //if ( komodo_validate_interest(tx) < 0 ) - // return(false); if ( nBlockTime >= 1490159171 || nBlockHeight > 246748 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); + if ( expiredp != 0 ) + *expiredp = nBlockTime-3600; return(false); // need to prevent pastdating tx } else fprintf(stderr,"IsFinalTx grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); } @@ -793,7 +795,7 @@ bool CheckFinalTx(const CTransaction &tx, int flags) ? chainActive.Tip()->GetMedianTimePast() : GetAdjustedTime(); - return IsFinalTx(tx, nBlockHeight, nBlockTime,flags); + return IsFinalTx(0,tx, nBlockHeight, nBlockTime,flags); } /** @@ -899,7 +901,10 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash:: if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); if ( komodo_validate_interest(tx) < 0 ) + { + fprintf(stderr,"CheckTransaction komodo_validate_interest error\n"); return(false); + } n = tx.vin.size(); for (j=0; jGetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,0*STANDARD_LOCKTIME_VERIFY_FLAGS)) { + if (!IsFinalTx(0,tx, nHeight, nLockTimeCutoff,0*STANDARD_LOCKTIME_VERIFY_FLAGS)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } diff --git a/src/main.h b/src/main.h index 0a137188d76..dcbd236325a 100644 --- a/src/main.h +++ b/src/main.h @@ -351,7 +351,7 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason); * Check if transaction is final and can be included in a block with the * specified height and time. Consensus critical. */ -bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime, int flags); +bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int64_t nBlockTime, int flags); /** * Check if transaction will be final in the next block to be created. diff --git a/src/miner.cpp b/src/miner.cpp index ab95c4aa628..cb6d4e23ab9 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -183,7 +183,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) pblock->nTime = GetAdjustedTime(); const int64_t nMedianTimePast = pindexPrev->GetMedianTimePast(); CCoinsViewCache view(pcoinsTip); - + uin32_t expired; + // Priority order to process transactions list vOrphan; // list memory doesn't move map > mapDependers; @@ -201,9 +202,14 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) ? nMedianTimePast : pblock->GetBlockTime(); - if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) + if (tx.IsCoinBase() || !IsFinalTx(&expired,tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) + { + if ( expired != 0 ) + { + fprintf(stderr,"expire from mempool tx.(%d %d) %.8f\n",tx.vins.size(),tx.vouts.size(),(double)tx.vouts[0].nValue/COIN); + } continue; - + } COrphan* porphan = NULL; double dPriority = 0; CAmount nTotalIn = 0; From 0a4ad821515eff6f4f3a4d22d5d687f8f044669e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 18:30:02 +0200 Subject: [PATCH 220/258] Test --- src/miner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index cb6d4e23ab9..aaf481db2f1 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -183,7 +183,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) pblock->nTime = GetAdjustedTime(); const int64_t nMedianTimePast = pindexPrev->GetMedianTimePast(); CCoinsViewCache view(pcoinsTip); - uin32_t expired; + uint32_t expired; // Priority order to process transactions list vOrphan; // list memory doesn't move @@ -206,7 +206,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) { if ( expired != 0 ) { - fprintf(stderr,"expire from mempool tx.(%d %d) %.8f\n",tx.vins.size(),tx.vouts.size(),(double)tx.vouts[0].nValue/COIN); + fprintf(stderr,"expire from mempool tx.\n");//(%d %d) %.8f\n",tx.vins.size(),tx.vouts.size(),(double)tx.vouts[0].nValue/COIN); } continue; } From a6e10f4082895fed788dfc6a776a81812d26bae0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 19:29:04 +0200 Subject: [PATCH 221/258] Test --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index d258d185c05..df92930a77f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -712,6 +712,8 @@ int32_t komodo_validate_interest(const CTransaction& tx) if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD ) { locktime = komodo_interest_args(&txheighttime,&txheight,&tiptime,&value,tx.GetHash(),0); + if ( tiptime == 0 ) + tiptime = (int32_t)chainActive.Tip()->nTime; if ( txheighttime == 0 ) { static uint32_t counter0; @@ -723,12 +725,14 @@ int32_t komodo_validate_interest(const CTransaction& tx) { if ( txheighttime > 1490159171 )//|| (txheight == 0 && txheighttime >= 1490159171) ) // 246748 { + // komodo_validate_interest reject.0 locktime 1490193206/0 vs nBlockTime 1490202625 txheighttime.1490202625 tiptime.0 static uint32_t counter; if ( counter++ < 100 ) fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime); return(-1); } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime); } + fprintf(stderr,"validateinterest accept.%d locktime %u/%u vs txheighttime.%u tiptime.%u\n",(int32_t)txheight,(int32_t)tx.nLockTime,locktime,txheighttime,tiptime); } return(0); } From b667a3cc4d8570627ba495aa6b5fbdcff2eaaef9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 19:35:42 +0200 Subject: [PATCH 222/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index df92930a77f..f561d504dea 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -723,7 +723,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) } if ( (int64_t)tx.nLockTime < txheighttime-3600 ) { - if ( txheighttime > 1490159171 )//|| (txheight == 0 && txheighttime >= 1490159171) ) // 246748 + if ( txheighttime > 1490159171 || (txheight == 0 && txheighttime >= 1490159171) ) // 246748 { // komodo_validate_interest reject.0 locktime 1490193206/0 vs nBlockTime 1490202625 txheighttime.1490202625 tiptime.0 static uint32_t counter; From 3087a316f42b1150f507bc923505e83c3c5a55eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 19:45:09 +0200 Subject: [PATCH 223/258] Test --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f561d504dea..c98a985e89c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -723,11 +723,11 @@ int32_t komodo_validate_interest(const CTransaction& tx) } if ( (int64_t)tx.nLockTime < txheighttime-3600 ) { - if ( txheighttime > 1490159171 || (txheight == 0 && txheighttime >= 1490159171) ) // 246748 + if ( txheighttime > 1490159171 )//|| (txheight == 0 && txheighttime >= 1490159171) ) // 246748 { // komodo_validate_interest reject.0 locktime 1490193206/0 vs nBlockTime 1490202625 txheighttime.1490202625 tiptime.0 - static uint32_t counter; - if ( counter++ < 100 ) + //static uint32_t counter; + //if ( counter++ < 100 ) fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime); return(-1); } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime); From 74d56dfd45b584df0c4d4ebc23cd8c7241ea5c67 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 19:58:37 +0200 Subject: [PATCH 224/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c98a985e89c..3fa381af12c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -904,7 +904,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash:: static uint256 array[15]; int32_t j,k,n; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); - if ( komodo_validate_interest(tx) < 0 ) + if ( 0 && komodo_validate_interest(tx) < 0 ) { fprintf(stderr,"CheckTransaction komodo_validate_interest error\n"); return(false); @@ -3329,7 +3329,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST) ? pindexPrev->GetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(0,tx, nHeight, nLockTimeCutoff,0*STANDARD_LOCKTIME_VERIFY_FLAGS)) { + if (!IsFinalTx(0,tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } From 1ebbcd18b3565ddcd66f94703edf5be33f546a9e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 20:04:03 +0200 Subject: [PATCH 225/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3fa381af12c..c98a985e89c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -904,7 +904,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash:: static uint256 array[15]; int32_t j,k,n; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); - if ( 0 && komodo_validate_interest(tx) < 0 ) + if ( komodo_validate_interest(tx) < 0 ) { fprintf(stderr,"CheckTransaction komodo_validate_interest error\n"); return(false); @@ -3329,7 +3329,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST) ? pindexPrev->GetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(0,tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) { + if (!IsFinalTx(0,tx, nHeight, nLockTimeCutoff,0*STANDARD_LOCKTIME_VERIFY_FLAGS)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } From 837b94ee83f634e1ee17adec0712720b11e9582f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 20:18:41 +0200 Subject: [PATCH 226/258] Test --- src/main.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c98a985e89c..29b11998e9d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,7 +706,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return true; } -int32_t komodo_validate_interest(const CTransaction& tx) +int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) { int32_t i,txheight=0; uint32_t txheighttime,tiptime=0,locktime; uint64_t value=0; if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD ) @@ -746,7 +746,7 @@ bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int6 return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockTime >= 1490159171 || nBlockHeight > 246748 ) // 246748 + if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); if ( expiredp != 0 ) @@ -904,11 +904,11 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash:: static uint256 array[15]; int32_t j,k,n; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); - if ( komodo_validate_interest(tx) < 0 ) + /*if ( komodo_validate_interest(tx) < 0 ) { fprintf(stderr,"CheckTransaction komodo_validate_interest error\n"); return(false); - } + }*/ n = tx.vin.size(); for (j=0; j Date: Wed, 22 Mar 2017 20:22:05 +0200 Subject: [PATCH 227/258] Test --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 29b11998e9d..7fdc7fc44fe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -721,18 +721,18 @@ int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) if ( counter0++ < 3 ) fprintf(stderr,"error getting txheighttime, set to tiptime.%u\n",txheighttime); } - if ( (int64_t)tx.nLockTime < txheighttime-3600 ) + if ( (int64_t)tx.nLockTime < txblocktime-3600 )//txheighttime-3600 ) { if ( txheighttime > 1490159171 )//|| (txheight == 0 && txheighttime >= 1490159171) ) // 246748 { // komodo_validate_interest reject.0 locktime 1490193206/0 vs nBlockTime 1490202625 txheighttime.1490202625 tiptime.0 //static uint32_t counter; //if ( counter++ < 100 ) - fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime); + fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u txb.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime,txblocktime); return(-1); - } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime); + } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u txb.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime,txblocktime); } - fprintf(stderr,"validateinterest accept.%d locktime %u/%u vs txheighttime.%u tiptime.%u\n",(int32_t)txheight,(int32_t)tx.nLockTime,locktime,txheighttime,tiptime); + fprintf(stderr,"validateinterest accept.%d locktime %u/%u vs txheighttime.%u tiptime.%u txb.%u\n",(int32_t)txheight,(int32_t)tx.nLockTime,locktime,txheighttime,tiptime,txblocktime); } return(0); } @@ -3251,7 +3251,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat // Check transactions BOOST_FOREACH(const CTransaction& tx, block.vtx) { - if ( komodo_validate_interest(tx,block.vtx.nTime) < 0 ) + if ( komodo_validate_interest(tx,block.nTime) < 0 ) { fprintf(stderr,"CheckBlock(): komodo_validate_interest failure\n"); return error("CheckBlock: komodo_validate_interest failed"); From de463b10508dae4364dac6b57ad5a0a8865fc855 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 20:45:07 +0200 Subject: [PATCH 228/258] Test --- src/main.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7fdc7fc44fe..236b4b1af8a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -708,7 +708,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) { - int32_t i,txheight=0; uint32_t txheighttime,tiptime=0,locktime; uint64_t value=0; + int32_t i,txheight=0; uint32_t cmptime,txheighttime,tiptime=0,locktime; uint64_t value=0; if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD ) { locktime = komodo_interest_args(&txheighttime,&txheight,&tiptime,&value,tx.GetHash(),0); @@ -721,9 +721,17 @@ int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) if ( counter0++ < 3 ) fprintf(stderr,"error getting txheighttime, set to tiptime.%u\n",txheighttime); } - if ( (int64_t)tx.nLockTime < txblocktime-3600 )//txheighttime-3600 ) + if ( txheighttime != 0 && txblocktime != 0 ) { - if ( txheighttime > 1490159171 )//|| (txheight == 0 && txheighttime >= 1490159171) ) // 246748 + cmptime = txheighttime; + if ( txblocktime < cmptime ) + cmptime = txblocktime; + } + else if ( (cmptime= txheighttime) == 0 ) + cmptime = txblockime; + if ( cmptime != 0 && (int64_t)tx.nLockTime < cmptime-3600 ) + { + if ( txheighttime > 1490159171 || (locktime == 0 && txheighttime >= 1490159171) ) // 246748 { // komodo_validate_interest reject.0 locktime 1490193206/0 vs nBlockTime 1490202625 txheighttime.1490202625 tiptime.0 //static uint32_t counter; From 7133babe5fe78c35d76f124e6b3c312ff196627d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 20:47:03 +0200 Subject: [PATCH 229/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 236b4b1af8a..01e0fc7f9c0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -728,7 +728,7 @@ int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) cmptime = txblocktime; } else if ( (cmptime= txheighttime) == 0 ) - cmptime = txblockime; + cmptime = txblocktime; if ( cmptime != 0 && (int64_t)tx.nLockTime < cmptime-3600 ) { if ( txheighttime > 1490159171 || (locktime == 0 && txheighttime >= 1490159171) ) // 246748 From 241a6ce5f4423b41976ef0fb6cac991b7af5a78d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 21:34:03 +0200 Subject: [PATCH 230/258] Test --- src/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 01e0fc7f9c0..6afb42ce678 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -729,6 +729,11 @@ int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) } else if ( (cmptime= txheighttime) == 0 ) cmptime = txblocktime; + if ( tiptime != 0 && tiptime < cmptime ) + cmptime = tiptime; + //validateinterest accept.246749 locktime 1490205024/1490205024 vs txheighttime.1490205794 tiptime.1490159171 txb.1490205794 + //komodo_validate_interest reject.246749 locktime 1490201846/1490201846 vs nBlockTime 1490159171 txheighttime.1490205794 tiptime.1490159171 txb.1490205794 + //CheckBlock(): komodo_validate_interest failure if ( cmptime != 0 && (int64_t)tx.nLockTime < cmptime-3600 ) { if ( txheighttime > 1490159171 || (locktime == 0 && txheighttime >= 1490159171) ) // 246748 @@ -736,11 +741,11 @@ int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) // komodo_validate_interest reject.0 locktime 1490193206/0 vs nBlockTime 1490202625 txheighttime.1490202625 tiptime.0 //static uint32_t counter; //if ( counter++ < 100 ) - fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u txb.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime,txblocktime); + fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u txb.%u cmp.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime,txblocktime,cmptime); return(-1); - } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u txb.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime,txblocktime); + } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime,txblocktime,cmptime); } - fprintf(stderr,"validateinterest accept.%d locktime %u/%u vs txheighttime.%u tiptime.%u txb.%u\n",(int32_t)txheight,(int32_t)tx.nLockTime,locktime,txheighttime,tiptime,txblocktime); + fprintf(stderr,"validateinterest accept.%d locktime %u/%u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,(int32_t)tx.nLockTime,locktime,txheighttime,tiptime,txblocktime,cmptime); } return(0); } From d022ff08d461b8562bb88c2bc5f882691fee40e2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 22:07:39 +0200 Subject: [PATCH 231/258] Test --- src/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6afb42ce678..82cd0f366c8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -709,7 +709,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) { int32_t i,txheight=0; uint32_t cmptime,txheighttime,tiptime=0,locktime; uint64_t value=0; - if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && txblocktime > 1490159171-24*3600*100 ) { locktime = komodo_interest_args(&txheighttime,&txheight,&tiptime,&value,tx.GetHash(),0); if ( tiptime == 0 ) @@ -757,9 +757,10 @@ bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int6 *expiredp = 0; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && nBlockTime > 1490159171-24*3600*100 ) //&& (int64_t)tx.nLockTime < nBlockTime-3600 { - if ( nBlockTime >= 1490159171 ) // 246748 + if ( komodo_validate_interest(tx,nBlockTime) < 0 ) + //if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); if ( expiredp != 0 ) From 3d7d73a47a94553e00050720eb036113956306c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 22:12:07 +0200 Subject: [PATCH 232/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 82cd0f366c8..62a476c4be4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -709,7 +709,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) { int32_t i,txheight=0; uint32_t cmptime,txheighttime,tiptime=0,locktime; uint64_t value=0; - if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && txblocktime > 1490159171-24*3600*100 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && txblocktime >= 1473793441 ) { locktime = komodo_interest_args(&txheighttime,&txheight,&tiptime,&value,tx.GetHash(),0); if ( tiptime == 0 ) @@ -757,7 +757,7 @@ bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int6 *expiredp = 0; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && nBlockTime > 1490159171-24*3600*100 ) //&& (int64_t)tx.nLockTime < nBlockTime-3600 + if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && nBlockTime >= 1473793441 ) //&& (int64_t)tx.nLockTime < nBlockTime-3600 { if ( komodo_validate_interest(tx,nBlockTime) < 0 ) //if ( nBlockTime >= 1490159171 ) // 246748 From dd36961aaf2539886c63214d11b20a63c71ff59a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 23:03:41 +0200 Subject: [PATCH 233/258] Test --- src/komodo_gateway.h | 6 +++--- src/main.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 14ad70405b9..185145bdda2 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -520,8 +520,8 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to } if ( ASSETCHAINS_SYMBOL[0] != 0 && (pax_fiatstatus(&available,&deposited,&issued,&withdrawn,&approved,&redeemed,symbol) != 0 || available < pax->fiatoshis) ) { - if ( pax->height > 214700 || strcmp(ASSETCHAINS_SYMBOL,symbol) == 0 ) - printf("miner.[%s]: skip %s %.8f when avail %.8f deposited %.8f, issued %.8f withdrawn %.8f approved %.8f redeemed %.8f\n",ASSETCHAINS_SYMBOL,symbol,dstr(pax->fiatoshis),dstr(available),dstr(deposited),dstr(issued),dstr(withdrawn),dstr(approved),dstr(redeemed)); + //if ( pax->height > 214700 || strcmp(ASSETCHAINS_SYMBOL,symbol) == 0 ) + // printf("miner.[%s]: skip %s %.8f when avail %.8f deposited %.8f, issued %.8f withdrawn %.8f approved %.8f redeemed %.8f\n",ASSETCHAINS_SYMBOL,symbol,dstr(pax->fiatoshis),dstr(available),dstr(deposited),dstr(issued),dstr(withdrawn),dstr(approved),dstr(redeemed)); continue; } /*printf("pax.%s marked.%d %.8f -> %.8f ready.%d validated.%d\n",pax->symbol,pax->marked,dstr(pax->komodoshis),dstr(pax->fiatoshis),pax->ready!=0,pax->validated!=0); @@ -1213,7 +1213,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 { basesp->withdrawn += value; didstats = 1; - if ( strcmp(base,ASSETCHAINS_SYMBOL) == 0 ) + if ( 0 && strcmp(base,ASSETCHAINS_SYMBOL) == 0 ) printf("########### %p withdrawn %s += %.8f check %.8f\n",basesp,base,dstr(value),dstr(checktoshis)); } if ( 0 && strcmp(base,"RUB") == 0 && (pax == 0 || pax->approved == 0) ) diff --git a/src/main.cpp b/src/main.cpp index 62a476c4be4..337d8bef327 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -741,6 +741,7 @@ int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) // komodo_validate_interest reject.0 locktime 1490193206/0 vs nBlockTime 1490202625 txheighttime.1490202625 tiptime.0 //static uint32_t counter; //if ( counter++ < 100 ) + if ( tx.nLockTime != 1477258935 ) fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u txb.%u cmp.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime,txblocktime,cmptime); return(-1); } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime,txblocktime,cmptime); @@ -3267,7 +3268,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat { if ( komodo_validate_interest(tx,block.nTime) < 0 ) { - fprintf(stderr,"CheckBlock(): komodo_validate_interest failure\n"); + //fprintf(stderr,"CheckBlock(): komodo_validate_interest failure\n"); return error("CheckBlock: komodo_validate_interest failed"); } if (!CheckTransaction(tx, state, verifier)) From 32f5c6fbb2b02df1a6eaf354791b9b5c3a4a0b5c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 23:04:22 +0200 Subject: [PATCH 234/258] Test --- src/miner.cpp | 2 +- src/pow.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index aaf481db2f1..39bcbdd8861 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -677,7 +677,7 @@ void static BitcoinMiner(CWallet *pwallet) if ( externalflag == 0 && i != 66 ) printf("VIOLATION at %d\n",i); for (i=0; i<66; i++) - {break; + { break; for (j=0; j<33; j++) printf("%02x",pubkeys[i][j]); printf(" p%d -> %d\n",i,komodo_minerid(pindexPrev->nHeight-i,pubkeys[i])); diff --git a/src/pow.cpp b/src/pow.cpp index 655a9dfad07..ce959254cf8 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -111,7 +111,7 @@ int8_t komodo_minerid(int32_t height,uint8_t *pubkey33); void komodo_index2pubkey33(uint8_t *pubkey33,CBlockIndex *pindex,int32_t height); extern int32_t KOMODO_CHOSEN_ONE; #define KOMODO_ELECTION_GAP 2000 - + int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,int32_t *nonzpkeysp,int32_t height); int32_t KOMODO_LOADINGBLOCKS; From aa4d30c8cc989ba9ed08b9f4d53d0d44435170dd Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 02:56:45 +0200 Subject: [PATCH 235/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 337d8bef327..86a123be51b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3268,7 +3268,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat { if ( komodo_validate_interest(tx,block.nTime) < 0 ) { - //fprintf(stderr,"CheckBlock(): komodo_validate_interest failure\n"); + fprintf(stderr,"CheckBlock(%d): komodo_validate_interest failure\n",height); return error("CheckBlock: komodo_validate_interest failed"); } if (!CheckTransaction(tx, state, verifier)) From e251f378d1b5f8d4ed365af8c85d178e0e89af8b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 03:00:27 +0200 Subject: [PATCH 236/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 86a123be51b..4fecd17b9f7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3268,7 +3268,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat { if ( komodo_validate_interest(tx,block.nTime) < 0 ) { - fprintf(stderr,"CheckBlock(%d): komodo_validate_interest failure\n",height); + fprintf(stderr,"CheckBlock(%d) %d, %u: komodo_validate_interest failure\n",height,pindex!=0?(int32_t)pindex->nHeight:0,pindex!=0?(int32_t)pindex->nTime:0); return error("CheckBlock: komodo_validate_interest failed"); } if (!CheckTransaction(tx, state, verifier)) From 6c6ed52068054db21e94245b161863f2bab5be62 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 03:01:51 +0200 Subject: [PATCH 237/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 4fecd17b9f7..a914d7ab127 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3268,7 +3268,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat { if ( komodo_validate_interest(tx,block.nTime) < 0 ) { - fprintf(stderr,"CheckBlock(%d) %d, %u: komodo_validate_interest failure\n",height,pindex!=0?(int32_t)pindex->nHeight:0,pindex!=0?(int32_t)pindex->nTime:0); + fprintf(stderr,"CheckBlock(%d) %d, %u: komodo_validate_interest failure blocksize.%d\n",height,pindex!=0?(int32_t)pindex->nHeight:0,pindex!=0?(int32_t)pindex->nTime:0,(int32_t)block.vtx.size()); return error("CheckBlock: komodo_validate_interest failed"); } if (!CheckTransaction(tx, state, verifier)) From eb5f62e7ce902e8da8d213c684bd053466f4f526 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 03:05:03 +0200 Subject: [PATCH 238/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a914d7ab127..77acc17bafd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -746,7 +746,7 @@ int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) return(-1); } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime,txblocktime,cmptime); } - fprintf(stderr,"validateinterest accept.%d locktime %u/%u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,(int32_t)tx.nLockTime,locktime,txheighttime,tiptime,txblocktime,cmptime); + fprintf(stderr,"validateinterest accept.%d tip.%d locktime %u/%u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,(int32_t)chainActive.Tip()->nHeight,(int32_t)tx.nLockTime,locktime,txheighttime,tiptime,txblocktime,cmptime); } return(0); } From 3683acba649b18e5e32e532e8b86f7c60e291108 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 03:09:14 +0200 Subject: [PATCH 239/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 77acc17bafd..3835ee96607 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3268,7 +3268,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat { if ( komodo_validate_interest(tx,block.nTime) < 0 ) { - fprintf(stderr,"CheckBlock(%d) %d, %u: komodo_validate_interest failure blocksize.%d\n",height,pindex!=0?(int32_t)pindex->nHeight:0,pindex!=0?(int32_t)pindex->nTime:0,(int32_t)block.vtx.size()); + fprintf(stderr,"CheckBlock(%d:%d) %d, %u: komodo_validate_interest failure blocksize.%d\n",height,komodo_block2height((Cblock *)&block),pindex!=0?(int32_t)pindex->nHeight:0,pindex!=0?(int32_t)pindex->nTime:0,(int32_t)block.vtx.size()); return error("CheckBlock: komodo_validate_interest failed"); } if (!CheckTransaction(tx, state, verifier)) From 26d8ed58f6299e20514cd43812833549c9d20f6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 03:10:07 +0200 Subject: [PATCH 240/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 3835ee96607..e777eb470e8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3268,7 +3268,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat { if ( komodo_validate_interest(tx,block.nTime) < 0 ) { - fprintf(stderr,"CheckBlock(%d:%d) %d, %u: komodo_validate_interest failure blocksize.%d\n",height,komodo_block2height((Cblock *)&block),pindex!=0?(int32_t)pindex->nHeight:0,pindex!=0?(int32_t)pindex->nTime:0,(int32_t)block.vtx.size()); + fprintf(stderr,"CheckBlock(%d:%d) %d, %u: komodo_validate_interest failure blocksize.%d\n",height,komodo_block2height((CBlock *)&block),pindex!=0?(int32_t)pindex->nHeight:0,pindex!=0?(int32_t)pindex->nTime:0,(int32_t)block.vtx.size()); return error("CheckBlock: komodo_validate_interest failed"); } if (!CheckTransaction(tx, state, verifier)) From ba8419c7a079b5581b00d2da0d80795c75611a20 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 03:20:32 +0200 Subject: [PATCH 241/258] Test --- src/miner.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/miner.cpp b/src/miner.cpp index 39bcbdd8861..50ddd61c6b9 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -511,7 +511,19 @@ static bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& rese { LOCK(cs_main); if (pblock->hashPrevBlock != chainActive.Tip()->GetBlockHash()) + { + uint256 hash; int32_t i; + hash = pblock->hashPrevBlock; + for (i=0; i<32; i++) + fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); + fprintf(stderr," <- prev\n"); + hash = chainActive.Tip()->GetBlockHash(); + for (i=0; i<32; i++) + fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); + fprintf(stderr," <- chainTip\n"); + return error("KomodoMiner: generated block is stale"); + } } // Remove key from key pool From c0dbb034f380ac4a3c827e2d166adb1abc08587e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 03:30:15 +0200 Subject: [PATCH 242/258] test --- src/main.cpp | 11 +++++++++++ src/miner.cpp | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e777eb470e8..f0b1925e3fa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3200,6 +3200,17 @@ bool CheckBlockHeader(int32_t height,CBlockIndex *pindex, const CBlockHeader& bl { uint8_t pubkey33[33]; // Check timestamp + { + uint256 hash; int32_t i; + hash = blockhdr.GetHash(); + for (i=0; i<32; i++) + fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); + fprintf(stderr," <- CheckBlockHeader\n"); + hash = chainActive.Tip()->GetBlockHash(); + for (i=0; i<32; i++) + fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); + fprintf(stderr," <- chainTip\n"); + } if (blockhdr.GetBlockTime() > GetAdjustedTime() + 60) return state.Invalid(error("CheckBlockHeader(): block timestamp too far in the future"),REJECT_INVALID, "time-too-new"); // Check block version diff --git a/src/miner.cpp b/src/miner.cpp index 50ddd61c6b9..fdd5ea8c367 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -516,11 +516,11 @@ static bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& rese hash = pblock->hashPrevBlock; for (i=0; i<32; i++) fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); - fprintf(stderr," <- prev\n"); + fprintf(stderr," <- prev (stale)\n"); hash = chainActive.Tip()->GetBlockHash(); for (i=0; i<32; i++) fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); - fprintf(stderr," <- chainTip\n"); + fprintf(stderr," <- chainTip (stale)\n"); return error("KomodoMiner: generated block is stale"); } From 92266e99590fee4892568f49e1d6fde5d28ad8c7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 03:35:44 +0200 Subject: [PATCH 243/258] Test --- src/main.cpp | 4 ++-- src/miner.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f0b1925e3fa..ba38979ba7c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3203,11 +3203,11 @@ bool CheckBlockHeader(int32_t height,CBlockIndex *pindex, const CBlockHeader& bl { uint256 hash; int32_t i; hash = blockhdr.GetHash(); - for (i=0; i<32; i++) + for (i=31; i>=0; i--) fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); fprintf(stderr," <- CheckBlockHeader\n"); hash = chainActive.Tip()->GetBlockHash(); - for (i=0; i<32; i++) + for (i=31; i>=0; i--) fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); fprintf(stderr," <- chainTip\n"); } diff --git a/src/miner.cpp b/src/miner.cpp index fdd5ea8c367..2582980b1c2 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -514,11 +514,11 @@ static bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& rese { uint256 hash; int32_t i; hash = pblock->hashPrevBlock; - for (i=0; i<32; i++) + for (i=31; i>=0; i--) fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); fprintf(stderr," <- prev (stale)\n"); hash = chainActive.Tip()->GetBlockHash(); - for (i=0; i<32; i++) + for (i=31; i>=0; i--) fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); fprintf(stderr," <- chainTip (stale)\n"); From 807949f42f6e4e8613e4ec73d3e7bbaa999b6f74 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 04:05:11 +0200 Subject: [PATCH 244/258] Test --- src/main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ba38979ba7c..5e38a9a4cda 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3206,10 +3206,13 @@ bool CheckBlockHeader(int32_t height,CBlockIndex *pindex, const CBlockHeader& bl for (i=31; i>=0; i--) fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); fprintf(stderr," <- CheckBlockHeader\n"); - hash = chainActive.Tip()->GetBlockHash(); - for (i=31; i>=0; i--) - fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); - fprintf(stderr," <- chainTip\n"); + if ( chainActive.Tip() != 0 ) + { + hash = chainActive.Tip()->GetBlockHash(); + for (i=31; i>=0; i--) + fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); + fprintf(stderr," <- chainTip\n"); + } } if (blockhdr.GetBlockTime() > GetAdjustedTime() + 60) return state.Invalid(error("CheckBlockHeader(): block timestamp too far in the future"),REJECT_INVALID, "time-too-new"); From 9f07c80c9f24f1d68a1195997b3076a339080fb7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 04:22:21 +0200 Subject: [PATCH 245/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 5e38a9a4cda..5c3cca34b6b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2949,7 +2949,7 @@ bool ActivateBestChain(CValidationState &state, CBlock *pblock) { } // Notify external listeners about the new tip. uiInterface.NotifyBlockTip(hashNewTip); - } + } else fprintf(stderr,"initial download skips propagation\n"); } while(pindexMostWork != chainActive.Tip()); CheckBlockIndex(); From 7f32cee6398fab7ae48873904a4087e658ef8cf3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 04:23:54 +0200 Subject: [PATCH 246/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 5c3cca34b6b..5ffbf2e943b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1614,7 +1614,7 @@ bool IsInitialBlockDownload() state = ((chainActive.Height() < ptr->nHeight - 24*6) || ptr->GetBlockTime() < (GetTime() - chainParams.MaxTipAge())); else state = (chainActive.Height() < ptr->nHeight - 100); - //fprintf(stderr,"state.%d ht.%d vs %d, t.%u %u\n",state,(int32_t)chainActive.Height(),(uint32_t)ptr->nHeight,(int32_t)ptr->GetBlockTime(),(uint32_t)(GetTime() - chainParams.MaxTipAge())); + fprintf(stderr,"state.%d ht.%d vs %d, t.%u %u\n",state,(int32_t)chainActive.Height(),(uint32_t)ptr->nHeight,(int32_t)ptr->GetBlockTime(),(uint32_t)(GetTime() - chainParams.MaxTipAge())); if (!state) { lockIBDState = true; From eca6ba0d9fe553eabfcf5ed892fb412e778a4d15 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 04:29:57 +0200 Subject: [PATCH 247/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 5ffbf2e943b..0a546220017 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1611,7 +1611,7 @@ bool IsInitialBlockDownload() else if ( pindexBestHeader != 0 && pindexBestHeader->nHeight > ptr->nHeight ) ptr = pindexBestHeader; if ( ASSETCHAINS_SYMBOL[0] == 0 ) - state = ((chainActive.Height() < ptr->nHeight - 24*6) || + state = chainActive.Height() > 2467500 && ((chainActive.Height() < ptr->nHeight - 24*6) || ptr->GetBlockTime() < (GetTime() - chainParams.MaxTipAge())); else state = (chainActive.Height() < ptr->nHeight - 100); fprintf(stderr,"state.%d ht.%d vs %d, t.%u %u\n",state,(int32_t)chainActive.Height(),(uint32_t)ptr->nHeight,(int32_t)ptr->GetBlockTime(),(uint32_t)(GetTime() - chainParams.MaxTipAge())); From 43aafea7c9ac41b16e78e3149a57cf8798d52024 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 04:32:03 +0200 Subject: [PATCH 248/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0a546220017..60f7ac5085f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1611,9 +1611,9 @@ bool IsInitialBlockDownload() else if ( pindexBestHeader != 0 && pindexBestHeader->nHeight > ptr->nHeight ) ptr = pindexBestHeader; if ( ASSETCHAINS_SYMBOL[0] == 0 ) - state = chainActive.Height() > 2467500 && ((chainActive.Height() < ptr->nHeight - 24*6) || + state = ((chainActive.Height() < ptr->nHeight - 24*60) || ptr->GetBlockTime() < (GetTime() - chainParams.MaxTipAge())); - else state = (chainActive.Height() < ptr->nHeight - 100); + else state = (chainActive.Height() < ptr->nHeight - 3); fprintf(stderr,"state.%d ht.%d vs %d, t.%u %u\n",state,(int32_t)chainActive.Height(),(uint32_t)ptr->nHeight,(int32_t)ptr->GetBlockTime(),(uint32_t)(GetTime() - chainParams.MaxTipAge())); if (!state) { From b11963b5b0829de522456d982ef6729e116e7985 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 04:39:44 +0200 Subject: [PATCH 249/258] Test --- src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 60f7ac5085f..9698984bfee 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1614,7 +1614,7 @@ bool IsInitialBlockDownload() state = ((chainActive.Height() < ptr->nHeight - 24*60) || ptr->GetBlockTime() < (GetTime() - chainParams.MaxTipAge())); else state = (chainActive.Height() < ptr->nHeight - 3); - fprintf(stderr,"state.%d ht.%d vs %d, t.%u %u\n",state,(int32_t)chainActive.Height(),(uint32_t)ptr->nHeight,(int32_t)ptr->GetBlockTime(),(uint32_t)(GetTime() - chainParams.MaxTipAge())); + //fprintf(stderr,"state.%d ht.%d vs %d, t.%u %u\n",state,(int32_t)chainActive.Height(),(uint32_t)ptr->nHeight,(int32_t)ptr->GetBlockTime(),(uint32_t)(GetTime() - chainParams.MaxTipAge())); if (!state) { lockIBDState = true; @@ -2949,7 +2949,7 @@ bool ActivateBestChain(CValidationState &state, CBlock *pblock) { } // Notify external listeners about the new tip. uiInterface.NotifyBlockTip(hashNewTip); - } else fprintf(stderr,"initial download skips propagation\n"); + } //else fprintf(stderr,"initial download skips propagation\n"); } while(pindexMostWork != chainActive.Tip()); CheckBlockIndex(); @@ -3200,6 +3200,7 @@ bool CheckBlockHeader(int32_t height,CBlockIndex *pindex, const CBlockHeader& bl { uint8_t pubkey33[33]; // Check timestamp + if ( 0 ) { uint256 hash; int32_t i; hash = blockhdr.GetHash(); From fc901e2f4a76134f3fd8ebfc1b3819993111b433 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 05:31:12 +0200 Subject: [PATCH 250/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 9698984bfee..ec37b80f434 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -709,7 +709,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) { int32_t i,txheight=0; uint32_t cmptime,txheighttime,tiptime=0,locktime; uint64_t value=0; - if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && txblocktime >= 1473793441 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && txblocktime >= 1490159171 - 24*3600*100 )//1473793441 ) { locktime = komodo_interest_args(&txheighttime,&txheight,&tiptime,&value,tx.GetHash(),0); if ( tiptime == 0 ) @@ -758,7 +758,7 @@ bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int6 *expiredp = 0; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && nBlockTime >= 1473793441 ) //&& (int64_t)tx.nLockTime < nBlockTime-3600 + if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD )//&& nBlockTime >= 1473793441 ) //&& (int64_t)tx.nLockTime < nBlockTime-3600 { if ( komodo_validate_interest(tx,nBlockTime) < 0 ) //if ( nBlockTime >= 1490159171 ) // 246748 From 7ef5540bca0589c6d2317d21b530e3ed4907d898 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 05:47:19 +0200 Subject: [PATCH 251/258] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ec37b80f434..3a80075bf1e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -746,7 +746,7 @@ int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) return(-1); } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime,txblocktime,cmptime); } - fprintf(stderr,"validateinterest accept.%d tip.%d locktime %u/%u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,(int32_t)chainActive.Tip()->nHeight,(int32_t)tx.nLockTime,locktime,txheighttime,tiptime,txblocktime,cmptime); + //fprintf(stderr,"validateinterest accept.%d tip.%d locktime %u/%u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,(int32_t)chainActive.Tip()->nHeight,(int32_t)tx.nLockTime,locktime,txheighttime,tiptime,txblocktime,cmptime); } return(0); } @@ -767,7 +767,7 @@ bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int6 if ( expiredp != 0 ) *expiredp = nBlockTime-3600; return(false); // need to prevent pastdating tx - } else fprintf(stderr,"IsFinalTx grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); + } //else fprintf(stderr,"IsFinalTx accept.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); } if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime)) return true; From 67cb4250ede2c24cf4d5bc497fa588e85bd4f087 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 05:53:28 +0200 Subject: [PATCH 252/258] Test --- src/main.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3a80075bf1e..6a2adb60d95 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -709,7 +709,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) { int32_t i,txheight=0; uint32_t cmptime,txheighttime,tiptime=0,locktime; uint64_t value=0; - if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && txblocktime >= 1490159171 - 24*3600*100 )//1473793441 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD )//1473793441 ) { locktime = komodo_interest_args(&txheighttime,&txheight,&tiptime,&value,tx.GetHash(),0); if ( tiptime == 0 ) @@ -731,20 +731,17 @@ int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) cmptime = txblocktime; if ( tiptime != 0 && tiptime < cmptime ) cmptime = tiptime; - //validateinterest accept.246749 locktime 1490205024/1490205024 vs txheighttime.1490205794 tiptime.1490159171 txb.1490205794 - //komodo_validate_interest reject.246749 locktime 1490201846/1490201846 vs nBlockTime 1490159171 txheighttime.1490205794 tiptime.1490159171 txb.1490205794 - //CheckBlock(): komodo_validate_interest failure - if ( cmptime != 0 && (int64_t)tx.nLockTime < cmptime-3600 ) + if ( cmptime >= 1490159171 - 24*3600 ) { - if ( txheighttime > 1490159171 || (locktime == 0 && txheighttime >= 1490159171) ) // 246748 + if ( cmptime != 0 && (int64_t)tx.nLockTime < cmptime-3600 ) { - // komodo_validate_interest reject.0 locktime 1490193206/0 vs nBlockTime 1490202625 txheighttime.1490202625 tiptime.0 - //static uint32_t counter; - //if ( counter++ < 100 ) - if ( tx.nLockTime != 1477258935 ) - fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u txb.%u cmp.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime,txblocktime,cmptime); - return(-1); - } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime,txblocktime,cmptime); + if ( txheighttime > 1490159171 || (locktime == 0 && txheighttime >= 1490159171) ) // 246748 + { + if ( tx.nLockTime != 1477258935 ) + fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u txb.%u cmp.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime,txblocktime,cmptime); + return(-1); + } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime,txblocktime,cmptime); + } } //fprintf(stderr,"validateinterest accept.%d tip.%d locktime %u/%u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,(int32_t)chainActive.Tip()->nHeight,(int32_t)tx.nLockTime,locktime,txheighttime,tiptime,txblocktime,cmptime); } From 2d14730eeb6cd6019ea8e6d34109344a2de16387 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 06:17:53 +0200 Subject: [PATCH 253/258] Test --- src/main.cpp | 13 ++++++------- src/miner.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6a2adb60d95..884ce1248c6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,7 +706,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return true; } -int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) +int32_t komodo_validate_interest(uint32_t *expiredp,const CTransaction& tx,uint32_t txblocktime) { int32_t i,txheight=0; uint32_t cmptime,txheighttime,tiptime=0,locktime; uint64_t value=0; if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD )//1473793441 ) @@ -739,6 +739,8 @@ int32_t komodo_validate_interest(const CTransaction& tx,uint32_t txblocktime) { if ( tx.nLockTime != 1477258935 ) fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u txb.%u cmp.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime,txblocktime,cmptime); + if ( expiredp != 0 ) + *expiredp = cmptime-3600; return(-1); } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime,txblocktime,cmptime); } @@ -757,12 +759,9 @@ bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int6 return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD )//&& nBlockTime >= 1473793441 ) //&& (int64_t)tx.nLockTime < nBlockTime-3600 { - if ( komodo_validate_interest(tx,nBlockTime) < 0 ) - //if ( nBlockTime >= 1490159171 ) // 246748 + if ( komodo_validate_interest(expiredp,tx,nBlockTime) < 0 ) //if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); - if ( expiredp != 0 ) - *expiredp = nBlockTime-3600; return(false); // need to prevent pastdating tx } //else fprintf(stderr,"IsFinalTx accept.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); } @@ -1157,7 +1156,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa if (pfMissingInputs) *pfMissingInputs = false; auto verifier = libzcash::ProofVerifier::Strict(); - /*if ( komodo_validate_interest(tx) < 0 ) // called from IsFinalTx() below + /*if ( komodo_validate_interest(tx) < 0 ) // called from CheckFinalTx() below { fprintf(stderr,"komodo_validate_interest failure\n"); return error("AcceptToMemoryPool: komodo_validate_interest failed"); @@ -3278,7 +3277,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat // Check transactions BOOST_FOREACH(const CTransaction& tx, block.vtx) { - if ( komodo_validate_interest(tx,block.nTime) < 0 ) + if ( komodo_validate_interest(0,tx,block.nTime) < 0 ) { fprintf(stderr,"CheckBlock(%d:%d) %d, %u: komodo_validate_interest failure blocksize.%d\n",height,komodo_block2height((CBlock *)&block),pindex!=0?(int32_t)pindex->nHeight:0,pindex!=0?(int32_t)pindex->nTime:0,(int32_t)block.vtx.size()); return error("CheckBlock: komodo_validate_interest failed"); diff --git a/src/miner.cpp b/src/miner.cpp index 2582980b1c2..54eafa5b6a6 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -207,6 +207,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) if ( expired != 0 ) { fprintf(stderr,"expire from mempool tx.\n");//(%d %d) %.8f\n",tx.vins.size(),tx.vouts.size(),(double)tx.vouts[0].nValue/COIN); + list removed; + mempool.remove(tx, removed, true); } continue; } @@ -436,8 +438,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) static uint32_t counter; if ( counter++ < 100 ) fprintf(stderr,"warning: testblockvalidity failed\n"); - return(0); - //throw std::runtime_error("CreateNewBlock(): TestBlockValidity failed"); + //return(0); + throw std::runtime_error("CreateNewBlock(): TestBlockValidity failed"); } } From d5ecb91b00e9836402a9b0eee3ae745e8fb69a7c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 06:21:21 +0200 Subject: [PATCH 254/258] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 884ce1248c6..ad89f0a8a47 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3279,7 +3279,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat { if ( komodo_validate_interest(0,tx,block.nTime) < 0 ) { - fprintf(stderr,"CheckBlock(%d:%d) %d, %u: komodo_validate_interest failure blocksize.%d\n",height,komodo_block2height((CBlock *)&block),pindex!=0?(int32_t)pindex->nHeight:0,pindex!=0?(int32_t)pindex->nTime:0,(int32_t)block.vtx.size()); + //fprintf(stderr,"CheckBlock(%d:%d) %d, %u: komodo_validate_interest failure blocksize.%d\n",height,komodo_block2height((CBlock *)&block),pindex!=0?(int32_t)pindex->nHeight:0,pindex!=0?(int32_t)pindex->nTime:0,(int32_t)block.vtx.size()); return error("CheckBlock: komodo_validate_interest failed"); } if (!CheckTransaction(tx, state, verifier)) From 7a57bbb4462bb801b5a893b55b43569f85b9ab1c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 06:28:05 +0200 Subject: [PATCH 255/258] Test --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index 54eafa5b6a6..219f9e88357 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -211,7 +211,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) mempool.remove(tx, removed, true); } continue; - } + } else fprintf(stderr,"coinbase or is finaltx (%d %u)\n",(int32_t)nHeight,(uint32_t)nLockTimeCutoff); COrphan* porphan = NULL; double dPriority = 0; CAmount nTotalIn = 0; From 3915943450552f389016bd1c60723128860d3653 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 06:37:28 +0200 Subject: [PATCH 256/258] Test --- src/main.cpp | 2 +- src/miner.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ad89f0a8a47..03224d1684e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -763,7 +763,7 @@ bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int6 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx - } //else fprintf(stderr,"IsFinalTx accept.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); + } else fprintf(stderr,"IsFinalTx accept.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); } if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime)) return true; diff --git a/src/miner.cpp b/src/miner.cpp index 219f9e88357..be3153c570f 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -211,7 +211,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) mempool.remove(tx, removed, true); } continue; - } else fprintf(stderr,"coinbase or is finaltx (%d %u)\n",(int32_t)nHeight,(uint32_t)nLockTimeCutoff); + } else fprintf(stderr,"coinbase or is finaltx (%d %u)\n",(int32_t)nHeight,(uint32_t)tx.nLockTime); COrphan* porphan = NULL; double dPriority = 0; CAmount nTotalIn = 0; From 253b7bc01daa48a9f259394568fa0a6373fc0635 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 06:46:30 +0200 Subject: [PATCH 257/258] Test --- src/main.cpp | 8 ++++---- src/main.h | 2 +- src/miner.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 03224d1684e..7396530ce55 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -750,7 +750,7 @@ int32_t komodo_validate_interest(uint32_t *expiredp,const CTransaction& tx,uint3 return(0); } -bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) +bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags,int32_t interesttime) { int32_t i; if ( expiredp != 0 ) @@ -759,7 +759,7 @@ bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int6 return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD )//&& nBlockTime >= 1473793441 ) //&& (int64_t)tx.nLockTime < nBlockTime-3600 { - if ( komodo_validate_interest(expiredp,tx,nBlockTime) < 0 ) //if ( nBlockTime >= 1490159171 ) // 246748 + if ( komodo_validate_interest(expiredp,tx,interesttime) < 0 ) //if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -810,7 +810,7 @@ bool CheckFinalTx(const CTransaction &tx, int flags) ? chainActive.Tip()->GetMedianTimePast() : GetAdjustedTime(); - return IsFinalTx(0,tx, nBlockHeight, nBlockTime,flags); + return IsFinalTx(0,tx, nBlockHeight, nBlockTime,flags,chainActive.Tip()->nTime); } /** @@ -3361,7 +3361,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST) ? pindexPrev->GetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(0,tx, nHeight, nLockTimeCutoff,0*STANDARD_LOCKTIME_VERIFY_FLAGS)) { + if (!IsFinalTx(0,tx, nHeight, nLockTimeCutoff,0*STANDARD_LOCKTIME_VERIFY_FLAGS,pindexPrev->nTime)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } diff --git a/src/main.h b/src/main.h index dcbd236325a..1bea5030f4a 100644 --- a/src/main.h +++ b/src/main.h @@ -351,7 +351,7 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason); * Check if transaction is final and can be included in a block with the * specified height and time. Consensus critical. */ -bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int64_t nBlockTime, int flags); +bool IsFinalTx(uint32_t *expiredp,const CTransaction &tx, int nBlockHeight, int64_t nBlockTime, int flags,int32_t interesttime); /** * Check if transaction will be final in the next block to be created. diff --git a/src/miner.cpp b/src/miner.cpp index be3153c570f..ee7c608b278 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -202,7 +202,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) ? nMedianTimePast : pblock->GetBlockTime(); - if (tx.IsCoinBase() || !IsFinalTx(&expired,tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) + if (tx.IsCoinBase() || !IsFinalTx(&expired,tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS,chainActive.Tip()->nTime)) { if ( expired != 0 ) { From 3fb77104701e37bdc6d097e60290b9e89f7ce7cf Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 07:25:53 +0200 Subject: [PATCH 258/258] Post-fork with mining --- src/miner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index ee7c608b278..91318d64119 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -206,12 +206,12 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) { if ( expired != 0 ) { - fprintf(stderr,"expire from mempool tx.\n");//(%d %d) %.8f\n",tx.vins.size(),tx.vouts.size(),(double)tx.vouts[0].nValue/COIN); + fprintf(stderr,"expire from mempool tx. need to verify this works\n");//(%d %d) %.8f\n",tx.vins.size(),tx.vouts.size(),(double)tx.vouts[0].nValue/COIN); list removed; mempool.remove(tx, removed, true); } continue; - } else fprintf(stderr,"coinbase or is finaltx (%d %u)\n",(int32_t)nHeight,(uint32_t)tx.nLockTime); + } //else fprintf(stderr,"coinbase or is finaltx (%d %u)\n",(int32_t)nHeight,(uint32_t)tx.nLockTime); COrphan* porphan = NULL; double dPriority = 0; CAmount nTotalIn = 0;