From 2fbdcf4ebebdcfaae76df39754e4c6f9384791ba Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 26 Dec 2016 08:30:14 +0200 Subject: [PATCH 1/3] fix pax price --- src/komodo_pax.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/komodo_pax.h b/src/komodo_pax.h index 53d4f0d2d..4866e502d 100644 --- a/src/komodo_pax.h +++ b/src/komodo_pax.h @@ -429,6 +429,7 @@ uint64_t _komodo_paxprice(uint64_t *kmdbtcp,uint64_t *btcusdp,int32_t height,cha height -= 10; if ( (baseid= komodo_baseid(base)) >= 0 && (relid= komodo_baseid(rel)) >= 0 ) { + portable_mutex_lock(&komodo_mutex); for (i=NUM_PRICES-1; i>=0; i--) { ptr = &PVALS[36 * i]; @@ -439,11 +440,13 @@ uint64_t _komodo_paxprice(uint64_t *kmdbtcp,uint64_t *btcusdp,int32_t height,cha *kmdbtcp = ptr[MAX_CURRENCIES + 1] / 539; *btcusdp = ptr[MAX_CURRENCIES + 2] / 539; } + portable_mutex_unlock(&komodo_mutex); if ( kmdbtc != 0 && btcusd != 0 ) return(komodo_paxcalc(&ptr[1],baseid,relid,basevolume,kmdbtc,btcusd)); else return(0); } } + portable_mutex_unlock(&komodo_mutex); } //else printf("paxprice invalid base.%s %d, rel.%s %d\n",base,baseid,rel,relid); return(0); } From 2e5752167300a6aa1135ac14baead38bda6f5a87 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 26 Dec 2016 08:40:35 +0200 Subject: [PATCH 2/3] test --- src/komodo_gateway.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index cdd300797..d6be98160 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -424,9 +424,9 @@ int32_t komodo_pending_withdraws(char *opretstr) // todo: enforce deterministic if ( n < sizeof(paxes)/sizeof(*paxes) ) { paxes[n++] = pax; - int32_t j; for (j=0; j<32; j++) - printf("%02x",((uint8_t *)&pax->txid)[j]); - printf(" %s.(kmdht.%d ht.%d marked.%u approved.%d validated %.8f) %.8f\n",pax->source,pax->height,pax->otherheight,pax->marked,pax->approved,dstr(pax->validated),dstr(pax->komodoshis)); + //int32_t j; for (j=0; j<32; j++) + // printf("%02x",((uint8_t *)&pax->txid)[j]); + //printf(" %s.(kmdht.%d ht.%d marked.%u approved.%d validated %.8f) %.8f\n",pax->source,pax->height,pax->otherheight,pax->marked,pax->approved,dstr(pax->validated),dstr(pax->komodoshis)); } } } From 6755c2aa31dab632cc27619a70de6f20a55407f0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 26 Dec 2016 08:44:26 +0200 Subject: [PATCH 3/3] 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 d6be98160..27af234cb 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -640,7 +640,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above { printf("WOULD REJECT %s: ht.%d (%c) matched.%d vs num.%d\n",symbol,height,opcode,matched,num); // can easily happen depending on order of loading - if ( height > 150000 ) + if ( height > 200000 ) { printf("REJECT: ht.%d (%c) matched.%d vs num.%d\n",height,opcode,matched,num); return(-1);