From d083ecd54423d4b3ab3e139f484388351436037b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 21:33:35 +0200 Subject: [PATCH 1/5] Test --- src/komodo_gateway.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 62b544da6..60295eba6 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -602,7 +602,15 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above n = block.vtx[0].vout.size(); script = (uint8_t *)block.vtx[0].vout[n-1].scriptPubKey.data(); if ( n <= 2 || script[0] != 0x6a ) + { + if ( n == 2 && block.vtx[0].vout[1].nValue != 0 ) + { + fprintf(stderr,"illegal nonz output %.8f\n",dstr(block.vtx[0].vout[1].nValue)); + if ( height > 236000 ) + return(-1); + } return(0); + } offset += komodo_scriptitemlen(&opretlen,&script[offset]); if ( ASSETCHAINS_SYMBOL[0] == 0 ) { From 61abc97a8e834c51b3379549454504a47fa786d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 21:34:11 +0200 Subject: [PATCH 2/5] 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 60295eba6..4dd9aa0a6 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -605,7 +605,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above { if ( n == 2 && block.vtx[0].vout[1].nValue != 0 ) { - fprintf(stderr,"illegal nonz output %.8f\n",dstr(block.vtx[0].vout[1].nValue)); + fprintf(stderr,"ht.%d illegal nonz output %.8f\n",height,dstr(block.vtx[0].vout[1].nValue)); if ( height > 236000 ) return(-1); } From 8db7c5a1340bb6fd7cebbb5afa159c81aa7c2c1f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 21:47:27 +0200 Subject: [PATCH 3/5] Test --- src/komodo_gateway.h | 1 + src/komodo_notary.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 4dd9aa0a6..a8e2a6c87 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -601,6 +601,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above memset(otherheights,0,sizeof(otherheights)); n = block.vtx[0].vout.size(); script = (uint8_t *)block.vtx[0].vout[n-1].scriptPubKey.data(); + fprintf(stderr,"ht.%d n.%d nValue %.8f\n",height,n,dstr(block.vtx[0].vout[1].nValue)); if ( n <= 2 || script[0] != 0x6a ) { if ( n == 2 && block.vtx[0].vout[1].nValue != 0 ) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 372c74235..b727d3f58 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -217,7 +217,7 @@ void komodo_notarysinit(int32_t origheight,uint8_t pubkeys[64][33],int32_t num) memcpy(kp->pubkey,pubkeys[k],33); kp->notaryid = k; HASH_ADD_KEYPTR(hh,N.Notaries,kp->pubkey,33,kp); - if ( 1 && height > 10000 ) + if ( 0 && height > 10000 ) { for (i=0; i<33; i++) printf("%02x",pubkeys[k][i]); From c42dd6335c32f5960fde1f223f703955df8ef153 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 21:51:45 +0200 Subject: [PATCH 4/5] 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 a8e2a6c87..620c9b867 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -591,8 +591,6 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above block is valid pax pricing { int32_t i,j,n,ht,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 available,deposited,issued,withdrawn,approved,redeemed; int64_t values[64],srcvalues[64]; struct pax_transaction *pax; struct komodo_state *sp; - if ( KOMODO_PAX == 0 || komodo_isrealtime(&ht) == 0 || KOMODO_PASSPORT_INITDONE == 0 ) - return(0); memset(baseids,0xff,sizeof(baseids)); memset(values,0,sizeof(values)); memset(srcvalues,0,sizeof(srcvalues)); @@ -602,6 +600,8 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above n = block.vtx[0].vout.size(); script = (uint8_t *)block.vtx[0].vout[n-1].scriptPubKey.data(); fprintf(stderr,"ht.%d n.%d nValue %.8f\n",height,n,dstr(block.vtx[0].vout[1].nValue)); + if ( KOMODO_PAX == 0 || komodo_isrealtime(&ht) == 0 || KOMODO_PASSPORT_INITDONE == 0 ) + return(0); if ( n <= 2 || script[0] != 0x6a ) { if ( n == 2 && block.vtx[0].vout[1].nValue != 0 ) From aa7675b4d7cb9ee5b0a08ec3b027c570e7356983 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 21:55:14 +0200 Subject: [PATCH 5/5] 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 620c9b867..a8fd34e5d 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -599,14 +599,14 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above memset(otherheights,0,sizeof(otherheights)); n = block.vtx[0].vout.size(); script = (uint8_t *)block.vtx[0].vout[n-1].scriptPubKey.data(); - fprintf(stderr,"ht.%d n.%d nValue %.8f\n",height,n,dstr(block.vtx[0].vout[1].nValue)); + //fprintf(stderr,"ht.%d n.%d nValue %.8f\n",height,n,dstr(block.vtx[0].vout[1].nValue)); if ( KOMODO_PAX == 0 || komodo_isrealtime(&ht) == 0 || KOMODO_PASSPORT_INITDONE == 0 ) return(0); if ( n <= 2 || script[0] != 0x6a ) { if ( n == 2 && block.vtx[0].vout[1].nValue != 0 ) { - fprintf(stderr,"ht.%d illegal nonz output %.8f\n",height,dstr(block.vtx[0].vout[1].nValue)); + fprintf(stderr,"ht.%d illegal nonz output %.8f n.%d\n",height,dstr(block.vtx[0].vout[1].nValue),n); if ( height > 236000 ) return(-1); }