Browse Source

test

pull/4/head
jl777 8 years ago
parent
commit
b6a7cb2ce0
  1. 2
      src/komodo_globals.h
  2. 4
      src/komodo_notary.h
  3. 7
      src/komodo_utils.h
  4. 6
      src/miner.cpp

2
src/komodo_globals.h

@ -22,7 +22,7 @@ void komodo_assetchain_pubkeys(char *jsonstr);
int COINBASE_MATURITY = 100; int COINBASE_MATURITY = 100;
int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,CURRENT_HEIGHT; int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,CURRENT_HEIGHT,ASSETCHAINS_SEED;
std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES; std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES;
uint8_t NOTARY_PUBKEY33[33]; uint8_t NOTARY_PUBKEY33[33];

4
src/komodo_notary.h

@ -271,6 +271,6 @@ void komodo_assetchain_pubkeys(char *jsonstr)
} else fprintf(stderr,"komodo_assetchain_pubkeys i.%d vs n.%d\n",i,n); } else fprintf(stderr,"komodo_assetchain_pubkeys i.%d vs n.%d\n",i,n);
} else fprintf(stderr,"assetchain pubkeys n.%d\n",n); } else fprintf(stderr,"assetchain pubkeys n.%d\n",n);
} }
else if ( jsonstr != 0 ) //else if ( jsonstr != 0 )
fprintf(stderr,"assetchain pubkeys couldnt parse.(%s)\n",jsonstr); // fprintf(stderr,"assetchain pubkeys couldnt parse.(%s)\n",jsonstr);
} }

7
src/komodo_utils.h

@ -1361,7 +1361,7 @@ char *iguanafmtstr = (char *)"curl --url \"http://127.0.0.1:7778\" --data \"{\\\
void komodo_args() void komodo_args()
{ {
std::string name; char *dirname,fname[512],magicstr[9]; uint8_t magic[4]; FILE *fp; int32_t i,len; std::string name,addn; char *dirname,fname[512],magicstr[9]; uint8_t magic[4]; FILE *fp; int32_t i,len;
IS_KOMODO_NOTARY = GetBoolArg("-notary", false); IS_KOMODO_NOTARY = GetBoolArg("-notary", false);
NOTARY_PUBKEY = GetArg("-pubkey", ""); NOTARY_PUBKEY = GetArg("-pubkey", "");
if ( strlen(NOTARY_PUBKEY.c_str()) == 66 ) if ( strlen(NOTARY_PUBKEY.c_str()) == 66 )
@ -1370,6 +1370,9 @@ void komodo_args()
if ( name.c_str()[0] != 0 ) if ( name.c_str()[0] != 0 )
{ {
ASSETCHAINS_SUPPLY = GetArg("-ac_supply",10); ASSETCHAINS_SUPPLY = GetArg("-ac_supply",10);
addn = GetArg("-addnode","");
if ( strlen(addn.c_str()) > 6 )
ASSETCHAINS_SEED = 1;
strncpy(ASSETCHAINS_SYMBOL,name.c_str(),sizeof(ASSETCHAINS_SYMBOL)-1); strncpy(ASSETCHAINS_SYMBOL,name.c_str(),sizeof(ASSETCHAINS_SYMBOL)-1);
ASSETCHAINS_PORT = komodo_port(ASSETCHAINS_SYMBOL,ASSETCHAINS_SUPPLY,&ASSETCHAINS_MAGIC,&ASSETCHAINS_SHORTFLAG); ASSETCHAINS_PORT = komodo_port(ASSETCHAINS_SYMBOL,ASSETCHAINS_SUPPLY,&ASSETCHAINS_MAGIC,&ASSETCHAINS_SHORTFLAG);
//fprintf(stderr,"after args: %c%s port.%u magic.%08x supply.%u\n",ASSETCHAINS_SHORTFLAG!=0?'-':'+',ASSETCHAINS_SYMBOL,ASSETCHAINS_PORT,ASSETCHAINS_MAGIC,(int32_t)ASSETCHAINS_SUPPLY); //fprintf(stderr,"after args: %c%s port.%u magic.%08x supply.%u\n",ASSETCHAINS_SHORTFLAG!=0?'-':'+',ASSETCHAINS_SYMBOL,ASSETCHAINS_PORT,ASSETCHAINS_MAGIC,(int32_t)ASSETCHAINS_SUPPLY);
@ -1398,7 +1401,7 @@ void komodo_args()
{ {
fprintf(fp,iguanafmtstr,name.c_str(),name.c_str(),magicstr,ASSETCHAINS_PORT,ASSETCHAINS_PORT+1,"78.47.196.146"); fprintf(fp,iguanafmtstr,name.c_str(),name.c_str(),magicstr,ASSETCHAINS_PORT,ASSETCHAINS_PORT+1,"78.47.196.146");
fclose(fp); fclose(fp);
printf("created (%s)\n",fname); //printf("created (%s)\n",fname);
} else printf("error creating (%s)\n",fname); } else printf("error creating (%s)\n",fname);
} }
else else

6
src/miner.cpp

@ -440,7 +440,7 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int&
// Internal miner // Internal miner
// //
#define ROUNDROBIN_DELAY 44 #define ROUNDROBIN_DELAY 44
extern int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAIN_INIT,KOMODO_INITDONE; extern int32_t ASSETCHAINS_SEED,IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAIN_INIT,KOMODO_INITDONE;
extern std::string NOTARY_PUBKEY; extern std::string NOTARY_PUBKEY;
extern uint8_t NOTARY_PUBKEY33[33]; extern uint8_t NOTARY_PUBKEY33[33];
uint32_t Mining_start,Mining_height; uint32_t Mining_start,Mining_height;
@ -546,8 +546,10 @@ void static BitcoinMiner(CWallet *pwallet)
//fprintf(stderr,"try %s Mining with %s\n",ASSETCHAINS_SYMBOL,solver.c_str()); //fprintf(stderr,"try %s Mining with %s\n",ASSETCHAINS_SYMBOL,solver.c_str());
while (true) while (true)
{ {
if (chainActive.Tip()->nHeight >= 100 && chainparams.MiningRequiresPeers()) if (chainparams.MiningRequiresPeers())
{ {
if ( ASSETCHAINS_SEED != 0 && chainActive.Tip()->nHeight < 100 )
break;
// Busy-wait for the network to come online so we don't waste time mining // Busy-wait for the network to come online so we don't waste time mining
// on an obsolete chain. In regtest mode we expect to fly solo. // on an obsolete chain. In regtest mode we expect to fly solo.
//fprintf(stderr,"Wait for peers...\n"); //fprintf(stderr,"Wait for peers...\n");

Loading…
Cancel
Save