Diceaddfunds
This commit is contained in:
@@ -369,6 +369,7 @@ static const CRPCCommand vRPCCommands[] =
|
|||||||
|
|
||||||
/* dice */
|
/* dice */
|
||||||
{ "dice", "dicefund", &dicefund, true },
|
{ "dice", "dicefund", &dicefund, true },
|
||||||
|
{ "dice", "diceaddfunds", &diceaddfunds, true },
|
||||||
{ "dice", "dicebet", &dicebet, true },
|
{ "dice", "dicebet", &dicebet, true },
|
||||||
{ "dice", "diceaddress", &diceaddress, true },
|
{ "dice", "diceaddress", &diceaddress, true },
|
||||||
|
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ extern UniValue rewardslock(const UniValue& params, bool fHelp);
|
|||||||
extern UniValue rewardsunlock(const UniValue& params, bool fHelp);
|
extern UniValue rewardsunlock(const UniValue& params, bool fHelp);
|
||||||
extern UniValue diceaddress(const UniValue& params, bool fHelp);
|
extern UniValue diceaddress(const UniValue& params, bool fHelp);
|
||||||
extern UniValue dicefund(const UniValue& params, bool fHelp);
|
extern UniValue dicefund(const UniValue& params, bool fHelp);
|
||||||
|
extern UniValue diceaddfunds(const UniValue& params, bool fHelp);
|
||||||
extern UniValue dicebet(const UniValue& params, bool fHelp);
|
extern UniValue dicebet(const UniValue& params, bool fHelp);
|
||||||
extern UniValue lottoaddress(const UniValue& params, bool fHelp);
|
extern UniValue lottoaddress(const UniValue& params, bool fHelp);
|
||||||
extern UniValue ponziaddress(const UniValue& params, bool fHelp);
|
extern UniValue ponziaddress(const UniValue& params, bool fHelp);
|
||||||
|
|||||||
@@ -5029,7 +5029,7 @@ UniValue rewardsaddfunding(const UniValue& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
result.push_back(Pair("result", "success"));
|
result.push_back(Pair("result", "success"));
|
||||||
result.push_back(Pair("hex", hex));
|
result.push_back(Pair("hex", hex));
|
||||||
} else result.push_back(Pair("error", "couldnt create rewards lock transaction"));
|
} else result.push_back(Pair("error", "couldnt create rewards addfunding transaction"));
|
||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5109,6 +5109,25 @@ UniValue dicefund(const UniValue& params, bool fHelp)
|
|||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UniValue diceaddfunds(const UniValue& params, bool fHelp)
|
||||||
|
{
|
||||||
|
UniValue result(UniValue::VOBJ); char *name; uint256 fundingtxid; uint64_t amount; std::string hex;
|
||||||
|
if ( fHelp || params.size() != 3 )
|
||||||
|
throw runtime_error("diceaddfunds name fundingtxid amount\n");
|
||||||
|
if ( ensure_CCrequirements() < 0 )
|
||||||
|
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
|
||||||
|
name = (char *)params[0].get_str().c_str();
|
||||||
|
fundingtxid = Parseuint256((char *)params[1].get_str().c_str());
|
||||||
|
amount = atof(params[2].get_str().c_str()) * COIN;
|
||||||
|
hex = DiceAddfunding(0,name,fundingtxid,amount);
|
||||||
|
if ( hex.size() > 0 )
|
||||||
|
{
|
||||||
|
result.push_back(Pair("result", "success"));
|
||||||
|
result.push_back(Pair("hex", hex));
|
||||||
|
} else result.push_back(Pair("error", "couldnt create dice addfunding transaction"));
|
||||||
|
return(result);
|
||||||
|
}
|
||||||
|
|
||||||
UniValue dicebet(const UniValue& params, bool fHelp)
|
UniValue dicebet(const UniValue& params, bool fHelp)
|
||||||
{
|
{
|
||||||
UniValue result(UniValue::VOBJ); std::string hex; uint64_t amount,odds;
|
UniValue result(UniValue::VOBJ); std::string hex; uint64_t amount,odds;
|
||||||
|
|||||||
Reference in New Issue
Block a user