Merge pull request #135 from jl777/dev

Dev
This commit is contained in:
jl777
2017-01-30 08:09:31 +02:00
committed by GitHub
4 changed files with 9 additions and 4 deletions

View File

@@ -15,6 +15,7 @@
using namespace std; using namespace std;
using namespace json_spirit; using namespace json_spirit;
int64_t MAX_MONEY = 200000000 * 100000000LL; int64_t MAX_MONEY = 200000000 * 100000000LL;
uint64_t komodo_maxallowed(int32_t baseid) { return(100000000LL * 1000000); } // stub
std::string HelpMessageCli() std::string HelpMessageCli()
{ {

View File

@@ -767,8 +767,8 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
} }
} }
} }
else if ( kmdheight > 91800 && strcmp(base,ASSETCHAINS_SYMBOL) == 0 ) else if ( seed != 0 && kmdheight > 91800 && strcmp(base,ASSETCHAINS_SYMBOL) == 0 )
printf("pax %s deposit %.8f rejected kmdheight.%d %.8f KMD\n",base,dstr(fiatoshis),kmdheight,dstr(value)); printf("pax %s deposit %.8f rejected kmdheight.%d %.8f KMD check %.8f seed.%llu\n",base,dstr(fiatoshis),kmdheight,dstr(value),dstr(checktoshis),(long long)seed);
} }
} }
} }

View File

@@ -23,6 +23,7 @@ int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33)
int32_t komodo_isrealtime(int32_t *kmdheightp); int32_t komodo_isrealtime(int32_t *kmdheightp);
uint64_t komodo_paxtotal(); uint64_t komodo_paxtotal();
int32_t komodo_longestchain(); int32_t komodo_longestchain();
uint64_t komodo_maxallowed(int32_t baseid);
pthread_mutex_t komodo_mutex; pthread_mutex_t komodo_mutex;

View File

@@ -1452,7 +1452,7 @@ int32_t komodo_whoami(char *pubkeystr,int32_t height)
void komodo_args() void komodo_args()
{ {
extern int64_t MAX_MONEY; extern int64_t MAX_MONEY;
std::string name,addn; 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,baseid,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 )
@@ -1466,11 +1466,14 @@ 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);
MAX_MONEY = (ASSETCHAINS_SUPPLY+1) * SATOSHIDEN;
addn = GetArg("-seednode",""); addn = GetArg("-seednode","");
if ( strlen(addn.c_str()) > 0 ) if ( strlen(addn.c_str()) > 0 )
ASSETCHAINS_SEED = 1; ASSETCHAINS_SEED = 1;
strncpy(ASSETCHAINS_SYMBOL,name.c_str(),sizeof(ASSETCHAINS_SYMBOL)-1); strncpy(ASSETCHAINS_SYMBOL,name.c_str(),sizeof(ASSETCHAINS_SYMBOL)-1);
if ( (baseid= komodo_baseid(ASSETCHAINS_SYMBOL)) >= 0 && baseid < 32 )
MAX_MONEY = komodo_maxallowed(baseid);
else MAX_MONEY = (ASSETCHAINS_SUPPLY+1) * SATOSHIDEN;
//printf("baseid.%d MAX_MONEY.%s %.8f\n",baseid,ASSETCHAINS_SYMBOL,(double)MAX_MONEY/SATOSHIDEN);
ASSETCHAINS_PORT = komodo_port(ASSETCHAINS_SYMBOL,ASSETCHAINS_SUPPLY,&ASSETCHAINS_MAGIC); ASSETCHAINS_PORT = komodo_port(ASSETCHAINS_SYMBOL,ASSETCHAINS_SUPPLY,&ASSETCHAINS_MAGIC);
while ( (dirname= (char *)GetDataDir(false).string().c_str()) == 0 || dirname[0] == 0 ) while ( (dirname= (char *)GetDataDir(false).string().c_str()) == 0 || dirname[0] == 0 )
{ {