Faucet info
This commit is contained in:
@@ -26,5 +26,6 @@ bool FaucetValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx
|
||||
// CCcustom
|
||||
std::string FaucetFund(uint64_t txfee,uint64_t funds);
|
||||
std::string FaucetGet(uint64_t txfee);
|
||||
UniValue FaucetInfo();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -187,4 +187,17 @@ std::string FaucetFund(uint64_t txfee,uint64_t funds)
|
||||
return(0);
|
||||
}
|
||||
|
||||
UniValue FaucetInfo()
|
||||
{
|
||||
UniValue result(UniValue::VOBJ);
|
||||
CMutableTransaction mtx; CPubKey faucetpk; struct CCcontract_info *cp,C; uint64_t funding;
|
||||
result.push_back(Pair("result","success"));
|
||||
result.push_back(Pair("name","Faucet"));
|
||||
cp = CCinit(&C,EVAL_FAUCET);
|
||||
faucetpk = GetUnspendable(cp,0);
|
||||
funding = AddFaucetInputs(cp,mtx,faucetpk,0,0);
|
||||
sprintf(numstr,"%.8f",(double)funding/COIN);
|
||||
result.push_back(Pair("funding",numstr));
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -5075,6 +5075,16 @@ UniValue rewardsinfo(const UniValue& params, bool fHelp)
|
||||
return(RewardsInfo(fundingtxid));
|
||||
}
|
||||
|
||||
UniValue faucetinfo(const UniValue& params, bool fHelp)
|
||||
{
|
||||
uint256 fundingtxid;
|
||||
if ( fHelp || params.size() != 0 )
|
||||
throw runtime_error("faucetinfo\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");
|
||||
return(FaucetInfo());
|
||||
}
|
||||
|
||||
UniValue faucetfund(const UniValue& params, bool fHelp)
|
||||
{
|
||||
UniValue result(UniValue::VOBJ); uint64_t funds; std::string hex;
|
||||
|
||||
Reference in New Issue
Block a user