From a7f0d3e492c99ed6a792145d604dd6c2a9ba2b5b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 6 Nov 2016 12:00:37 -0300 Subject: [PATCH] test --- src/komodo.h | 8 ++++++++ src/komodo_gateway.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/komodo.h b/src/komodo.h index d6da8ba53..0e0589284 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -343,10 +343,18 @@ int32_t komodo_isratify(int32_t isspecial,int32_t numvalid) void komodo_connectblock(CBlockIndex *pindex,CBlock& block) { + static int32_t hwmheight; uint64_t signedmask,voutmask; uint8_t scriptbuf[4096],pubkeys[64][33]; uint256 kmdtxid,btctxid,txhash; int32_t i,j,k,numvalid,specialtx,notarizedheight,notaryid,len,numvouts,numvins,height,txn_count; komodo_init(); + if ( pindex->nHeight > hwmheight ) + hwmheight = pindex->nHeight; + else + { + printf("hwmheight.%d vs pindex->nHeight.%d reorg.%d\n",hwmheight,pindex->nHeight,hwmheight-pindex->nHeight); + // reset komodostate + } if ( ASSETCHAINS_SYMBOL[0] != 0 ) { while ( KOMODO_REALTIME == 0 || time(NULL) <= KOMODO_REALTIME ) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 69ee8e381..a4170d504 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -398,6 +398,7 @@ void komodo_gateway_iteration(char *symbol) { if ( (result= jobj(infoobj,(char *)"result")) != 0 && (kmdheight= jint(result,(char *)"blocks")) != 0 ) { + printf("gateway KMDHEIGHT.%d kmdheight.%d\n",KMDHEIGHT,kmdheight); for (i=0; i<1000 && KMDHEIGHT