Browse Source

Test

etomic
jl777 8 years ago
parent
commit
2ed5d38cb5
  1. 6
      basilisk/basilisk_swap.c
  2. 16
      iguana/iguana_notary.c

6
basilisk/basilisk_swap.c

@ -2774,6 +2774,8 @@ cJSON *basilisk_swapgettxout(struct supernet_info *myinfo,char *symbol,bits256 t
retjson = cJSON_Parse(retstr);
free(retstr);
}
if ( strcmp("BTC",symbol) == 0 )
printf("%s gettx.(%s)\n",symbol,jprint(retjson,0));
}
else
{
@ -2794,6 +2796,8 @@ cJSON *basilisk_swapgettx(struct supernet_info *myinfo,char *symbol,bits256 txid
retjson = cJSON_Parse(retstr);
free(retstr);
}
if ( strcmp("BTC",symbol) == 0 )
printf("%s gettx.(%s)\n",symbol,jprint(retjson,0));
} else retjson = dpow_gettransaction(myinfo,coin,txid);
return(basilisk_nullretjson(retjson));
}
@ -2861,7 +2865,7 @@ bits256 basilisk_swap_spendtxid(struct supernet_info *myinfo,char *symbol,char *
{
//[{"type":"sent","confirmations":379,"height":275311,"timestamp":1492084664,"txid":"8703c5517bc57db38134058370a14e99b8e662b99ccefa2061dea311bbd02b8b","vout":0,"amount":117.50945263,"spendtxid":"cf2509e076fbb9b22514923df916b7aacb1391dce9c7e1460b74947077b12510","vin":0,"paid":{"type":"paid","txid":"cf2509e076fbb9b22514923df916b7aacb1391dce9c7e1460b74947077b12510","height":275663,"timestamp":1492106024,"vouts":[{"RUDpN6PEBsE7ZFbGjUxk1W3QVsxnjBLYw6":117.50935263}]}}]
basilisk_swap_getcoinaddr(myinfo,symbol,coinaddr,utxotxid,vout);
printf("spendtxid dest.(%s)\n",coinaddr);
printf("spendtxid %s dest.(%s)\n",symbol,coinaddr);
if ( coinaddr[0] != 0 && (retstr= dex_listtransactions(myinfo,0,0,0,symbol,coinaddr,100,0)) != 0 )
{
printf("listtransactions.(%s)\n",retstr);

16
iguana/iguana_notary.c

@ -605,17 +605,29 @@ TWOINTS_AND_ARRAY(dpow,ratify,minsigs,timestamp,ratified)
HASH_AND_STRING(dex,gettransaction,txid,symbol)
{
/*char str[65],url[1024],*retstr;
if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("BTC")) != 0 && myinfo->blocktrail_apikey[0] != 0 )
{
sprintf(url,"https://api.blocktrail.com/v1/btc/transaction/%s?api_key=%s",bits256_str(str,txid),myinfo->blocktrail_apikey);
sprintf(url,"https://api.blocktrail.com/v1/btc/address/%s/unspent-outputs?api_key=%s",address,myinfo->blocktrail_apikey);
}*/
return(_dex_getrawtransaction(myinfo,symbol,txid));
}
HASH_AND_STRING_AND_INT(dex,gettxout,txid,symbol,vout)
{
/*char str[65],url[1024],*retstr;
if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("BTC")) != 0 && myinfo->blocktrail_apikey[0] != 0 )
{
sprintf(url,"https://api.blocktrail.com/v1/btc/transaction/%s?api_key=%s",bits256_str(str,txid),myinfo->blocktrail_apikey);
}*/
return(_dex_gettxout(myinfo,symbol,txid,vout));
}
TWO_STRINGS(dex,listunspent,symbol,address)
{
if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("BTC")) != 0 && coin->FULLNODE == 0 && myinfo->blocktrail_apikey[0] != 0 )
if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("BTC")) != 0 && myinfo->blocktrail_apikey[0] != 0 )
{
char url[1024],*retstr,*coinaddr,*script; int32_t i,n,vout; cJSON *retjson,*data,*item,*item3,*data3; bits256 txid; uint64_t val;
sprintf(url,"https://api.blocktrail.com/v1/btc/address/%s/unspent-outputs?api_key=%s",address,myinfo->blocktrail_apikey);
@ -672,7 +684,7 @@ TWO_STRINGS(dex,listunspent,symbol,address)
TWO_STRINGS_AND_TWO_DOUBLES(dex,listtransactions,symbol,address,count,skip)
{
if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("BTC")) != 0 && coin->FULLNODE == 0 && myinfo->blocktrail_apikey[0] != 0 )
if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("BTC")) != 0 && myinfo->blocktrail_apikey[0] != 0 )
{
char url[1024],*retstr,*retstr2; cJSON *retjson,*retjson2,*retjson3,*data,*data2; int32_t i,n;
sprintf(url,"https://api.blocktrail.com/v1/btc/address/%s/transactions?api_key=%s",address,myinfo->blocktrail_apikey);

Loading…
Cancel
Save