diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 79ff30f18..87edc62da 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -121,9 +121,7 @@ int32_t komodo_gateway_depositremove(uint256 txid,uint16_t vout) // assetchain c const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int32_t opretlen,uint256 txid,uint16_t vout) { uint8_t rmd160[20],addrtype,shortflag,pubkey33[33]; int32_t i,j,len,tokomodo=0; char base[4],coinaddr[64],destaddr[64]; int64_t fiatoshis,checktoshis; const char *typestr = "unknown"; -#ifdef KOMODO_ISSUER - tokomodo = 1; -#endif + tokomodo = (komodo_is_issuer() == 0); if ( opretbuf[0] == ((tokomodo != 0) ? 'D' : 'W') ) { if ( opretlen == 34 ) @@ -134,51 +132,57 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 fiatoshis = -fiatoshis; bitcoin_address(coinaddr,addrtype,rmd160,20); checktoshis = PAX_fiatdest(tokomodo,destaddr,pubkey33,coinaddr,height,base,fiatoshis); - for (i=0; i %s ",dstr(fiatoshis),shortflag!=0?'-':'+',base,coinaddr); - for (i=0; i<32; i++) - printf("%02x",((uint8_t *)&txid)[i]); - printf(" <- txid.v%u ",vout); - for (i=0; i<33; i++) - printf("%02x",pubkey33[i]); - printf(" checkpubkey check %.8f v %.8f dest.(%s)\n",dstr(checktoshis),dstr(value),destaddr); typestr = "deposit"; -#ifdef KOMODO_ISSUER - if ( strncmp(KOMODO_SOURCE,base,strlen(base)) == 0 && value >= (9999*checktoshis)/10000 && shortflag == ASSETCHAINS_SHORTFLAG ) + if ( tokomodo == 0 && strncmp(KOMODO_SOURCE,base,strlen(base)) == 0 ) { - komodo_gateway_deposit(value,shortflag,base,fiatoshis,rmd160,txid,vout); + for (i=0; i %s ",dstr(fiatoshis),shortflag!=0?'-':'+',base,coinaddr); + for (i=0; i<32; i++) + printf("%02x",((uint8_t *)&txid)[i]); + printf(" <- txid.v%u ",vout); + for (i=0; i<33; i++) + printf("%02x",pubkey33[i]); + printf(" checkpubkey check %.8f v %.8f dest.(%s)\n",dstr(checktoshis),dstr(value),destaddr); + if ( value >= (9999*checktoshis)/10000 && shortflag == ASSETCHAINS_SHORTFLAG ) + { + komodo_gateway_deposit(value,shortflag,base,fiatoshis,rmd160,txid,vout); + } } -#else - if ( tokomodo != 0 && value <= (10000*checktoshis)/9999 ) + else { - + if ( value <= (10000*checktoshis)/9999 ) + { + + } } -#endif } } else { - for (i=0; i= '0' && c <= '9' )