dpowassets and -pax option
This commit is contained in:
@@ -90,6 +90,8 @@ struct pax_transaction *komodo_paxmark(int32_t height,uint256 txid,uint16_t vout
|
||||
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;
|
||||
if ( KOMODO_PAX == 0 )
|
||||
return;
|
||||
sp = komodo_stateptr(str,dest);
|
||||
pthread_mutex_lock(&komodo_mutex);
|
||||
pax_keyset(buf,txid,vout,type);
|
||||
@@ -178,6 +180,8 @@ 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];
|
||||
if ( KOMODO_PAX == 0 )
|
||||
return(0);
|
||||
incr = 34 + (iskomodo * (2*sizeof(fiatoshis) + 2*sizeof(height) + 20 + 4));
|
||||
for (i=0; i<4; i++)
|
||||
base[i] = opretbuf[opretlen-4+i];
|
||||
@@ -265,6 +269,8 @@ 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;
|
||||
if ( KOMODO_PAX == 0 )
|
||||
return(0);
|
||||
if ( komodo_isrealtime(&ht) == 0 )
|
||||
return(0);
|
||||
else
|
||||
@@ -383,6 +389,8 @@ static int _paxorder(const void *a,const void *b)
|
||||
int32_t komodo_pending_withdraws(char *opretstr) // todo: enforce deterministic order
|
||||
{
|
||||
struct pax_transaction *pax,*tmp,*paxes[64]; uint8_t opretbuf[16384]; int32_t i,n,ht,len=0; uint64_t total = 0;
|
||||
if ( KOMODO_PAX == 0 )
|
||||
return(0);
|
||||
if ( komodo_isrealtime(&ht) == 0 || ASSETCHAINS_SYMBOL[0] != 0 )
|
||||
return(0);
|
||||
n = 0;
|
||||
@@ -419,6 +427,8 @@ 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;
|
||||
if ( KOMODO_PAX == 0 )
|
||||
return(0);
|
||||
sp = komodo_stateptr(symbol,dest);
|
||||
strcpy(symbol,base);
|
||||
if ( ASSETCHAINS_SYMBOL[0] != 0 && komodo_baseid(ASSETCHAINS_SYMBOL) < 0 )
|
||||
@@ -506,6 +516,8 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to
|
||||
int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above block is valid pax pricing
|
||||
{
|
||||
int32_t i,j,n,num,opretlen,offset=1,errs=0,matched=0,kmdheights[64],otherheights[64]; uint256 hash,txids[64]; char symbol[16],base[16]; uint16_t vouts[64]; int8_t baseids[64]; uint8_t *script,opcode,rmd160s[64*20]; uint64_t available,deposited,issued,withdrawn,approved,redeemed; int64_t values[64],srcvalues[64]; struct pax_transaction *pax;
|
||||
if ( KOMODO_PAX == 0 )
|
||||
return(0);
|
||||
memset(baseids,0xff,sizeof(baseids));
|
||||
memset(values,0,sizeof(values));
|
||||
memset(srcvalues,0,sizeof(srcvalues));
|
||||
@@ -597,6 +609,8 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
|
||||
{
|
||||
uint8_t rmd160[20],rmd160s[64*20],addrtype,shortflag,pubkey33[33]; int32_t didstats,i,j,n,len,tokomodo,kmdheight,otherheights[64],kmdheights[64]; int8_t baseids[64]; char base[4],coinaddr[64],destaddr[64]; uint256 txids[64]; uint16_t vouts[64]; uint64_t convtoshis,seed; int64_t fiatoshis,komodoshis,checktoshis,values[64],srcvalues[64]; struct pax_transaction *pax,*pax2; struct komodo_state *basesp; double diff;
|
||||
const char *typestr = "unknown";
|
||||
if ( KOMODO_PAX == 0 )
|
||||
return("nopax");
|
||||
if ( ASSETCHAINS_SYMBOL[0] != 0 && komodo_baseid(ASSETCHAINS_SYMBOL) < 0 )
|
||||
{
|
||||
//printf("komodo_opreturn skip %s\n",ASSETCHAINS_SYMBOL);
|
||||
@@ -886,6 +900,11 @@ void komodo_passport_iteration()
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ( KOMODO_PAX == 0 )
|
||||
{
|
||||
KOMODO_PASSPORT_INITDONE = 1;
|
||||
return;
|
||||
}
|
||||
//printf("PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,refid);
|
||||
for (baseid=32; baseid>=0; baseid--)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user