fix max money problem, maximum 1 million coins per export, minimum max
money on fungible chains 1 milion.
This commit is contained in:
@@ -1636,6 +1636,8 @@ void komodo_args(char *argv0)
|
|||||||
MAX_MONEY = (ASSETCHAINS_SUPPLY+100) * SATOSHIDEN;
|
MAX_MONEY = (ASSETCHAINS_SUPPLY+100) * SATOSHIDEN;
|
||||||
else MAX_MONEY = (ASSETCHAINS_SUPPLY+100) * SATOSHIDEN + ASSETCHAINS_REWARD * (ASSETCHAINS_ENDSUBSIDY==0 ? 10000000 : ASSETCHAINS_ENDSUBSIDY);
|
else MAX_MONEY = (ASSETCHAINS_SUPPLY+100) * SATOSHIDEN + ASSETCHAINS_REWARD * (ASSETCHAINS_ENDSUBSIDY==0 ? 10000000 : ASSETCHAINS_ENDSUBSIDY);
|
||||||
MAX_MONEY += (MAX_MONEY * ASSETCHAINS_COMMISSION) / SATOSHIDEN;
|
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);
|
//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);
|
ASSETCHAINS_P2PPORT = komodo_port(ASSETCHAINS_SYMBOL,ASSETCHAINS_SUPPLY,&ASSETCHAINS_MAGIC,extraptr,extralen);
|
||||||
while ( (dirname= (char *)GetDataDir(false).string().c_str()) == 0 || dirname[0] == 0 )
|
while ( (dirname= (char *)GetDataDir(false).string().c_str()) == 0 || dirname[0] == 0 )
|
||||||
|
|||||||
@@ -175,6 +175,8 @@ UniValue migrate_converttoexport(const UniValue& params, bool fHelp)
|
|||||||
CAmount burnAmount = AmountFromValue(params[2]);
|
CAmount burnAmount = AmountFromValue(params[2]);
|
||||||
if (burnAmount <= 0)
|
if (burnAmount <= 0)
|
||||||
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for export");
|
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;
|
CAmount needed = 0;
|
||||||
for (int i=0; i<tx.vout.size(); i++) needed += tx.vout[i].nValue;
|
for (int i=0; i<tx.vout.size(); i++) needed += tx.vout[i].nValue;
|
||||||
|
|||||||
Reference in New Issue
Block a user