Browse Source

StartShutdown(); instead of exit()

z_createrawtransaction
jl777 5 years ago
parent
commit
aec1884070
  1. 2
      src/cc/dice.cpp
  2. 2
      src/cryptoconditions/src/secp256k1.c
  3. 4
      src/komodo_bitcoind.h
  4. 2
      src/komodo_gateway.h
  5. 27
      src/komodo_utils.h

2
src/cc/dice.cpp

@ -1662,7 +1662,7 @@ void *dealer0_loop(void *_arg)
if ( (cp= Diceinit(fundingPubKey,dealer0_fundingtxid,&C,planstr,txfee,mypk,dicepk,refsbits,minbet,maxbet,maxodds,timeoutblocks)) == 0 )
{
fprintf(stderr,"error initializing dealer0_loop\n");
exit(-1);
StartShutdown();
}
fprintf(stderr,"dealer0 node running\n");
height = lastht = 0;

2
src/cryptoconditions/src/secp256k1.c

@ -68,7 +68,7 @@ void lockSign() {
}
if (!secp256k1_context_randomize(ec_ctx_sign, ent)) {
fprintf(stderr, "Could not randomize secp256k1 context\n");
exit(1);
StartShutdown();
}
}

4
src/komodo_bitcoind.h

@ -57,7 +57,7 @@ void init_string(struct return_string *s)
if ( s->ptr == NULL )
{
fprintf(stderr,"init_string malloc() failed\n");
exit(-1);
StartShutdown();
}
s->ptr[0] = '\0';
}
@ -94,7 +94,7 @@ size_t accumulatebytes(void *ptr,size_t size,size_t nmemb,struct return_string *
if ( s->ptr == NULL )
{
fprintf(stderr, "accumulate realloc() failed\n");
exit(-1);
StartShutdown();
}
memcpy(s->ptr+s->len,ptr,size*nmemb);
s->ptr[new_len] = '\0';

2
src/komodo_gateway.h

@ -653,7 +653,7 @@ int32_t komodo_bannedset(int32_t *indallvoutsp,uint256 *array,int32_t max)
if ( sizeof(banned_txids)/sizeof(*banned_txids) > max )
{
fprintf(stderr,"komodo_bannedset: buffer too small %ld vs %d\n",sizeof(banned_txids)/sizeof(*banned_txids),max);
exit(-1);
StartShutdown();
}
for (i=0; i<sizeof(banned_txids)/sizeof(*banned_txids); i++)
array[i] = uint256S(banned_txids[i]);

27
src/komodo_utils.h

@ -1675,7 +1675,7 @@ void komodo_args(char *argv0)
IS_STAKED_NOTARY = GetArg("-stakednotary", -1);
if ( IS_STAKED_NOTARY != -1 && IS_KOMODO_NOTARY == true ) {
fprintf(stderr, "Cannot be STAKED and KMD notary at the same time!\n");
exit(0);
StartShutdown();
}
memset(ccenables,0,sizeof(ccenables));
memset(disablebits,0,sizeof(disablebits));
@ -1800,7 +1800,7 @@ void komodo_args(char *argv0)
if ( ASSETCHAINS_SUPPLY > (uint64_t)90*1000*1000000 )
{
fprintf(stderr,"-ac_supply must be less than 90 billion\n");
exit(0);
StartShutdown();
}
fprintf(stderr,"ASSETCHAINS_SUPPLY %llu\n",(long long)ASSETCHAINS_SUPPLY);
@ -1839,7 +1839,7 @@ void komodo_args(char *argv0)
if ( ASSETCHAINS_COMMISSION != 0 && ASSETCHAINS_FOUNDERS_REWARD != 0 )
{
fprintf(stderr,"cannot use founders reward and commission on the same chain.\n");
exit(0);
StartShutdown();
}
if ( ASSETCHAINS_CC != 0 )
{
@ -1879,7 +1879,7 @@ void komodo_args(char *argv0)
if ( ASSETCHAINS_BEAMPORT != 0 && ASSETCHAINS_CODAPORT != 0 )
{
fprintf(stderr,"can only have one of -ac_beam or -ac_coda\n");
exit(0);
StartShutdown();
}
ASSETCHAINS_SELFIMPORT = GetArg("-ac_import",""); // BEAM, CODA, PUBKEY, GATEWAY
if ( ASSETCHAINS_SELFIMPORT == "PUBKEY" )
@ -1887,18 +1887,18 @@ void komodo_args(char *argv0)
if ( strlen(ASSETCHAINS_OVERRIDE_PUBKEY.c_str()) != 66 )
{
fprintf(stderr,"invalid -ac_pubkey for -ac_import=PUBKEY\n");
exit(0);
StartShutdown();
}
}
else if ( ASSETCHAINS_SELFIMPORT == "BEAM" && ASSETCHAINS_BEAMPORT == 0 )
{
fprintf(stderr,"missing -ac_beam for BEAM rpcport\n");
exit(0);
StartShutdown();
}
else if ( ASSETCHAINS_SELFIMPORT == "CODA" && ASSETCHAINS_CODAPORT == 0 )
{
fprintf(stderr,"missing -ac_coda for CODA rpcport\n");
exit(0);
StartShutdown();
}
// else it can be gateway coin
@ -1926,12 +1926,12 @@ void komodo_args(char *argv0)
if ( ASSETCHAINS_SUPPLY > 10000000000 )
{
printf("ac_pubkey or ac_script wont work with ac_supply over 10 billion\n");
exit(0);
StartShutdown();
}
if ( ASSETCHAINS_NOTARY_PAY[0] != 0 )
{
printf("Assetchains NOTARY PAY cannot be used with ac_pubkey or ac_script.\n");
exit(0);
StartShutdown();
}
if ( strlen(ASSETCHAINS_OVERRIDE_PUBKEY.c_str()) == 66 )
{
@ -1972,7 +1972,7 @@ void komodo_args(char *argv0)
if ( ASSETCHAINS_SCRIPTPUB.size() > 1 && ASSETCHAINS_MARMARA != 0 )
{
fprintf(stderr,"-ac_script and -ac_marmara are mutually exclusive\n");
exit(0);
StartShutdown();
}
if ( ASSETCHAINS_ENDSUBSIDY[0] != 0 || ASSETCHAINS_REWARD[0] != 0 || ASSETCHAINS_HALVING[0] != 0 || ASSETCHAINS_DECAY[0] != 0 || ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_PUBLIC != 0 || ASSETCHAINS_PRIVATE != 0 || ASSETCHAINS_TXPOW != 0 || ASSETCHAINS_FOUNDERS != 0 || ASSETCHAINS_SCRIPTPUB.size() > 1 || ASSETCHAINS_SELFIMPORT.size() > 0 || ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 || ASSETCHAINS_TIMELOCKGTE != _ASSETCHAINS_TIMELOCKOFF|| ASSETCHAINS_ALGO != ASSETCHAINS_EQUIHASH || ASSETCHAINS_LWMAPOS != 0 || ASSETCHAINS_LASTERA > 0 || ASSETCHAINS_BEAMPORT != 0 || ASSETCHAINS_CODAPORT != 0 || ASSETCHAINS_MARMARA != 0 || nonz > 0 || ASSETCHAINS_CCLIB.size() > 0 || ASSETCHAINS_FOUNDERS_REWARD != 0 || ASSETCHAINS_NOTARY_PAY[0] != 0 || ASSETCHAINS_BLOCKTIME != 60 || ASSETCHAINS_CBOPRET != 0 || Mineropret.size() != 0 )
{
@ -2150,7 +2150,7 @@ void komodo_args(char *argv0)
if ( strcmp(ASSETCHAINS_SYMBOL,"KMD") == 0 )
{
fprintf(stderr,"cant have assetchain named KMD\n");
exit(0);
StartShutdown();
}
if ( (port= komodo_userpass(ASSETCHAINS_USERPASS,ASSETCHAINS_SYMBOL)) != 0 )
ASSETCHAINS_RPCPORT = port;
@ -2232,6 +2232,11 @@ void komodo_args(char *argv0)
}
else if ( strcmp("VRSC",ASSETCHAINS_SYMBOL) == 0 )
dpowconfs = 0;
else if ( ASSETCHAINS_PRIVATE != 0 )
{
fprintf(stderr,"-ac_private for a non-PIRATE chain is not supported. The only reason to have an -ac_private chain is for total privacy and that is best achieved with the largest anon set. PIRATE has that and it is recommended to just use PIRATE\n");
StartShutdown();
}
} else BITCOIND_RPCPORT = GetArg("-rpcport", BaseParams().RPCPort());
KOMODO_DPOWCONFS = GetArg("-dpowconfs",dpowconfs);
if ( ASSETCHAINS_SYMBOL[0] == 0 || strcmp(ASSETCHAINS_SYMBOL,"SUPERNET") == 0 || strcmp(ASSETCHAINS_SYMBOL,"DEX") == 0 || strcmp(ASSETCHAINS_SYMBOL,"COQUI") == 0 || strcmp(ASSETCHAINS_SYMBOL,"PIRATE") == 0 || strcmp(ASSETCHAINS_SYMBOL,"KMDICE") == 0 )

Loading…
Cancel
Save