From 09ad6d1d61e90b4482e63326b8faf4dde078f922 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 22 Nov 2016 07:02:45 -0300 Subject: [PATCH 1/8] test --- src/miner.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 0bb74a0cc..fc991af62 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -609,7 +609,7 @@ void static BitcoinMiner(CWallet *pwallet) } else Mining_start = 0; while (true) { - if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) + //if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"%s start mining loop\n",ASSETCHAINS_SYMBOL); // Hash state KOMODO_CHOSEN_ONE = 0; @@ -637,13 +637,13 @@ void static BitcoinMiner(CWallet *pwallet) solutionTargetChecks.increment(); if ( UintToArith256(pblock->GetHash()) > hashTarget ) { - if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) + //if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"missed target\n"); return false; } if ( ASSETCHAINS_SYMBOL[0] == 0 && Mining_start != 0 && time(NULL) < Mining_start+ROUNDROBIN_DELAY ) { - //printf("Round robin diff sleep %d\n",(int32_t)(Mining_start+ROUNDROBIN_DELAY-time(NULL))); + printf("Round robin diff %d\n",(int32_t)(Mining_start+ROUNDROBIN_DELAY-time(NULL))); sleep(Mining_start+ROUNDROBIN_DELAY-time(NULL)); KOMODO_CHOSEN_ONE = 1; } From cf3a235af2d41705f4145ae9e33775064150e835 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 22 Nov 2016 07:03:33 -0300 Subject: [PATCH 2/8] test --- src/miner.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index fc991af62..0bb74a0cc 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -609,7 +609,7 @@ void static BitcoinMiner(CWallet *pwallet) } else Mining_start = 0; while (true) { - //if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) + if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"%s start mining loop\n",ASSETCHAINS_SYMBOL); // Hash state KOMODO_CHOSEN_ONE = 0; @@ -637,13 +637,13 @@ void static BitcoinMiner(CWallet *pwallet) solutionTargetChecks.increment(); if ( UintToArith256(pblock->GetHash()) > hashTarget ) { - //if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) + if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"missed target\n"); return false; } if ( ASSETCHAINS_SYMBOL[0] == 0 && Mining_start != 0 && time(NULL) < Mining_start+ROUNDROBIN_DELAY ) { - printf("Round robin diff %d\n",(int32_t)(Mining_start+ROUNDROBIN_DELAY-time(NULL))); + //printf("Round robin diff sleep %d\n",(int32_t)(Mining_start+ROUNDROBIN_DELAY-time(NULL))); sleep(Mining_start+ROUNDROBIN_DELAY-time(NULL)); KOMODO_CHOSEN_ONE = 1; } From b3a19ed164f2af0d3b117c9caf53e4e3191d070d Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 22 Nov 2016 07:11:21 -0300 Subject: [PATCH 3/8] test --- src/komodo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 1fcc8b5a1..e0d96c42e 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -514,8 +514,8 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) } if ( notarized != 0 && (notarizedheight != 0 || specialtx != 0) ) { - printf("%s NOTARY SIGNED.%llx numvins.%d ht.%d txi.%d notaryht.%d specialtx.%d\n",ASSETCHAINS_SYMBOL,(long long)signedmask,numvins,height,i,notarizedheight,specialtx); - printf("ht.%d specialtx.%d isratification.%d numvouts.%d signed.%llx numnotaries.%d\n",height,specialtx,isratification,numvouts,(long long)signedmask,numnotaries); + //printf("%s NOTARY SIGNED.%llx numvins.%d ht.%d txi.%d notaryht.%d specialtx.%d\n",ASSETCHAINS_SYMBOL,(long long)signedmask,numvins,height,i,notarizedheight,specialtx); + //printf("ht.%d specialtx.%d isratification.%d numvouts.%d signed.%llx numnotaries.%d\n",height,specialtx,isratification,numvouts,(long long)signedmask,numnotaries); if ( specialtx != 0 && isratification != 0 && numvouts > 2 ) { numvalid = 0; From 3237fdd4e41ea845d5b80f1bb42a5ca5ea8ec62c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 22 Nov 2016 08:47:03 -0300 Subject: [PATCH 4/8] test --- src/komodo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo.h b/src/komodo.h index e0d96c42e..50a6941ee 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -371,7 +371,6 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr len += iguana_rwbignum(0,&scriptbuf[len],32,(uint8_t *)&kmdtxid); len += iguana_rwnum(0,&scriptbuf[len],4,(uint8_t *)notarizedheightp); len += iguana_rwbignum(0,&scriptbuf[len],32,(uint8_t *)&desttxid); - len += 4; if ( notarized != 0 && *notarizedheightp > sp->NOTARIZED_HEIGHT && *notarizedheightp < height ) { printf("%s ht.%d NOTARIZED.%d %s.%s %sTXID.%s (%s)\n",ASSETCHAINS_SYMBOL,height,*notarizedheightp,ASSETCHAINS_SYMBOL[0]==0?"KMD":ASSETCHAINS_SYMBOL,kmdtxid.ToString().c_str(),ASSETCHAINS_SYMBOL[0]==0?"BTC":"KMD",desttxid.ToString().c_str(),(char *)&scriptbuf[len]); @@ -379,6 +378,7 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr sp->NOTARIZED_HASH = kmdtxid; sp->NOTARIZED_DESTTXID = desttxid; komodo_stateupdate(height,0,0,0,zero,0,0,0,0,0,0,0,0,0,0); + len += 4; if ( opretlen > len )//&& scriptbuf[len] == 'A' ) { printf("Found extradata.[%d]\n",opretlen-len); From 9ce7f64fb742f19485fcb1602c7f26364a81cf62 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 22 Nov 2016 08:48:09 -0300 Subject: [PATCH 5/8] test --- src/komodo.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 50a6941ee..d8543f304 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -381,7 +381,7 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr len += 4; if ( opretlen > len )//&& scriptbuf[len] == 'A' ) { - printf("Found extradata.[%d]\n",opretlen-len); + printf("Found extradata.[%d] %d - %d\n",opretlen-len,opretlen,len); komodo_stateupdate(height,0,0,0,txhash,0,0,0,0,0,0,value,&scriptbuf[len],opretlen-len,j); } } else printf("notarized.%d %llx reject ht.%d NOTARIZED.%d %s.%s DESTTXID.%s (%s)\n",notarized,(long long)signedmask,height,*notarizedheightp,ASSETCHAINS_SYMBOL[0]==0?"KMD":ASSETCHAINS_SYMBOL,kmdtxid.ToString().c_str(),desttxid.ToString().c_str(),(char *)&scriptbuf[len]); @@ -486,8 +486,8 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) } } numvalid = bitweight(signedmask); - if ( height == 79633 ) - notarized = 1; + //if ( height == 79633 ) + // notarized = 1; if ( (((height < 90000 || (signedmask & 1) != 0) && numvalid >= KOMODO_MINRATIFY) || bitweight(signedmask) > (numnotaries>>1)) ) { printf("%s ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d <<<<<<<<<<< notarized\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts); From cc448572556a18dc28d5b4193f813c87e69b27f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 22 Nov 2016 08:48:40 -0300 Subject: [PATCH 6/8] 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 38aeb1847..51eb5f02e 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -480,7 +480,7 @@ void komodo_passport_iteration() else refid = komodo_baseid(ASSETCHAINS_SYMBOL)+1; // illegal base -> baseid.-1 -> 0 //printf("PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,refid); for (baseid=0; baseid<=32; baseid++) - { + {break; sp = 0; isrealtime = 0; base = (char *)CURRENCIES[baseid]; From 939a5a457e769440bd13a799cef54db0c1bd022b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 22 Nov 2016 08:52:04 -0300 Subject: [PATCH 7/8] test --- src/komodo.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/komodo.h b/src/komodo.h index d8543f304..7faf16f5c 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -159,7 +159,12 @@ int32_t komodo_parsestatefile(struct komodo_state *sp,FILE *fp,char *symbol,char printf(" %s.%d load[%s] opret[%c] len.%d %.8f\n",ASSETCHAINS_SYMBOL,ht,symbol,opret[0],olen,(double)ovalue/COIN); } komodo_eventadd_opreturn(sp,symbol,ht,txid,ovalue,v,opret,olen); // global shared state -> global PAX - } else printf("illegal olen.%u\n",olen); + } else + { + for (i=0; i Date: Tue, 22 Nov 2016 08:54:54 -0300 Subject: [PATCH 8/8] test --- src/komodo.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/komodo.h b/src/komodo.h index 7faf16f5c..141ca8f2d 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -161,6 +161,7 @@ int32_t komodo_parsestatefile(struct komodo_state *sp,FILE *fp,char *symbol,char komodo_eventadd_opreturn(sp,symbol,ht,txid,ovalue,v,opret,olen); // global shared state -> global PAX } else { + int32_t i; for (i=0; i