From 37eba17f16425ab6f16ac1b6b4765f0ec1f2b27c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Feb 2019 09:30:31 -1100 Subject: [PATCH] Limit to 'R' --- src/cc/rogue_rpc.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index fbd512c5a..0e6c6011a 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1046,7 +1046,7 @@ 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); uint256 txid; int32_t vout; CPubKey roguepk,mypk; char coinaddr[64]; + UniValue result(UniValue::VOBJ),a(UniValue::VARR); uint256 txid,gametxid,tokenid,playertxid; int32_t vout; CPubKey roguepk,mypk; char coinaddr[64]; CTransaction tx; std::vector > unspentOutputs; roguepk = GetUnspendable(cp,0); mypk = pubkey2pk(Mypubkey()); @@ -1057,10 +1057,16 @@ UniValue rogue_games(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) { txid = it->first.txhash; vout = (int32_t)it->first.index; - char str[65]; fprintf(stderr,"%s check %s/v%d %.8f\n",coinaddr,uint256_str(str,txid),vout,(double)it->second.satoshis/COIN); + //char str[65]; fprintf(stderr,"%s check %s/v%d %.8f\n",coinaddr,uint256_str(str,txid),vout,(double)it->second.satoshis/COIN); if ( vout == 0 ) { - a.push_back(txid.GetHex()); + if ( GetTransaction(txid,tx,hashBlock,false) != 0 && (numvouts= tx.vout.size()) > 1 ) + { + if ( rogue_registeropretdecode(gametxid,tokenid,playertxid,tx.vout[numvouts-1].scriptPubKey) == 'R' ) + { + a.push_back(gametxid.GetHex()); + } + } } } result.push_back(Pair("games",a));