From 44caf46a60a0b1d2af1362c87d8c31194888646e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 3 Dec 2016 11:15:29 -0300 Subject: [PATCH] test --- src/komodo_gateway.h | 1 + src/miner.cpp | 4 ++-- src/pow.cpp | 9 ++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index e43e087d3..38bcbb5f3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -582,6 +582,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 pax2->fiatoshis = pax->fiatoshis; pax2->komodoshis = pax->komodoshis; pax->marked = pax2->marked = pax->height; + pax->otherheight = height; if ( pax2->didstats == 0 ) { if ( (basesp= komodo_stateptrget(base)) != 0 ) diff --git a/src/miner.cpp b/src/miner.cpp index 4134248fb..5ef1ecba8 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -378,9 +378,9 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) if ( ASSETCHAINS_SYMBOL[0] == 0 ) { int32_t i,opretlen; uint8_t opret[256],*ptr; - if ( komodo_gateway_deposits(&txNew,(char *)"KMD",1) == 0 ) + if ( (nHeight % 60) == 0 || komodo_gateway_deposits(&txNew,(char *)"KMD",1) == 0 ) { - if ( (opretlen= komodo_pax_opreturn(opret,sizeof(opret))) > 0 ) + if ( (opretlen= komodo_pax_opreturn(opret,sizeof(opret))) > 0 ) // have pricefeed { txNew.vout.resize(2); txNew.vout[1].scriptPubKey.resize(opretlen); diff --git a/src/pow.cpp b/src/pow.cpp index 7aaa9ec55..6fb7a492a 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -145,9 +145,12 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in // Check proof of work matches claimed amount if ( UintToArith256(hash) > bnTarget ) { - //for (i=0; i<33; i++) - // printf("%02x",pubkey33[i]); - //printf(" special.%d notaryid.%d ht.%d mod.%d error\n",special,notaryid,height,(height % 35)); + for (i=0; i<32; i++) + printf("%02x",((uint8_t *)&hash)[i]); + printf(" hash vs ") + for (i=0; i<32; i++) + printf("%02x",((uint8_t *)&bnTarget)[i]); + printf(" special.%d notaryid.%d ht.%d mod.%d error\n",special,notaryid,height,(height % 35)); return error("CheckProofOfWork(): hash doesn't match nBits"); } return true;