Cap -ac_perc to be based on million max
This commit is contained in:
@@ -251,20 +251,9 @@ bool MarmaraValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t
|
|||||||
}
|
}
|
||||||
else if ( funcid == 'S' ) // collect -> automatically spend issuers locked funds, given 'I'
|
else if ( funcid == 'S' ) // collect -> automatically spend issuers locked funds, given 'I'
|
||||||
{
|
{
|
||||||
return(true);
|
return(true); // iterate from issuer all remainder after maturity
|
||||||
}
|
|
||||||
else if ( funcid == 'A' ) // agree -> agree that 'I' is unable to be redeemed, remainder
|
|
||||||
{
|
|
||||||
return(true);
|
|
||||||
}
|
|
||||||
else if ( funcid == 'D' ) // dispute -> given 'I' submit for manual arbitration
|
|
||||||
{
|
|
||||||
return(true);
|
|
||||||
}
|
|
||||||
else if ( funcid == 'F' ) // foreclose -> given 'A' collect as much of remainder from credit loop
|
|
||||||
{
|
|
||||||
return(true);
|
|
||||||
}
|
}
|
||||||
|
// staking only for locked utxo
|
||||||
}
|
}
|
||||||
return eval->Invalid("fall through error");
|
return eval->Invalid("fall through error");
|
||||||
}
|
}
|
||||||
@@ -315,6 +304,7 @@ UniValue MarmaraReceive(uint64_t txfee,CPubKey senderpk,int64_t amount,std::stri
|
|||||||
cp = CCinit(&C,EVAL_MARMARA);
|
cp = CCinit(&C,EVAL_MARMARA);
|
||||||
if ( txfee == 0 )
|
if ( txfee == 0 )
|
||||||
txfee = 10000;
|
txfee = 10000;
|
||||||
|
// check for batonownership by senderpk and parameters match createtxid
|
||||||
mypk = pubkey2pk(Mypubkey());
|
mypk = pubkey2pk(Mypubkey());
|
||||||
if ( currency != "MARMARA" )
|
if ( currency != "MARMARA" )
|
||||||
errorstr = (char *)"for now, only MARMARA loops are supported";
|
errorstr = (char *)"for now, only MARMARA loops are supported";
|
||||||
@@ -363,6 +353,7 @@ UniValue MarmaraIssue(uint64_t txfee,uint8_t funcid,CPubKey receiverpk,int64_t a
|
|||||||
cp = CCinit(&C,EVAL_MARMARA);
|
cp = CCinit(&C,EVAL_MARMARA);
|
||||||
if ( txfee == 0 )
|
if ( txfee == 0 )
|
||||||
txfee = 10000;
|
txfee = 10000;
|
||||||
|
// make sure if transfer that it is not too late
|
||||||
mypk = pubkey2pk(Mypubkey());
|
mypk = pubkey2pk(Mypubkey());
|
||||||
if ( currency != "MARMARA" )
|
if ( currency != "MARMARA" )
|
||||||
errorstr = (char *)"for now, only MARMARA loops are supported";
|
errorstr = (char *)"for now, only MARMARA loops are supported";
|
||||||
@@ -376,7 +367,7 @@ UniValue MarmaraIssue(uint64_t txfee,uint8_t funcid,CPubKey receiverpk,int64_t a
|
|||||||
{
|
{
|
||||||
errorstr = (char *)"couldnt finalize CCtx";
|
errorstr = (char *)"couldnt finalize CCtx";
|
||||||
mtx.vout.push_back(MakeCC1vout(EVAL_MARMARA,txfee,receiverpk));
|
mtx.vout.push_back(MakeCC1vout(EVAL_MARMARA,txfee,receiverpk));
|
||||||
rawtx = FinalizeCCTx(0,cp,mtx,mypk,txfee,MarmaraLoopOpret('I',createtxid,receiverpk,amount,matures,currency));
|
rawtx = FinalizeCCTx(0,cp,mtx,mypk,txfee,MarmaraLoopOpret(funcid,createtxid,receiverpk,amount,matures,currency));
|
||||||
if ( rawtx.size() > 0 )
|
if ( rawtx.size() > 0 )
|
||||||
errorstr = 0;
|
errorstr = 0;
|
||||||
} else errorstr = (char *)"dont have enough normal inputs for 2*txfee";
|
} else errorstr = (char *)"dont have enough normal inputs for 2*txfee";
|
||||||
|
|||||||
@@ -1165,10 +1165,12 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height)
|
|||||||
//fprintf(stderr,"(%d %.8f).%d ",i,dstr(pblock->vtx[i].vout[j].nValue),j);
|
//fprintf(stderr,"(%d %.8f).%d ",i,dstr(pblock->vtx[i].vout[j].nValue),j);
|
||||||
if ( i != 0 || j != 1 )
|
if ( i != 0 || j != 1 )
|
||||||
total += pblock->vtx[i].vout[j].nValue;
|
total += pblock->vtx[i].vout[j].nValue;
|
||||||
|
if ( total > 1000000 * COIN )
|
||||||
|
total = 1000000 * COIN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
commission = ((total / 10000) * ASSETCHAINS_COMMISSION) / 10000;
|
//commission = ((total / 10000) * ASSETCHAINS_COMMISSION) / 10000;
|
||||||
//commission = ((total * ASSETCHAINS_COMMISSION) / COIN);
|
commission = ((total * ASSETCHAINS_COMMISSION) / COIN);
|
||||||
}
|
}
|
||||||
if ( commission < 10000 )
|
if ( commission < 10000 )
|
||||||
commission = 0;
|
commission = 0;
|
||||||
|
|||||||
@@ -5601,7 +5601,7 @@ UniValue marmara_transfer(const UniValue& params, bool fHelp)
|
|||||||
UniValue result(UniValue::VOBJ); uint256 createtxid; std::vector<uint8_t> receiverpub; int64_t amount; int32_t matures; std::string currency;
|
UniValue result(UniValue::VOBJ); uint256 createtxid; std::vector<uint8_t> receiverpub; int64_t amount; int32_t matures; std::string currency;
|
||||||
if ( fHelp || params.size() != 5 )
|
if ( fHelp || params.size() != 5 )
|
||||||
{
|
{
|
||||||
// marmaraissue 039433dc3749aece1bd568f374a45da3b0bc6856990d7da3cd175399577940a775 7.5 MARMARA 2693 e5b1ef8ec90e981d3011c8e024cef869b69af2d4dd6837d1ab1d394d3730b7cb
|
// marmaratransfer 039433dc3749aece1bd568f374a45da3b0bc6856990d7da3cd175399577940a775 7.5 MARMARA 2693 e5b1ef8ec90e981d3011c8e024cef869b69af2d4dd6837d1ab1d394d3730b7cb
|
||||||
throw runtime_error("marmaratransfer receiverpk amount currency matures createtxid\n");
|
throw runtime_error("marmaratransfer receiverpk amount currency matures createtxid\n");
|
||||||
}
|
}
|
||||||
if ( ensure_CCrequirements() < 0 )
|
if ( ensure_CCrequirements() < 0 )
|
||||||
|
|||||||
Reference in New Issue
Block a user