Remove unused code
This commit is contained in:
@@ -1061,79 +1061,8 @@ UniValue notaries(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
}
|
||||
|
||||
int32_t hush_pending_withdraws(char *opretstr);
|
||||
int32_t pax_fiatstatus(uint64_t *available,uint64_t *deposited,uint64_t *issued,uint64_t *withdrawn,uint64_t *approved,uint64_t *redeemed,char *base);
|
||||
extern char CURRENCIES[][8];
|
||||
|
||||
UniValue paxpending(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
{
|
||||
UniValue ret(UniValue::VOBJ); UniValue a(UniValue::VARR); char opretbuf[10000*2]; int32_t opretlen,baseid; uint64_t available,deposited,issued,withdrawn,approved,redeemed;
|
||||
if ( fHelp || params.size() != 0 )
|
||||
throw runtime_error("paxpending needs no args\n");
|
||||
LOCK(cs_main);
|
||||
if ( (opretlen= hush_pending_withdraws(opretbuf)) > 0 )
|
||||
ret.push_back(Pair("withdraws", opretbuf));
|
||||
else ret.push_back(Pair("withdraws", (char *)""));
|
||||
for (baseid=0; baseid<32; baseid++)
|
||||
{
|
||||
UniValue item(UniValue::VOBJ); UniValue obj(UniValue::VOBJ);
|
||||
if ( pax_fiatstatus(&available,&deposited,&issued,&withdrawn,&approved,&redeemed,CURRENCIES[baseid]) == 0 )
|
||||
{
|
||||
if ( deposited != 0 || issued != 0 || withdrawn != 0 || approved != 0 || redeemed != 0 )
|
||||
{
|
||||
item.push_back(Pair("available", ValueFromAmount(available)));
|
||||
item.push_back(Pair("deposited", ValueFromAmount(deposited)));
|
||||
item.push_back(Pair("issued", ValueFromAmount(issued)));
|
||||
item.push_back(Pair("withdrawn", ValueFromAmount(withdrawn)));
|
||||
item.push_back(Pair("approved", ValueFromAmount(approved)));
|
||||
item.push_back(Pair("redeemed", ValueFromAmount(redeemed)));
|
||||
obj.push_back(Pair(CURRENCIES[baseid],item));
|
||||
a.push_back(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
ret.push_back(Pair("fiatstatus", a));
|
||||
return ret;
|
||||
}
|
||||
|
||||
UniValue paxprice(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
{
|
||||
if ( fHelp || params.size() > 4 || params.size() < 2 )
|
||||
throw runtime_error("paxprice \"base\" \"rel\" height\n");
|
||||
LOCK(cs_main);
|
||||
UniValue ret(UniValue::VOBJ); uint64_t basevolume=0,relvolume,seed;
|
||||
std::string base = params[0].get_str();
|
||||
std::string rel = params[1].get_str();
|
||||
int32_t height;
|
||||
if ( params.size() == 2 )
|
||||
height = chainActive.LastTip()->GetHeight();
|
||||
else height = atoi(params[2].get_str().c_str());
|
||||
//if ( params.size() == 3 || (basevolume= COIN * atof(params[3].get_str().c_str())) == 0 )
|
||||
basevolume = 100000;
|
||||
relvolume = hush_paxprice(&seed,height,(char *)base.c_str(),(char *)rel.c_str(),basevolume);
|
||||
ret.push_back(Pair("base", base));
|
||||
ret.push_back(Pair("rel", rel));
|
||||
ret.push_back(Pair("height", height));
|
||||
char seedstr[32];
|
||||
sprintf(seedstr,"%llu",(long long)seed);
|
||||
ret.push_back(Pair("seed", seedstr));
|
||||
if ( height < 0 || height > chainActive.Height() )
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
|
||||
else
|
||||
{
|
||||
CBlockIndex *pblockindex = chainActive[height];
|
||||
if ( pblockindex != 0 )
|
||||
ret.push_back(Pair("timestamp", (int64_t)pblockindex->nTime));
|
||||
if ( basevolume != 0 && relvolume != 0 )
|
||||
{
|
||||
ret.push_back(Pair("price",((double)relvolume / (double)basevolume)));
|
||||
ret.push_back(Pair("invprice",((double)basevolume / (double)relvolume)));
|
||||
ret.push_back(Pair("basevolume",ValueFromAmount(basevolume)));
|
||||
ret.push_back(Pair("relvolume",ValueFromAmount(relvolume)));
|
||||
} else ret.push_back(Pair("error", "overflow or error in one or more of parameters"));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
UniValue gettxout(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
{
|
||||
if (fHelp || params.size() < 2 || params.size() > 3)
|
||||
|
||||
Reference in New Issue
Block a user