|
|
@ -105,7 +105,7 @@ void komodo_paxdelete(struct pax_transaction *pax) |
|
|
|
|
|
|
|
void komodo_gateway_deposit(char *coinaddr,uint64_t value,char *symbol,uint64_t fiatoshis,uint8_t *rmd160,uint256 txid,uint16_t vout,uint8_t type,int32_t height,int32_t otherheight,char *source,int32_t approved) // assetchain context
|
|
|
|
{ |
|
|
|
struct pax_transaction *pax; uint8_t buf[35]; int32_t addflag = 0; struct komodo_state *sp; char str[16],dest[16],*s; |
|
|
|
struct pax_transaction *pax; uint8_t buf[35]; int32_t addflag = 0; struct komodo_state *sp; char str[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN],*s; |
|
|
|
//if ( KOMODO_PAX == 0 )
|
|
|
|
// return;
|
|
|
|
//if ( strcmp(symbol,ASSETCHAINS_SYMBOL) != 0 )
|
|
|
@ -197,7 +197,7 @@ int32_t komodo_rwapproval(int32_t rwflag,uint8_t *opretbuf,struct pax_transactio |
|
|
|
|
|
|
|
int32_t komodo_issued_opreturn(char *base,uint256 *txids,uint16_t *vouts,int64_t *values,int64_t *srcvalues,int32_t *kmdheights,int32_t *otherheights,int8_t *baseids,uint8_t *rmd160s,uint8_t *opretbuf,int32_t opretlen,int32_t iskomodo) |
|
|
|
{ |
|
|
|
struct pax_transaction p,*pax; int32_t i,n=0,j,len=0,incr,height,otherheight; uint8_t type,rmd160[20]; uint64_t fiatoshis; char symbol[16]; |
|
|
|
struct pax_transaction p,*pax; int32_t i,n=0,j,len=0,incr,height,otherheight; uint8_t type,rmd160[20]; uint64_t fiatoshis; char symbol[KOMODO_ASSETCHAIN_MAXLEN]; |
|
|
|
//if ( KOMODO_PAX == 0 )
|
|
|
|
// return(0);
|
|
|
|
incr = 34 + (iskomodo * (2*sizeof(fiatoshis) + 2*sizeof(height) + 20 + 4)); |
|
|
@ -290,7 +290,7 @@ int32_t komodo_paxcmp(char *symbol,int32_t kmdheight,uint64_t value,uint64_t che |
|
|
|
|
|
|
|
uint64_t komodo_paxtotal() |
|
|
|
{ |
|
|
|
struct pax_transaction *pax,*pax2,*tmp,*tmp2; char symbol[16],dest[16],*str; int32_t i,ht; int64_t checktoshis; uint64_t seed,total = 0; struct komodo_state *basesp; |
|
|
|
struct pax_transaction *pax,*pax2,*tmp,*tmp2; char symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN],*str; int32_t i,ht; int64_t checktoshis; uint64_t seed,total = 0; struct komodo_state *basesp; |
|
|
|
if ( KOMODO_PASSPORT_INITDONE == 0 ) //KOMODO_PAX == 0 ||
|
|
|
|
return(0); |
|
|
|
if ( komodo_isrealtime(&ht) == 0 ) |
|
|
@ -464,7 +464,7 @@ int32_t komodo_pending_withdraws(char *opretstr) // todo: enforce deterministic |
|
|
|
|
|
|
|
int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t tokomodo) |
|
|
|
{ |
|
|
|
struct pax_transaction *pax,*tmp; char symbol[16],dest[16]; uint8_t *script,opcode,opret[16384],data[16384]; int32_t i,baseid,ht,len=0,opretlen=0,numvouts=1; struct komodo_state *sp; uint64_t available,deposited,issued,withdrawn,approved,redeemed,mask,sum = 0; |
|
|
|
struct pax_transaction *pax,*tmp; char symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; uint8_t *script,opcode,opret[16384],data[16384]; int32_t i,baseid,ht,len=0,opretlen=0,numvouts=1; struct komodo_state *sp; uint64_t available,deposited,issued,withdrawn,approved,redeemed,mask,sum = 0; |
|
|
|
if ( KOMODO_PASSPORT_INITDONE == 0 )//KOMODO_PAX == 0 ||
|
|
|
|
return(0); |
|
|
|
struct komodo_state *kmdsp = komodo_stateptrget((char *)"KMD"); |
|
|
@ -652,7 +652,7 @@ void komodo_passport_iteration(); |
|
|
|
int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above block is valid pax pricing
|
|
|
|
{ |
|
|
|
static uint256 array[64]; static int32_t numbanned,indallvouts; |
|
|
|
int32_t i,j,k,n,ht,baseid,txn_count,activation,num,opretlen,offset=1,errs=0,matched=0,kmdheights[256],otherheights[256]; uint256 hash,txids[256]; char symbol[16],base[16]; uint16_t vouts[256]; int8_t baseids[256]; uint8_t *script,opcode,rmd160s[256*20]; uint64_t total,available,deposited,issued,withdrawn,approved,redeemed,checktoshis,seed; int64_t values[256],srcvalues[256]; struct pax_transaction *pax; struct komodo_state *sp; |
|
|
|
int32_t i,j,k,n,ht,baseid,txn_count,activation,num,opretlen,offset=1,errs=0,matched=0,kmdheights[256],otherheights[256]; uint256 hash,txids[256]; char symbol[KOMODO_ASSETCHAIN_MAXLEN],base[KOMODO_ASSETCHAIN_MAXLEN]; uint16_t vouts[256]; int8_t baseids[256]; uint8_t *script,opcode,rmd160s[256*20]; uint64_t total,available,deposited,issued,withdrawn,approved,redeemed,checktoshis,seed; int64_t values[256],srcvalues[256]; struct pax_transaction *pax; struct komodo_state *sp; |
|
|
|
activation = 235300; |
|
|
|
if ( *(int32_t *)&array[0] == 0 ) |
|
|
|
numbanned = komodo_bannedset(&indallvouts,array,(int32_t)(sizeof(array)/sizeof(*array))); |
|
|
@ -1626,7 +1626,7 @@ void komodo_passport_iteration() |
|
|
|
{ |
|
|
|
static long lastpos[34]; static char userpass[33][1024]; static uint32_t lasttime,callcounter; |
|
|
|
int32_t maxseconds = 10; |
|
|
|
FILE *fp; uint8_t *filedata; long fpos,datalen,lastfpos; int32_t baseid,limit,n,ht,isrealtime,expired,refid,blocks,longest; struct komodo_state *sp,*refsp; char *retstr,fname[512],*base,symbol[16],dest[16]; uint32_t buf[3],starttime; cJSON *infoobj,*result; uint64_t RTmask = 0; |
|
|
|
FILE *fp; uint8_t *filedata; long fpos,datalen,lastfpos; int32_t baseid,limit,n,ht,isrealtime,expired,refid,blocks,longest; struct komodo_state *sp,*refsp; char *retstr,fname[512],*base,symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; uint32_t buf[3],starttime; cJSON *infoobj,*result; uint64_t RTmask = 0; |
|
|
|
expired = 0; |
|
|
|
while ( KOMODO_INITDONE == 0 ) |
|
|
|
{ |
|
|
|