|
@ -22,6 +22,20 @@ uint64_t dpow_utxosize(char *symbol) |
|
|
else return(10000); |
|
|
else return(10000); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t dpow_smallopreturn(char *symbol) |
|
|
|
|
|
{ |
|
|
|
|
|
if ( strcmp(symbol,"GAME") == 0 || strcmp(symbol,"EMC2") == 0 || strcmp(symbol,"HUSH") == 0 ) |
|
|
|
|
|
return(1); |
|
|
|
|
|
else return(0); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t dpow_is015(char *symbol) |
|
|
|
|
|
{ |
|
|
|
|
|
if ( strcmp("CHIPS",symbol) == 0 || strcmp("GAME",symbol) == 0 || strcmp("EMC2",symbol) == 0 ) //strcmp("BTC",symbol) == 0 ||
|
|
|
|
|
|
return(1); |
|
|
|
|
|
else return(0); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
char *bitcoind_getinfo(char *symbol,char *serverport,char *userpass,char *getinfostr) |
|
|
char *bitcoind_getinfo(char *symbol,char *serverport,char *userpass,char *getinfostr) |
|
|
{ |
|
|
{ |
|
|
char buf[1],*retstr; cJSON *retjson; |
|
|
char buf[1],*retstr; cJSON *retjson; |
|
@ -279,16 +293,17 @@ cJSON *dpow_MoMoMdata(struct iguana_info *coin,char *symbol,int32_t kmdheight,ui |
|
|
return(retjson); |
|
|
return(retjson); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t dpow_paxpending(struct supernet_info *myinfo,uint8_t *hex,int32_t hexsize,uint32_t *paxwdcrcp,bits256 MoM,uint32_t MoMdepth,uint16_t CCid,int32_t src_or_dest,struct dpow_block *bp) |
|
|
int32_t dpow_paxpending(struct supernet_info *myinfo,uint8_t *hex,int32_t hexsize,uint32_t *paxwdcrcp,bits256 MoM,uint32_t MoMdepth,uint16_t CCid,int32_t src_or_dest,struct dpow_block *bp) |
|
|
{ |
|
|
{ |
|
|
struct iguana_info *coin,*kmdcoin=0; char *retstr,*hexstr; cJSON *retjson,*infojson; int32_t kmdheight=0,hexlen=0,n=0; uint32_t paxwdcrc; |
|
|
struct iguana_info *coin,*kmdcoin=0; char *retstr,*hexstr; cJSON *retjson,*infojson; int32_t kmdheight=0,hexlen=0,n=0; uint32_t paxwdcrc; |
|
|
paxwdcrc = 0; |
|
|
paxwdcrc = 0; |
|
|
if ( strcmp(bp->srccoin->symbol,"GAME") != 0 || strcmp(bp->srccoin->symbol,"EMC2") != 0 || src_or_dest != 0 ) |
|
|
if ( dpow_smallopreturn(bp->srccoin->symbol) == 0 || src_or_dest != 0 ) |
|
|
{ |
|
|
{ |
|
|
n += iguana_rwbignum(1,&hex[n],sizeof(MoM),MoM.bytes); |
|
|
n += iguana_rwbignum(1,&hex[n],sizeof(MoM),MoM.bytes); |
|
|
MoMdepth = (MoMdepth & 0xffff) | ((uint32_t)CCid<<16); |
|
|
MoMdepth = (MoMdepth & 0xffff) | ((uint32_t)CCid<<16); |
|
|
n += iguana_rwnum(1,&hex[n],sizeof(MoMdepth),(uint32_t *)&MoMdepth); |
|
|
n += iguana_rwnum(1,&hex[n],sizeof(MoMdepth),(uint32_t *)&MoMdepth); |
|
|
if ( strncmp(bp->srccoin->symbol,"TXSCL",5) == 0 && src_or_dest == 0 && strcmp(bp->destcoin->symbol,"KMD") == 0 ) |
|
|
if ( src_or_dest == 0 && strcmp(bp->destcoin->symbol,"KMD") == 0 ) //strncmp(bp->srccoin->symbol,"TXSCL",5) == 0 &&
|
|
|
{ |
|
|
{ |
|
|
kmdcoin = bp->destcoin; |
|
|
kmdcoin = bp->destcoin; |
|
|
if ( (infojson= dpow_getinfo(myinfo,kmdcoin)) != 0 ) |
|
|
if ( (infojson= dpow_getinfo(myinfo,kmdcoin)) != 0 ) |
|
@ -301,7 +316,7 @@ int32_t dpow_paxpending(struct supernet_info *myinfo,uint8_t *hex,int32_t hexsiz |
|
|
if ( (hexstr= jstr(retjson,"data")) != 0 && (hexlen= (int32_t)strlen(hexstr)) > 0 && n+hexlen/2 <= hexsize ) |
|
|
if ( (hexstr= jstr(retjson,"data")) != 0 && (hexlen= (int32_t)strlen(hexstr)) > 0 && n+hexlen/2 <= hexsize ) |
|
|
{ |
|
|
{ |
|
|
hexlen >>= 1; |
|
|
hexlen >>= 1; |
|
|
printf("add MoMoMdata.(%s)\n",hexstr); |
|
|
//printf("add MoMoMdata.(%s)\n",hexstr);
|
|
|
decode_hex(&hex[n],hexlen,hexstr), n += hexlen; |
|
|
decode_hex(&hex[n],hexlen,hexstr), n += hexlen; |
|
|
} |
|
|
} |
|
|
free_json(retjson); |
|
|
free_json(retjson); |
|
@ -430,13 +445,6 @@ cJSON *dpow_getblock(struct supernet_info *myinfo,struct iguana_info *coin,bits2 |
|
|
return(json); |
|
|
return(json); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int32_t dpow_is015(char *symbol) |
|
|
|
|
|
{ |
|
|
|
|
|
if ( strcmp("CHIPS",symbol) == 0 || strcmp("GAME",symbol) == 0 || strcmp("EMC2",symbol) == 0 ) //strcmp("BTC",symbol) == 0 ||
|
|
|
|
|
|
return(1); |
|
|
|
|
|
else return(0); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
char *dpow_validateaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address) |
|
|
char *dpow_validateaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address) |
|
|
{ |
|
|
{ |
|
|
char buf[128],*retstr=0; cJSON *retjson; |
|
|
char buf[128],*retstr=0; cJSON *retjson; |
|
|