From a2a15c59f87d1b1f016aeb1a3e7480803c36c022 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 26 Mar 2017 21:46:49 +0300 Subject: [PATCH] Test --- src/komodo_gateway.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 9de8bb545..7669bc061 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -944,11 +944,12 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above char destaddr[64],coinaddr[64]; uint8_t pubkey33[33]; checktoshis = PAX_fiatdest(&seed,0,destaddr,pubkey33,coinaddr,pax->height,CURRENCIES[baseids[i-1]],pax->fiatoshis); //checktoshis = komodo_paxprice(&seed,pax->height,CURRENCIES[baseids[i-1]],(char *)"KMD",(uint64_t)pax->komodoshis); - if ( komodo_paxcmp(CURRENCIES[baseids[i-1]],pax->height,pax->komodoshis,checktoshis,0) == 0 ) - printf("paxcmp PASS "); - else printf("paxcmp FAIL "); - - printf("check deposit validates %s.%d [%d] %.8f -> %.8f (%.8f %.8f %.8f)\n",CURRENCIES[baseids[i-1]],height,i,dstr(srcvalues[i-1]),dstr(values[i-1]),dstr(pax->komodoshis),dstr(pax->fiatoshis),dstr(block.vtx[0].vout[i].nValue)); + if ( komodo_paxcmp(CURRENCIES[baseids[i-1]],pax->height,pax->komodoshis,checktoshis,seed) < 0 ) + { + printf("paxcmp FAIL "); + printf("check deposit validates %s.%d [%d] %.8f -> %.8f (%.8f %.8f %.8f)\n",CURRENCIES[baseids[i-1]],height,i,dstr(srcvalues[i-1]),dstr(values[i-1]),dstr(pax->komodoshis),dstr(pax->fiatoshis),dstr(block.vtx[0].vout[i].nValue)); + return(-1); + } } } else if ( strcmp(ASSETCHAINS_SYMBOL,CURRENCIES[baseids[i-1]]) == 0 )