From ecd3a17c85b1b016aac8e971b61ca6f6545305cb Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 27 Mar 2019 09:16:03 -1100 Subject: [PATCH] Test --- src/cc/games/prices.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/cc/games/prices.cpp b/src/cc/games/prices.cpp index 1ac7e3edb..7f807954d 100644 --- a/src/cc/games/prices.cpp +++ b/src/cc/games/prices.cpp @@ -52,10 +52,10 @@ int64_t prices_blockinfo(int32_t height,char *acaddr) } else return(-1); } -UniValue games_origsettle(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) +UniValue games_settle(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) { UniValue result; char acaddr[64]; CPubKey acpk,mypk,gamespk; int64_t prizefund = 0; int32_t height,nextheight = komodo_nextheight(); - if ( 1 || ASSETCHAINS_OVERRIDE_PUBKEY33[0] == 0 ) + if ( ASSETCHAINS_OVERRIDE_PUBKEY33[0] == 0 ) { result.push_back(Pair("result","error")); result.push_back(Pair("error"," no -ac_pubkey for price reference")); @@ -64,6 +64,16 @@ UniValue games_origsettle(uint64_t txfee,struct CCcontract_info *cp,cJSON *param mypk = pubkey2pk(Mypubkey()); gamespk = GetUnspendable(cp,0); acpk = buf2pk(ASSETCHAINS_OVERRIDE_PUBKEY33); + result.push_back(Pair("result","success")); + if ( params != 0 && cJSON_GetArraySize(params) == 1 ) + { + height = juint(jitem(params,0),0); + result.push_back(Pair("height",(int64_t)height)); + } + return(result); + /*mypk = pubkey2pk(Mypubkey()); + gamespk = GetUnspendable(cp,0); + acpk = buf2pk(ASSETCHAINS_OVERRIDE_PUBKEY33); Getscriptaddress(acaddr,CScript() << ParseHex(HexStr(acpk)) << OP_CHECKSIG); if ( params != 0 && cJSON_GetArraySize(params) == 1 ) { @@ -91,7 +101,7 @@ UniValue games_origsettle(uint64_t txfee,struct CCcontract_info *cp,cJSON *param result.push_back(Pair("result","error")); result.push_back(Pair("error","couldnt parse")); } - return(result); + return(result);*/ } UniValue games_settle(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) @@ -110,7 +120,7 @@ UniValue games_settle(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) result.push_back(Pair("result","success")); if ( params != 0 && cJSON_GetArraySize(params) == 1 ) { - //height = juint(jitem(params,0),0); + height = juint(jitem(params,0),0); result.push_back(Pair("height",(int64_t)height)); } /*if ( params != 0 && cJSON_GetArraySize(params) == 2 )