From ffbc2f003750a18d414b57342aed266418e0aab9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 20 Nov 2016 15:12:55 -0300 Subject: [PATCH] test --- src/komodo_bitcoind.h | 5 ++++- src/komodo_gateway.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 80bb43f79..163af2e97 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -580,7 +580,10 @@ uint64_t komodo_accrued_interest(int32_t *txheightp,uint32_t *locktimep,uint256 int32_t komodo_isrealtime(int32_t *kmdheightp) { - *kmdheightp = (int32_t)chainActive.Tip()->nHeight; + struct komodo_state *sp; + if ( (sp= komodo_stateptrget("KMD")) != 0 ) + *kmdheightp = sp->CURRENT_HEIGHT; + else *kmdheightp = 0; if ( *kmdheightp != 0 && *kmdheightp == (int32_t)komodo_longestchain() ) return(1); else return(0); diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 295dc6c90..4f97224ae 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -363,7 +363,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 checktoshis = PAX_fiatdest(&seed,tokomodo,destaddr,pubkey33,coinaddr,kmdheight,base,value); typestr = "withdraw"; printf("%s.height.%d vs height.%d check %.8f/%.8f vs %.8f tokomodo.%d %d seed.%llx -> (%s)\n",ASSETCHAINS_SYMBOL,kmdheight,height,dstr(checktoshis),dstr(komodoshis),dstr(value),komodo_is_issuer(),strncmp(ASSETCHAINS_SYMBOL,base,strlen(base)) == 0,(long long)seed,coinaddr); - if ( (pax= komodo_paxfind(&space,txid,vout)) != 0 ) + if ( (pax= komodo_paxfind(&space,txid,vout)) == 0 ) { printf("notarize %s %.8f -> %.8f kmd.%d other.%d\n",ASSETCHAINS_SYMBOL,dstr(value),dstr(komodoshis),kmdheight,height); } else printf(" %.8f -> %s withdraw already there\n",dstr(value),coinaddr);