From 4415b53eede8804471cfeb443938a0df35188adc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Apr 2017 09:48:38 +0300 Subject: [PATCH 1/9] Test --- src/komodo_gateway.h | 12 ++++++++---- src/main.cpp | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 1cdce2c29..f686ec987 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1004,10 +1004,14 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else { - for (i=0; i Date: Mon, 10 Apr 2017 09:57:54 +0300 Subject: [PATCH 2/9] Test --- src/komodo_gateway.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index f686ec987..904282be1 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1004,14 +1004,10 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } else { - static uint32_t counter; - if ( counter++ < 100 ) - { - for (i=0; i Date: Mon, 10 Apr 2017 09:58:57 +0300 Subject: [PATCH 3/9] 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 904282be1..c11cc4836 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1007,7 +1007,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above for (i=0; i Date: Mon, 10 Apr 2017 10:06:42 +0300 Subject: [PATCH 4/9] Test --- src/komodo_gateway.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index c11cc4836..af34d0fa3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -720,6 +720,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } //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]); + printf("offset.%d opretlen.%d [%02x %02x %02x %02x]\n",offset,operetlen,script[0],script[1],script[2],script[3]); if ( ASSETCHAINS_SYMBOL[0] == 0 ) { opcode = 'X'; From 967c5efdff07b2dc8de27344cd8cfcd0f48d42fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Apr 2017 10:08:08 +0300 Subject: [PATCH 5/9] 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 af34d0fa3..87dfcab69 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -720,7 +720,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } //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]); - printf("offset.%d opretlen.%d [%02x %02x %02x %02x]\n",offset,operetlen,script[0],script[1],script[2],script[3]); + printf("offset.%d opretlen.%d [%02x %02x %02x %02x]\n",offset,opretlen,script[0],script[1],script[2],script[3]); if ( ASSETCHAINS_SYMBOL[0] == 0 ) { opcode = 'X'; From 4206dee514238ee1386952dd7b813a0f81bed134 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Apr 2017 10:12:40 +0300 Subject: [PATCH 6/9] Test --- src/komodo_utils.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 1131302df..81543a064 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -977,8 +977,10 @@ int32_t komodo_scriptitemlen(int32_t *opretlenp,uint8_t *script) opretlen = script[len++]; else if ( opretlen == 0x4d ) { - opretlen = script[len++]; - opretlen = (opretlen << 8) | script[len++]; + opretlen = script[len] + (script[len+1] << 8); + len += 2; + //opretlen = script[len++]; + //opretlen = (opretlen << 8) | script[len++]; } } *opretlenp = opretlen; From f11e832013c8d5eb6cfcece3b38812fd4b7de49b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Apr 2017 10:17:07 +0300 Subject: [PATCH 7/9] Test --- src/komodo_gateway.h | 2 +- src/miner.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 87dfcab69..a6ccf8207 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -720,7 +720,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above } //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]); - printf("offset.%d opretlen.%d [%02x %02x %02x %02x]\n",offset,opretlen,script[0],script[1],script[2],script[3]); + //printf("offset.%d opretlen.%d [%02x %02x %02x %02x]\n",offset,opretlen,script[0],script[1],script[2],script[3]); if ( ASSETCHAINS_SYMBOL[0] == 0 ) { opcode = 'X'; diff --git a/src/miner.cpp b/src/miner.cpp index af834fe43..87c4ba6d4 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -736,7 +736,7 @@ void static BitcoinMiner() CBlock *pblock = &pblocktemplate->block; if ( ASSETCHAINS_SYMBOL[0] != 0 ) { - if ( pblock->vtx.size() == 1 && Mining_height > ASSETCHAINS_MINHEIGHT ) + if ( pblock->vtx.size() == 1 && pblock->vtx[0].vout.size() == 1 && Mining_height > ASSETCHAINS_MINHEIGHT ) { static uint32_t counter; if ( counter++ < 10 ) From 20b4fe1d43642c5bd21862e0a9a3d2ef7e5ec484 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Apr 2017 15:35:21 +0300 Subject: [PATCH 8/9] Test --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index 87c4ba6d4..436789b86 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -708,7 +708,7 @@ void static BitcoinMiner() Mining_height = pindexPrev->nHeight+1; Mining_start = (uint32_t)time(NULL); } - if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) + if ( 1 && ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"%s create new block ht.%d\n",ASSETCHAINS_SYMBOL,Mining_height); #ifdef ENABLE_WALLET CBlockTemplate *ptr = CreateNewBlockWithKey(reservekey); From 41ebe9c6a83d0a34b957cce6b8bcb90345c9639b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Apr 2017 15:41:40 +0300 Subject: [PATCH 9/9] Test --- src/miner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 436789b86..6dd2d4a35 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -135,7 +135,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) return NULL; } CBlock *pblock = &pblocktemplate->block; // pointer for convenience - if ( ASSETCHAINS_SYMBOL[0] != 0 && chainActive.Tip()->nHeight >= ASSETCHAINS_MINHEIGHT ) + if ( ASSETCHAINS_SYMBOL[0] != 0 && komodo_baseid(ASSETCHAINS_SYMBOL) >= 0 && chainActive.Tip()->nHeight >= ASSETCHAINS_MINHEIGHT ) { isrealtime = komodo_isrealtime(&kmdheight); deposits = komodo_paxtotal(); @@ -549,7 +549,7 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) script[34] = OP_CHECKSIG; //scriptPubKey = CScript() << ToByteVector(pubkey) << OP_CHECKSIG; } - if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) + if ( 1 && ASSETCHAINS_SYMBOL[0] != 0 ) { for (i=0; i<65; i++) fprintf(stderr,"%d ",komodo_minerid(chainActive.Tip()->nHeight-i,0));