@@ -492,7 +492,9 @@ int64_t AddCClibInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CPubK
|
|||||||
std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> > unspentOutputs;
|
std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> > unspentOutputs;
|
||||||
GetCCaddress(cp,coinaddr,pk);
|
GetCCaddress(cp,coinaddr,pk);
|
||||||
SetCCunspents(unspentOutputs,coinaddr);
|
SetCCunspents(unspentOutputs,coinaddr);
|
||||||
threshold = total/(maxinputs+1);
|
if ( maxinputs != 0 )
|
||||||
|
threshold = total/maxinputs;
|
||||||
|
else threshold = total;
|
||||||
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
|
for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
|
||||||
{
|
{
|
||||||
txid = it->first.txhash;
|
txid = it->first.txhash;
|
||||||
|
|||||||
@@ -1192,7 +1192,7 @@ UniValue rogue_finishgame(uint64_t txfee,struct CCcontract_info *cp,cJSON *param
|
|||||||
// vout0 -> 1% ingame gold
|
// vout0 -> 1% ingame gold
|
||||||
// get any playerdata, get all keystrokes, replay game and compare final state
|
// get any playerdata, get all keystrokes, replay game and compare final state
|
||||||
CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight());
|
CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight());
|
||||||
UniValue result(UniValue::VOBJ); std::string rawtx,symbol,pname; CTransaction gametx; uint64_t seed,mult; int64_t buyin,batonvalue,inputsum,cashout,CCchange=0; int32_t i,err,gameheight,tmp,numplayers,regslot,n,num,dungeonlevel,numkeys,maxplayers,batonht,batonvout; char myrogueaddr[64],*keystrokes = 0; std::vector<uint8_t> playerdata,newdata,nodata; uint256 batontxid,playertxid,gametxid; CPubKey mypk,roguepk; uint8_t player[10000],mypriv[32],funcid;
|
UniValue result(UniValue::VOBJ); std::string rawtx,symbol,pname; CTransaction gametx; uint64_t seed,mult; int64_t buyin,batonvalue,inputsum,cashout=0,CCchange=0; int32_t i,err,gameheight,tmp,numplayers,regslot,n,num,dungeonlevel,numkeys,maxplayers,batonht,batonvout; char myrogueaddr[64],*keystrokes = 0; std::vector<uint8_t> playerdata,newdata,nodata; uint256 batontxid,playertxid,gametxid; CPubKey mypk,roguepk; uint8_t player[10000],mypriv[32],funcid;
|
||||||
struct CCcontract_info *cpTokens, tokensC;
|
struct CCcontract_info *cpTokens, tokensC;
|
||||||
|
|
||||||
if ( txfee == 0 )
|
if ( txfee == 0 )
|
||||||
@@ -1279,15 +1279,17 @@ UniValue rogue_finishgame(uint64_t txfee,struct CCcontract_info *cp,cJSON *param
|
|||||||
}
|
}
|
||||||
cashout += numplayers * buyin;
|
cashout += numplayers * buyin;
|
||||||
}
|
}
|
||||||
if ( cashout >= txfee )
|
if ( cashout > 0 )
|
||||||
{
|
{
|
||||||
if ( (inputsum= AddCClibInputs(cp,mtx,roguepk,cashout,16,cp->unspendableCCaddr)) > (uint64_t)P.gold*mult )
|
if ( (inputsum= AddCClibInputs(cp,mtx,roguepk,cashout,60,cp->unspendableCCaddr)) > cashout )
|
||||||
CCchange = (inputsum - cashout);
|
CCchange = (inputsum - cashout);
|
||||||
mtx.vout.push_back(CTxOut(cashout,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG));
|
else fprintf(stderr,"couldnt find enough utxos\n");
|
||||||
}
|
}
|
||||||
|
mtx.vout.push_back(CTxOut(cashout,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mtx.vout.push_back(MakeCC1vout(cp->evalcode,CCchange + (batonvalue-3*txfee),roguepk));
|
if ( CCchange + (batonvalue-3*txfee) >= txfee )
|
||||||
|
mtx.vout.push_back(MakeCC1vout(cp->evalcode,CCchange + (batonvalue-3*txfee),roguepk));
|
||||||
Myprivkey(mypriv);
|
Myprivkey(mypriv);
|
||||||
CCaddr1of2set(cp,roguepk,mypk,mypriv,myrogueaddr);
|
CCaddr1of2set(cp,roguepk,mypk,mypriv,myrogueaddr);
|
||||||
CScript opret;
|
CScript opret;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "clientversion.h"
|
#include "clientversion.h"
|
||||||
|
|
||||||
#include "tinyformat.h"
|
#include "tinyformat.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
* for both bitcoind and bitcoin-core, to make it harder for attackers to
|
* for both bitcoind and bitcoin-core, to make it harder for attackers to
|
||||||
* target servers or GUI users specifically.
|
* target servers or GUI users specifically.
|
||||||
*/
|
*/
|
||||||
const std::string CLIENT_NAME("MagicBean");
|
const std::string CLIENT_NAME = GetArg("-ac_clientname", "MagicBean");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Client version number
|
* Client version number
|
||||||
|
|||||||
@@ -571,6 +571,7 @@ std::string HelpMessage(HelpMessageMode mode)
|
|||||||
strUsage += HelpMessageOpt("-ac_cclib", _("Cryptoconditions dynamicly loadable library"));
|
strUsage += HelpMessageOpt("-ac_cclib", _("Cryptoconditions dynamicly loadable library"));
|
||||||
strUsage += HelpMessageOpt("-ac_ccenable", _("Cryptoconditions to enable"));
|
strUsage += HelpMessageOpt("-ac_ccenable", _("Cryptoconditions to enable"));
|
||||||
strUsage += HelpMessageOpt("-ac_ccactivate", _("Block height to enable Cryptoconditions"));
|
strUsage += HelpMessageOpt("-ac_ccactivate", _("Block height to enable Cryptoconditions"));
|
||||||
|
strUsage += HelpMessageOpt("-ac_clientname", _("Full node client name, default 'MagicBean'"));
|
||||||
strUsage += HelpMessageOpt("-ac_decay", _("Percentage of block reward decrease at each halving"));
|
strUsage += HelpMessageOpt("-ac_decay", _("Percentage of block reward decrease at each halving"));
|
||||||
strUsage += HelpMessageOpt("-ac_end", _("Block height at which block rewards will end"));
|
strUsage += HelpMessageOpt("-ac_end", _("Block height at which block rewards will end"));
|
||||||
strUsage += HelpMessageOpt("-ac_eras", _("Block reward eras"));
|
strUsage += HelpMessageOpt("-ac_eras", _("Block reward eras"));
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include "komodo_defs.h"
|
#include "komodo_defs.h"
|
||||||
|
extern int32_t ASSETCHAINS_FOUNDERS;
|
||||||
|
|
||||||
arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t height,int32_t goalperc);
|
arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t height,int32_t goalperc);
|
||||||
|
|
||||||
@@ -785,10 +786,10 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
if (tx.IsCoinBase() && coinbasetxn == true ) {
|
if (tx.IsCoinBase() && coinbasetxn == true ) {
|
||||||
// Show founders' reward if it is required
|
// Show founders' reward if it is required
|
||||||
//if (pblock->vtx[0].vout.size() > 1) {
|
if (ASSETCHAINS_FOUNDERS && pblock->vtx[0].vout.size() > 1) {
|
||||||
// Correct this if GetBlockTemplate changes the order
|
// Correct this if GetBlockTemplate changes the order
|
||||||
// entry.push_back(Pair("foundersreward", (int64_t)tx.vout[1].nValue));
|
entry.push_back(Pair("foundersreward", (int64_t)tx.vout[1].nValue));
|
||||||
//}
|
}
|
||||||
CAmount nReward = GetBlockSubsidy(chainActive.LastTip()->GetHeight()+1, Params().GetConsensus());
|
CAmount nReward = GetBlockSubsidy(chainActive.LastTip()->GetHeight()+1, Params().GetConsensus());
|
||||||
entry.push_back(Pair("coinbasevalue", nReward));
|
entry.push_back(Pair("coinbasevalue", nReward));
|
||||||
entry.push_back(Pair("required", true));
|
entry.push_back(Pair("required", true));
|
||||||
|
|||||||
@@ -3027,7 +3027,7 @@ UniValue z_listunspent(const UniValue& params, bool fHelp)
|
|||||||
"\nExamples\n"
|
"\nExamples\n"
|
||||||
+ HelpExampleCli("z_listunspent", "")
|
+ HelpExampleCli("z_listunspent", "")
|
||||||
+ HelpExampleCli("z_listunspent", "6 9999999 false \"[\\\"zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37\\\",\\\"zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37\\\"]\"")
|
+ HelpExampleCli("z_listunspent", "6 9999999 false \"[\\\"zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37\\\",\\\"zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37\\\"]\"")
|
||||||
+ HelpExampleRpc("z_listunspent", "6 9999999 false \"[\\\"zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37\\\",\\\"zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37\\\"]\"")
|
+ HelpExampleRpc("z_listunspent", "6,9999999,false,[\"zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37\",\"zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37\"]")
|
||||||
);
|
);
|
||||||
|
|
||||||
RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)(UniValue::VNUM)(UniValue::VBOOL)(UniValue::VARR));
|
RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)(UniValue::VNUM)(UniValue::VBOOL)(UniValue::VARR));
|
||||||
|
|||||||
Reference in New Issue
Block a user