From 6615cec94956f431b2374ca302b4d33b27ee1a2c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Mar 2017 04:27:54 +0200 Subject: [PATCH 1/8] Test --- src/clientversion.h | 2 +- src/komodo.h | 14 ++++++++++++++ src/komodo_gateway.h | 26 ++++++++++++++------------ src/main.cpp | 12 +++++++----- src/primitives/transaction.h | 2 +- 5 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/clientversion.h b/src/clientversion.h index 33056403b..db38f0bf4 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -17,7 +17,7 @@ #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 0 #define CLIENT_VERSION_REVISION 5 -#define CLIENT_VERSION_BUILD 50 +#define CLIENT_VERSION_BUILD 51 //! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/komodo.h b/src/komodo.h index 15ee384aa..bd842741a 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -546,6 +546,20 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) } for (j=0; j 235300 && block.vtx[0].vout[1].nValue >= 100000*COIN ) + block.vtx[0].vout[1].nValue = 0; + break; + } + } + } len = block.vtx[i].vout[j].scriptPubKey.size(); if ( len >= sizeof(uint32_t) && len <= sizeof(scriptbuf) ) { diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 85efb1694..aab7bd2b1 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -588,7 +588,7 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to return(0); } -int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above block is valid pax pricing +int32_t komodo_check_deposit(int32_t height,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; memset(baseids,0xff,sizeof(baseids)); @@ -597,19 +597,21 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above memset(rmd160s,0,sizeof(rmd160s)); memset(kmdheights,0,sizeof(kmdheights)); memset(otherheights,0,sizeof(otherheights)); - n = block.vtx[0].vout.size(); - script = (uint8_t *)block.vtx[0].vout[n-1].scriptPubKey.data(); + 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 ) + if ( n == 2 && block->vtx[0].vout[1].nValue != 0 ) { - //fprintf(stderr,">>>>>>>> <<<<<<<<<< ht.%d illegal nonz output %.8f n.%d\n",height,dstr(block.vtx[0].vout[1].nValue),n); + //fprintf(stderr,">>>>>>>> <<<<<<<<<< ht.%d illegal nonz output %.8f n.%d\n",height,dstr(block->vtx[0].vout[1].nValue),n); + //if ( height > 235300 && block->vtx[0].vout[1].nValue >= 100000*COIN ) + // block->vtx[0].vout[1].nValue = 0; if ( height > 236000 ) 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); + //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); if ( komodo_isrealtime(&ht) == 0 || KOMODO_PASSPORT_INITDONE == 0 ) //KOMODO_PAX == 0 || return(0); offset += komodo_scriptitemlen(&opretlen,&script[offset]); @@ -627,7 +629,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above opcode = 'I'; if ( komodo_baseid(symbol) < 0 ) { - if ( block.vtx[0].vout.size() != 1 ) + if ( block->vtx[0].vout.size() != 1 ) { printf("%s has more than one coinbase?\n",symbol); return(-1); @@ -635,7 +637,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above return(0); } } - if ( script[offset] == opcode && opretlen < block.vtx[0].vout[n-1].scriptPubKey.size() ) + 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 ) { @@ -655,11 +657,11 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above 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)); continue; } - if ( ((opcode == 'I' && (pax->fiatoshis == 0 || pax->fiatoshis == block.vtx[0].vout[i].nValue)) || (opcode == 'X' && (pax->komodoshis == 0 || pax->komodoshis == block.vtx[0].vout[i].nValue))) ) + if ( ((opcode == 'I' && (pax->fiatoshis == 0 || pax->fiatoshis == block->vtx[0].vout[i].nValue)) || (opcode == 'X' && (pax->komodoshis == 0 || pax->komodoshis == block->vtx[0].vout[i].nValue))) ) { 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\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 @@ -676,12 +678,12 @@ 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\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block->vtx[0].vout[i].nValue),pax); } } else if ( kmdheights[i-1] > 0 && otherheights[i-1] > 0 ) { - hash = block.GetHash(); + 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); diff --git a/src/main.cpp b/src/main.cpp index 4adbc26a5..a488018b8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2026,9 +2026,11 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex // but it must be corrected before txout nversion ever influences a network rule. if (outsBlock.nVersion < 0) outs->nVersion = outsBlock.nVersion; - if (*outs != outsBlock) - fClean = fClean && error("DisconnectBlock(): added transaction mismatch? database corrupted"); - + if ( i != 0 || tx.vout.size() != 2 || tx.vout[1].nValue < COIN ) + { + if (*outs != outsBlock) + fClean = fClean && error("DisconnectBlock(): added transaction mismatch? database corrupted"); + } // remove outputs outs->Clear(); } @@ -3129,7 +3131,7 @@ bool CheckBlockHeader(int32_t height,CBlockIndex *pindex, const CBlockHeader& bl return true; } -int32_t komodo_check_deposit(int32_t height,const CBlock& block); +int32_t komodo_check_deposit(int32_t height,CBlock *block); bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidationState& state, libzcash::ProofVerifier& verifier, bool fCheckPOW, bool fCheckMerkleRoot) @@ -3188,7 +3190,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(height,(CBlock *)&block) < 0 ) return(false); return true; } diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 1645285fc..433ce879b 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -333,7 +333,7 @@ public: // structure, including the hash. const int32_t nVersion; const std::vector vin; - const std::vector vout; + std::vector vout; const uint32_t nLockTime; const std::vector vjoinsplit; const uint256 joinSplitPubKey; From c7a3aca61018f34fc580c1f8d197fdb9d8bc9cd3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Mar 2017 05:17:29 +0200 Subject: [PATCH 2/8] Test --- src/komodo_gateway.h | 63 +++++++++++++++++++++++++++--------- src/main.cpp | 12 +++---- src/primitives/transaction.h | 2 +- 3 files changed, 53 insertions(+), 24 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index aab7bd2b1..a20e4c452 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -588,30 +588,61 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to return(0); } -int32_t komodo_check_deposit(int32_t height,CBlock *block) // verify above block is valid pax pricing +char *banned_txids[] = { - 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; + "c85dcffb16d5a45bd239021ad33443414d60224760f11d535ae2063e5709efee", // 235296 + "a01671c8775328a41304e31a6693bbd35e9acbab28ab117f729eaba9cb769461", // 235265 + "fa9943525f2e6c32cbc243294b08187e314d83a2870830180380c3c12a9fd33c", // 235253 +}; + +void komodo_bannedset(uint256 *array,int32_t max) +{ + int32_t i; + for (i=0; ivtx[0].vout.size(); - script = (uint8_t *)block->vtx[0].vout[n-1].scriptPubKey.data(); + txn_count = block.vtx.size(); + for (i=0; ivtx[0].vout[1].nValue != 0 ) + if ( n == 2 && block.vtx[0].vout[1].nValue != 0 ) { - //fprintf(stderr,">>>>>>>> <<<<<<<<<< ht.%d illegal nonz output %.8f n.%d\n",height,dstr(block->vtx[0].vout[1].nValue),n); - //if ( height > 235300 && block->vtx[0].vout[1].nValue >= 100000*COIN ) - // block->vtx[0].vout[1].nValue = 0; - if ( height > 236000 ) + //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); } 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); + //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); if ( komodo_isrealtime(&ht) == 0 || KOMODO_PASSPORT_INITDONE == 0 ) //KOMODO_PAX == 0 || return(0); offset += komodo_scriptitemlen(&opretlen,&script[offset]); @@ -629,7 +660,7 @@ int32_t komodo_check_deposit(int32_t height,CBlock *block) // verify above block opcode = 'I'; if ( komodo_baseid(symbol) < 0 ) { - if ( block->vtx[0].vout.size() != 1 ) + if ( block.vtx[0].vout.size() != 1 ) { printf("%s has more than one coinbase?\n",symbol); return(-1); @@ -637,7 +668,7 @@ int32_t komodo_check_deposit(int32_t height,CBlock *block) // verify above block return(0); } } - if ( script[offset] == opcode && opretlen < block->vtx[0].vout[n-1].scriptPubKey.size() ) + 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 ) { @@ -657,11 +688,11 @@ int32_t komodo_check_deposit(int32_t height,CBlock *block) // verify above block 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)); continue; } - if ( ((opcode == 'I' && (pax->fiatoshis == 0 || pax->fiatoshis == block->vtx[0].vout[i].nValue)) || (opcode == 'X' && (pax->komodoshis == 0 || pax->komodoshis == block->vtx[0].vout[i].nValue))) ) + if ( ((opcode == 'I' && (pax->fiatoshis == 0 || pax->fiatoshis == block.vtx[0].vout[i].nValue)) || (opcode == 'X' && (pax->komodoshis == 0 || pax->komodoshis == block.vtx[0].vout[i].nValue))) ) { 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\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 @@ -678,12 +709,12 @@ int32_t komodo_check_deposit(int32_t height,CBlock *block) // verify above block 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\n",opcode,errs,i,dstr(opcode == 'I' ? pax->fiatoshis : pax->komodoshis),dstr(block.vtx[0].vout[i].nValue),pax); } } else if ( kmdheights[i-1] > 0 && otherheights[i-1] > 0 ) { - hash = block->GetHash(); + 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); diff --git a/src/main.cpp b/src/main.cpp index a488018b8..4adbc26a5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2026,11 +2026,9 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex // but it must be corrected before txout nversion ever influences a network rule. if (outsBlock.nVersion < 0) outs->nVersion = outsBlock.nVersion; - if ( i != 0 || tx.vout.size() != 2 || tx.vout[1].nValue < COIN ) - { - if (*outs != outsBlock) - fClean = fClean && error("DisconnectBlock(): added transaction mismatch? database corrupted"); - } + if (*outs != outsBlock) + fClean = fClean && error("DisconnectBlock(): added transaction mismatch? database corrupted"); + // remove outputs outs->Clear(); } @@ -3131,7 +3129,7 @@ bool CheckBlockHeader(int32_t height,CBlockIndex *pindex, const CBlockHeader& bl return true; } -int32_t komodo_check_deposit(int32_t height,CBlock *block); +int32_t komodo_check_deposit(int32_t height,const CBlock& block); bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidationState& state, libzcash::ProofVerifier& verifier, bool fCheckPOW, bool fCheckMerkleRoot) @@ -3190,7 +3188,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,(CBlock *)&block) < 0 ) + if ( komodo_check_deposit(height,block) < 0 ) return(false); return true; } diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 433ce879b..1645285fc 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -333,7 +333,7 @@ public: // structure, including the hash. const int32_t nVersion; const std::vector vin; - std::vector vout; + const std::vector vout; const uint32_t nLockTime; const std::vector vjoinsplit; const uint256 joinSplitPubKey; From 6fe17943735df066fe1f0837c1629a10be30b50b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Mar 2017 05:19:56 +0200 Subject: [PATCH 3/8] Test --- src/komodo_gateway.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index a20e4c452..5f5a37be6 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -590,9 +590,21 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to char *banned_txids[] = { - "c85dcffb16d5a45bd239021ad33443414d60224760f11d535ae2063e5709efee", // 235296 - "a01671c8775328a41304e31a6693bbd35e9acbab28ab117f729eaba9cb769461", // 235265 - "fa9943525f2e6c32cbc243294b08187e314d83a2870830180380c3c12a9fd33c", // 235253 + "78cb4e21245c26b015b888b14c4f5096e18137d2741a6de9734d62b07014dfca", //233559 + "00697be658e05561febdee1aafe368b821ca33fbb89b7027365e3d77b5dfede5", //234172 + "e909465788b32047c472d73e882d79a92b0d550f90be008f76e1edaee6d742ea", //234187 + "f56c6873748a327d0b92b8108f8ec8505a2843a541b1926022883678fb24f9dc", //234188 + "abf08be07d8f5b3a433ddcca7ef539e79a3571632efd6d0294ec0492442a0204", //234213 + "3b854b996cc982fba8c06e76cf507ae7eed52ab92663f4c0d7d10b3ed879c3b0", //234367 + "fa9e474c2cda3cb4127881a40eb3f682feaba3f3328307d518589024a6032cc4", //234635 + "ca746fa13e0113c4c0969937ea2c66de036d20274efad4ce114f6b699f1bc0f3", //234662 + "43ce88438de4973f21b1388ffe66e68fda592da38c6ef939be10bb1b86387041", //234697 + "0aeb748de82f209cd5ff7d3a06f65543904c4c17387c9d87c65fd44b14ad8f8c", //234899 + "bbd3a3d9b14730991e1066bd7c626ca270acac4127131afe25f877a5a886eb25", //235252 + "fa9943525f2e6c32cbc243294b08187e314d83a2870830180380c3c12a9fd33c", //235253 + "a01671c8775328a41304e31a6693bbd35e9acbab28ab117f729eaba9cb769461", //235265 + "2ef49d2d27946ad7c5d5e4ab5c089696762ff04e855f8ab48e83bdf0cc68726d", //235295 + "c85dcffb16d5a45bd239021ad33443414d60224760f11d535ae2063e5709efee", //235296 }; void komodo_bannedset(uint256 *array,int32_t max) From 081ab21c6511b2c9167a6ec809f3fc805026002f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Mar 2017 05:21:36 +0200 Subject: [PATCH 4/8] Test --- src/komodo.h | 4 ++-- src/komodo_gateway.h | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index bd842741a..f430e0ca1 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -546,7 +546,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) } for (j=0; j= sizeof(uint32_t) && len <= sizeof(scriptbuf) ) { diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 5f5a37be6..33bcc19de 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -610,8 +610,8 @@ char *banned_txids[] = void komodo_bannedset(uint256 *array,int32_t max) { int32_t i; - for (i=0; i Date: Mon, 13 Mar 2017 05:23:17 +0200 Subject: [PATCH 5/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 33bcc19de..88f689fd8 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -588,7 +588,7 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to return(0); } -char *banned_txids[] = +const char *banned_txids[] = { "78cb4e21245c26b015b888b14c4f5096e18137d2741a6de9734d62b07014dfca", //233559 "00697be658e05561febdee1aafe368b821ca33fbb89b7027365e3d77b5dfede5", //234172 From 5411346597da541176d75e45521078eff255e0c9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Mar 2017 05:32:52 +0200 Subject: [PATCH 6/8] Test --- src/init.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index bf4e8a722..195a6e2c7 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1244,10 +1244,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()); From 79cf331dd5010620fb661f354527284df6dd444a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Mar 2017 05:33:45 +0200 Subject: [PATCH 7/8] Test --- src/init.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/init.cpp b/src/init.cpp index 195a6e2c7..2336a9101 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1244,6 +1244,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)); } + extern int32_t KOMODO_REWIND; if ( KOMODO_REWIND == 0 ) { if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", 3), From 49508d3c7537e2f54445c6865c69393195a11feb Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Mar 2017 05:39:44 +0200 Subject: [PATCH 8/8] Test --- src/komodo.h | 2 +- src/komodo_gateway.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index f430e0ca1..94fb1347c 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -554,7 +554,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) if ( numvouts == 2 && block.vtx[0].vout[1].nValue != 0 ) { fprintf(stderr,"ht.%d numvouts.%d value %.8f\n",height,numvouts,dstr(block.vtx[0].vout[1].nValue)); - if ( height > 235300 && block.vtx[0].vout[1].nValue >= 100000*COIN ) + if ( height >= 235300 && block.vtx[0].vout[1].nValue >= 100000*COIN ) block.vtx[0].vout[1].nValue = 0; break; } diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 88f689fd8..2ce8206f5 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -652,7 +652,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,">>>>>>>> <<<<<<<<<< ht.%d illegal nonz output %.8f n.%d\n",height,dstr(block.vtx[0].vout[1].nValue),n); - if ( height > 235300 ) + if ( height >= 235300 ) return(-1); } return(0);