test
This commit is contained in:
@@ -106,17 +106,36 @@ void komodo_gateway_deposit(char *coinaddr,uint64_t value,char *symbol,uint64_t
|
|||||||
int32_t komodo_rwapproval(int32_t rwflag,uint8_t *opretbuf,struct pax_transaction *pax)
|
int32_t komodo_rwapproval(int32_t rwflag,uint8_t *opretbuf,struct pax_transaction *pax)
|
||||||
{
|
{
|
||||||
int32_t i,len = 0;
|
int32_t i,len = 0;
|
||||||
for (i=0; i<32; i++)
|
if ( rwflag == 1 )
|
||||||
opretbuf[len++] = ((uint8_t *)&pax->txid)[i];
|
{
|
||||||
opretbuf[len++] = pax->vout & 0xff;
|
for (i=0; i<32; i++)
|
||||||
opretbuf[len++] = (pax->vout >> 8) & 0xff;
|
opretbuf[len++] = ((uint8_t *)&pax->txid)[i];
|
||||||
len += iguana_rwnum(1,&opretbuf[len],sizeof(pax->fiatoshis),&pax->komodoshis);
|
opretbuf[len++] = pax->vout & 0xff;
|
||||||
len += iguana_rwnum(1,&opretbuf[len],sizeof(pax->fiatoshis),&pax->fiatoshis);
|
opretbuf[len++] = (pax->vout >> 8) & 0xff;
|
||||||
len += iguana_rwnum(1,&opretbuf[len],sizeof(pax->height),&pax->height);
|
}
|
||||||
len += iguana_rwnum(1,&opretbuf[len],sizeof(pax->otherheight),&pax->otherheight);
|
else
|
||||||
memcpy(&opretbuf[len],pax->rmd160,20), len += 20;
|
{
|
||||||
for (i=0; i<4; i++)
|
for (i=0; i<32; i++)
|
||||||
opretbuf[len++] = pax->source[i];
|
((uint8_t *)&pax->txid)[i] = opretbuf[len++];
|
||||||
|
pax->vout = opretbuf[len++];
|
||||||
|
pax->vout += ((uint32_t)opretbuf[len++] << 8);
|
||||||
|
}
|
||||||
|
len += iguana_rwnum(rwflag,&opretbuf[len],sizeof(pax->fiatoshis),&pax->komodoshis);
|
||||||
|
len += iguana_rwnum(rwflag,&opretbuf[len],sizeof(pax->fiatoshis),&pax->fiatoshis);
|
||||||
|
len += iguana_rwnum(rwflag,&opretbuf[len],sizeof(pax->height),&pax->height);
|
||||||
|
len += iguana_rwnum(rwflag,&opretbuf[len],sizeof(pax->otherheight),&pax->otherheight);
|
||||||
|
if ( rwflag != 0 )
|
||||||
|
{
|
||||||
|
memcpy(&opretbuf[len],pax->rmd160,20), len += 20;
|
||||||
|
for (i=0; i<4; i++)
|
||||||
|
opretbuf[len++] = pax->source[i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memcpy(pax->rmd160,&opretbuf[len],20), len += 20;
|
||||||
|
for (i=0; i<4; i++)
|
||||||
|
pax->source[i] = opretbuf[len++];
|
||||||
|
}
|
||||||
return(len);
|
return(len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user