From dd278be29a42921e4df866c5772b3d5f59fea472 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 16:21:37 +0200 Subject: [PATCH] test --- src/komodo_bitcoind.h | 5 +++++ src/komodo_gateway.h | 2 +- src/pow.cpp | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 026222022..c290930a0 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -605,6 +605,11 @@ void komodo_connectpindex(CBlockIndex *pindex) komodo_connectblock(pindex,block); } +void *komodo_chainactive(int32_t height) +{ + return(chainActive[height]); +} + int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height); int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height); diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index cb3a3b0ec..c1b7e6327 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -942,7 +942,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 } } } - } else printf("n.%d from opreturns\n",n); + } //else printf("n.%d from opreturns\n",n); //printf("extra.[%d] after %.8f\n",n,dstr(komodo_paxtotal())); } else if ( opretbuf[0] == 'X' ) diff --git a/src/pow.cpp b/src/pow.cpp index b17da9746..bdee41c80 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -107,6 +107,7 @@ bool CheckEquihashSolution(const CBlockHeader *pblock, const CChainParams& param int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33); int32_t komodo_is_special(int32_t height,uint8_t pubkey33[33]); int32_t komodo_currentheight(); +void *komodo_chainactive(int32_t height); int8_t komodo_minerid(int32_t height,uint8_t *pubkey33); extern int32_t KOMODO_CHOSEN_ONE; #define KOMODO_ELECTION_GAP 2000 @@ -157,7 +158,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in if ( UintToArith256(hash) > bnTarget ) { { - if ( height > 180000 && KOMODO_REWIND == 0 ) + if ( height > 180000 && KOMODO_REWIND == 0 && komodo_chainactive(height) != 0 ) { int32_t i; for (i=31; i>=0; i--)