This commit is contained in:
Mihailo Milenkovic
2019-08-28 19:01:24 +02:00
parent 60b851a77a
commit 482cd0eed6
10 changed files with 58 additions and 59 deletions

View File

@@ -1452,15 +1452,15 @@ UniValue rogue_players(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
UniValue rogue_games(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
{
UniValue result(UniValue::VOBJ),a(UniValue::VARR),b(UniValue::VARR); uint256 txid,hashBlock,gametxid,tokenid,playertxid; int32_t vout,maxplayers,gameheight,numvouts; CPubKey roguepk,mypk; char coinaddr[64]; CTransaction tx,gametx; int64_t buyin;
std::vector<std::pair<CAddressIndexKey, CAmount> > addressIndex;
std::vector<uint256> txids;
//std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> > unspentOutputs;
roguepk = GetUnspendable(cp,0);
mypk = pubkey2pk(Mypubkey());
GetCCaddress1of2(cp,coinaddr,roguepk,mypk);
//SetCCunspents(unspentOutputs,coinaddr);
SetCCtxids(addressIndex,coinaddr,true);
SetCCtxids(txids,coinaddr,true,cp->evalcode,zeroid,'R');
rogue_univalue(result,"games",-1,-1);
for (std::vector<std::pair<CAddressIndexKey, CAmount> >::const_iterator it=addressIndex.begin(); it!=addressIndex.end(); it++)
for (std::vector<uint256>::const_iterator it=txids.begin(); it!=txids.end(); it++)
//for (std::vector<std::pair<CAddressUnspentKey, CAddressUnspentValue> >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++)
{
txid = it->first.txhash;