Browse Source

fix max money problem, maximum 1 million coins per export, minimum max

money on fungible chains 1 milion.
jl777
blackjok3r 6 years ago
parent
commit
d10c7b8358
  1. 2
      src/komodo_utils.h
  2. 2
      src/rpccrosschain.cpp

2
src/komodo_utils.h

@ -1636,6 +1636,8 @@ void komodo_args(char *argv0)
MAX_MONEY = (ASSETCHAINS_SUPPLY+100) * SATOSHIDEN;
else MAX_MONEY = (ASSETCHAINS_SUPPLY+100) * SATOSHIDEN + ASSETCHAINS_REWARD * (ASSETCHAINS_ENDSUBSIDY==0 ? 10000000 : ASSETCHAINS_ENDSUBSIDY);
MAX_MONEY += (MAX_MONEY * ASSETCHAINS_COMMISSION) / SATOSHIDEN;
if ( ASSETCHAINS_CC >= KOMODO_FIRSTFUNGIBLEID && MAX_MONEY < 1000000LL*SATOSHIDEN )
MAX_MONEY = 1000000LL*COIN;
//printf("baseid.%d MAX_MONEY.%s %.8f\n",baseid,ASSETCHAINS_SYMBOL,(double)MAX_MONEY/SATOSHIDEN);
ASSETCHAINS_P2PPORT = komodo_port(ASSETCHAINS_SYMBOL,ASSETCHAINS_SUPPLY,&ASSETCHAINS_MAGIC,extraptr,extralen);
while ( (dirname= (char *)GetDataDir(false).string().c_str()) == 0 || dirname[0] == 0 )

2
src/rpccrosschain.cpp

@ -175,6 +175,8 @@ UniValue migrate_converttoexport(const UniValue& params, bool fHelp)
CAmount burnAmount = AmountFromValue(params[2]);
if (burnAmount <= 0)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for export");
if (burnAmount > 1000000LL*COIN)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for export, cannot export more than 1 million coins per export.");
{
CAmount needed = 0;
for (int i=0; i<tx.vout.size(); i++) needed += tx.vout[i].nValue;

Loading…
Cancel
Save