Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
385464c5f3
  1. 2
      iguana/iguana777.c
  2. 1
      iguana/iguana777.h
  3. 3
      iguana/iguana_chains.c
  4. 6
      iguana/main.c

2
iguana/iguana777.c

@ -474,7 +474,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers,
{ {
printf("cant initialize chain.(%s)\n",jstr(json,0)); printf("cant initialize chain.(%s)\n",jstr(json,0));
return(0); return(0);
} } else iguana_chainparms(coin->chain,json);
if ( (peers= jarray(&m,json,"peers")) != 0 ) if ( (peers= jarray(&m,json,"peers")) != 0 )
{ {
for (j=0; j<m; j++) for (j=0; j<m; j++)

1
iguana/iguana777.h

@ -761,6 +761,7 @@ char *bitcoin_json2hex(struct iguana_info *coin,bits256 *txidp,cJSON *txjson);
int32_t bitcoin_addr2rmd160(uint8_t *addrtypep,uint8_t rmd160[20],char *coinaddr); int32_t bitcoin_addr2rmd160(uint8_t *addrtypep,uint8_t rmd160[20],char *coinaddr);
char *issue_startForging(struct supernet_info *myinfo,char *secret); char *issue_startForging(struct supernet_info *myinfo,char *secret);
struct bitcoin_unspent *iguana_unspentsget(struct supernet_info *myinfo,struct iguana_info *coin,char **retstrp,double *balancep,int32_t *numunspentsp,double minconfirms,char *account); struct bitcoin_unspent *iguana_unspentsget(struct supernet_info *myinfo,struct iguana_info *coin,char **retstrp,double *balancep,int32_t *numunspentsp,double minconfirms,char *account);
void iguana_chainparms(struct iguana_chain *chain,cJSON *argjson);
extern queue_t bundlesQ; extern queue_t bundlesQ;

3
iguana/iguana_chains.c

@ -352,6 +352,8 @@ void iguana_chainparms(struct iguana_chain *chain,cJSON *argjson)
chain->do_opreturn = juint(argjson,"do_opreturn"); chain->do_opreturn = juint(argjson,"do_opreturn");
if ( jobj(argjson,"oldtx_format") != 0 ) if ( jobj(argjson,"oldtx_format") != 0 )
chain->hastimestamp = !juint(argjson,"oldtx_format"); chain->hastimestamp = !juint(argjson,"oldtx_format");
if ( jstr(argjson,"userhome") != 0 )
strcpy(chain->userhome,jstr(argjson,"userhome"));
if ( (port= extract_userpass(chain->serverport,chain->userpass,chain->symbol,chain->userhome,path,conf)) != 0 ) if ( (port= extract_userpass(chain->serverport,chain->userpass,chain->symbol,chain->userhome,path,conf)) != 0 )
chain->portrpc = port; chain->portrpc = port;
printf("COIN.%s serverport.(%s) userpass.(%s) port.%u\n",chain->symbol,chain->serverport,chain->userpass,chain->portrpc); printf("COIN.%s serverport.(%s) userpass.(%s) port.%u\n",chain->symbol,chain->serverport,chain->userpass,chain->portrpc);
@ -416,7 +418,6 @@ struct iguana_chain *iguana_createchain(cJSON *json)
if ( (name= jstr(json,"description")) != 0 && strlen(name) < 32 ) if ( (name= jstr(json,"description")) != 0 && strlen(name) < 32 )
strcpy(chain->name,name); strcpy(chain->name,name);
iguana_chaininit(chain,juint(json,"hasheaders")); iguana_chaininit(chain,juint(json,"hasheaders"));
iguana_chainparms(chain,json);
} }
return(chain); return(chain);
} }

6
iguana/main.c

@ -1107,12 +1107,11 @@ void iguana_main(void *arg)
#ifdef __APPLE__ #ifdef __APPLE__
sleep(1); sleep(1);
char *str; char *str;
strcpy(MYINFO.rpcsymbol,"BTC");
//iguana_launchcoin(MYINFO.rpcsymbol,cJSON_Parse("{}")); //iguana_launchcoin(MYINFO.rpcsymbol,cJSON_Parse("{}"));
if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":3,\"newcoin\":\"BTC\",\"active\":0}"),0)) != 0 ) if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":3,\"newcoin\":\"BTC\",\"active\":0}"),0)) != 0 )
{ {
free(str); free(str);
if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":3,\"newcoin\":\"BTCD\",\"active\":0}"),0)) != 0 ) if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":3,\"newcoin\":\"BTCD\",\"active\":0}"),0)) != 0 )
{ {
free(str); free(str);
if ( 0 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"agent\":\"SuperNET\",\"method\":\"login\",\"handle\":\"alice\",\"password\":\"alice\",\"passphrase\":\"alice\"}"),0)) != 0 ) if ( 0 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"agent\":\"SuperNET\",\"method\":\"login\",\"handle\":\"alice\",\"password\":\"alice\",\"passphrase\":\"alice\"}"),0)) != 0 )
@ -1122,6 +1121,7 @@ void iguana_main(void *arg)
free(str); free(str);
} }
} }
strcpy(MYINFO.rpcsymbol,"BTC");
printf("BTC active.%d BTCD active.%d\n",iguana_coinfind("BTC")->active,iguana_coinfind("BTCD")->active); printf("BTC active.%d BTCD active.%d\n",iguana_coinfind("BTC")->active,iguana_coinfind("BTCD")->active);
iguana_coinfind("BTC")->active = iguana_coinfind("BTCD")->active = 0; iguana_coinfind("BTC")->active = iguana_coinfind("BTCD")->active = 0;
} }

Loading…
Cancel
Save