jl777 8 years ago
parent
commit
e0d9761b4f
  1. 1
      iguana/coins/btc
  2. 13
      iguana/iguana_chains.c

1
iguana/coins/btc

@ -1 +1,2 @@
curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"bitcoin.conf\",\"path\":\"${HOME#"/"}/.bitcoin\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":8333,\"minconfirms\":1}"

13
iguana/iguana_chains.c

@ -321,7 +321,12 @@ void iguana_chainparms(struct supernet_info *myinfo,struct iguana_chain *chain,c
if ( juint(argjson,"p2p") != 0 )
chain->portp2p = juint(argjson,"p2p");
else chain->portp2p = juint(argjson,"portp2p");
if ( (chain->rpcport= juint(argjson,"rpc")) == 0 && strcmp(chain->symbol,"RELAY") != 0 )
if ( jstr(argjson,"rpchost") != 0 )
safecopy(chain->serverport,jstr(argjson,"rpchost"),sizeof(chain->serverport));
if ( jstr(argjson,"userpass") != 0 )
safecopy(chain->userpass,jstr(argjson,"userpass"),sizeof(chain->userpass));
chain->rpcport = juint(argjson,"rpcport");
if ( chain->rpcport == 0 && (chain->rpcport= juint(argjson,"rpc")) == 0 && strcmp(chain->symbol,"RELAY") != 0 )
{
if ( chain->portp2p != 0 )
chain->rpcport = chain->portp2p-1;
@ -340,6 +345,8 @@ void iguana_chainparms(struct supernet_info *myinfo,struct iguana_chain *chain,c
else if ( strcmp("BTCD",chain->symbol) == 0 )
chain->rpcport = 14632;
}
if ( chain->serverport[0] == 0 && (port= extract_userpass(chain->serverport,chain->userpass,chain->symbol,chain->userhome,path,conf)) != 0 )
chain->rpcport = port;
chain->zcash = juint(argjson,"zcash");
chain->debug = juint(argjson,"debug");
chain->fixit = juint(argjson,"fixit");
@ -359,8 +366,6 @@ void iguana_chainparms(struct supernet_info *myinfo,struct iguana_chain *chain,c
chain->targetspacing = NTARGETSPACING;
if ( (chain->targettimespan= jint(argjson,"targettimespan")) == 0 )
chain->targettimespan = NTARGETSPACING * 60;
if ( (port= extract_userpass(chain->serverport,chain->userpass,chain->symbol,chain->userhome,path,conf)) != 0 )
chain->rpcport = port;
if ( jobj(argjson,"halving") != 0 )
chain->halvingduration = juint(argjson,"halving");
else chain->halvingduration = 210000;
@ -458,7 +463,7 @@ void iguana_chainparms(struct supernet_info *myinfo,struct iguana_chain *chain,c
}
}
sprintf(chain->messagemagic,"%s Signed Message:\n",chain->name);
printf("COIN.%s serverport.(%s) RPCport.%u P2P.%u magic.%08x\n",chain->symbol,chain->serverport,chain->rpcport,chain->portp2p,*(uint32_t *)chain->netmagic);
printf("COIN.%s serverport.(%s) userpass.(%s) RPCport.%u P2P.%u magic.%08x\n",chain->symbol,chain->serverport,chain->userpass,chain->rpcport,chain->portp2p,*(uint32_t *)chain->netmagic);
}
}

Loading…
Cancel
Save