From a1810eb2d39e285fb1c9108eb20b52e9dc007253 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Mar 2019 20:46:03 -1100 Subject: [PATCH] Test --- src/cc/payments.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cc/payments.cpp b/src/cc/payments.cpp index 08b1bca09..744e82c5a 100644 --- a/src/cc/payments.cpp +++ b/src/cc/payments.cpp @@ -240,7 +240,7 @@ UniValue payments_rawtxresult(UniValue &result,std::string rawtx,int32_t broadca cJSON *payments_reparse(int32_t *nump,char *jsonstr) { - cJSON *params; char *newstr; int32_t i,j; + cJSON *params=0; char *newstr; int32_t i,j; *nump = 0; if ( jsonstr != 0 ) { @@ -263,11 +263,11 @@ cJSON *payments_reparse(int32_t *nump,char *jsonstr) } newstr[j] = 0; params = cJSON_Parse(newstr); - if ( 0 && params != 0 ) + if ( 1 && params != 0 ) printf("new.(%s) -> %s\n",newstr,jprint(params,0)); free(newstr); *nump = cJSON_GetArraySize(params); - } else params = 0; + } return(params); } @@ -295,6 +295,7 @@ UniValue PaymentsRelease(struct CCcontract_info *cp,char *jsonstr) int32_t latestheight,nextheight = komodo_nextheight(); CMutableTransaction tmpmtx,mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(),nextheight); UniValue result(UniValue::VOBJ); uint256 createtxid,hashBlock; CTransaction tx,txO; CPubKey mypk,txidpk,Paymentspk; int32_t i,n,numoprets=0,lockedblocks,minrelease,totalallocations,checkallocations=0,allocation; int64_t inputsum,amount,CCchange=0; CTxOut vout; CScript onlyopret; char txidaddr[64],destaddr[64]; std::vector txidoprets; std::string rawtx; + fprintf(stderr,"jsonstr.(%s)\n",jsonstr); cJSON *params = payments_reparse(&n,jsonstr); mypk = pubkey2pk(Mypubkey()); Paymentspk = GetUnspendable(cp,0);