Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
081a8d411c
  1. 4
      iguana/exchanges/nxtae.c
  2. 2
      iguana/iguana777.h
  3. 20
      iguana/main.c

4
iguana/exchanges/nxtae.c

@ -83,11 +83,11 @@ char *_get_MSoffers(struct supernet_info *myinfo,char *str)
return(issue_NXTPOST(cmd));
}
char *issue_startForging(char *url,char *secret)
char *issue_startForging(struct supernet_info *myinfo,char *secret)
{
char cmd[4096];
sprintf(cmd,"requestType=startForging&secretPhrase=%s",secret);
return(bitcoind_RPC(0,"curl",url,0,0,cmd));
return(issue_NXTPOST(cmd));
}
uint32_t get_blockutime(struct supernet_info *myinfo,uint32_t blocknum)

2
iguana/iguana777.h

@ -755,7 +755,7 @@ cJSON *bitcoin_addinput(struct iguana_info *coin,cJSON *txobj,bits256 txid,int32
int32_t bitcoin_verifytx(struct iguana_info *coin,bits256 *signedtxidp,char **signedtx,char *rawtxstr,struct vin_info *V);
char *bitcoin_json2hex(struct iguana_info *coin,bits256 *txidp,cJSON *txjson);
int32_t bitcoin_addr2rmd160(uint8_t *addrtypep,uint8_t rmd160[20],char *coinaddr);
char *issue_startForging(char *url,char *secret);
char *issue_startForging(struct supernet_info *myinfo,char *secret);
extern queue_t bundlesQ;

20
iguana/main.c

@ -1032,16 +1032,34 @@ void iguana_main(void *arg)
{
int32_t usessl = 0, ismainnet = 1;
struct supernet_info *myinfo; char *tmpstr,*helperargs,*coinargs,helperstr[512]; int32_t i;
issue_startForging("http://127.0.0.1:7876","secret");
mycalloc(0,0,0);
myinfo = SuperNET_MYINFO(0);
FILE *fp; int32_t iter;
strcpy(myinfo->NXTAPIURL,"http://127.0.0.1:7876");
for (iter=0; iter<2; iter++)
{
if ( (fp= fopen(iter == 0 ? "nxtpasswords" : "fimpasswords","rb")) != 0 )
{
char line[4096],NXTaddr[64]; int32_t j; uint8_t pubkey[32];
while ( fgets(line,sizeof(line),fp) > 0 )
{
j = (int32_t)strlen(line) - 1;
line[j] = 0;
calc_NXTaddr(NXTaddr,pubkey,(uint8_t *)line,j);
printf("FORGING %s (%s)\n",NXTaddr,issue_startForging(myinfo,line));
}
fclose(fp);
}
strcpy(myinfo->NXTAPIURL,"http://127.0.0.1:7886");
}
if ( usessl == 0 )
strcpy(myinfo->NXTAPIURL,"http://127.0.0.1:");
else strcpy(myinfo->NXTAPIURL,"https://127.0.0.1:");
if ( ismainnet != 0 )
strcat(myinfo->NXTAPIURL,"7876/nxt");
else strcat(myinfo->NXTAPIURL,"6876/nxt");
#ifndef _WIN32
signal(SIGINT,sigint_func);
signal(SIGILL,sigillegal_func);

Loading…
Cancel
Save