diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index af5535591..3e36c681a 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -157,7 +157,7 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran { Getscriptaddress(destaddr,vintx.vout[utxovout].scriptPubKey); //fprintf(stderr,"FinalizeCCTx() vin.%d is CC %.8f -> (%s)\n",i,(double)utxovalues[i]/COIN,destaddr); - std::cerr << "FinalizeCCtx() searching destaddr=" << destaddr << " for vin[" << i << "] satoshis=" << utxovalues[i] << std::endl; + //std::cerr << "FinalizeCCtx() searching destaddr=" << destaddr << " for vin[" << i << "] satoshis=" << utxovalues[i] << std::endl; if( strcmp(destaddr, myaddr) == 0 ) { fprintf(stderr, "FinalizeCCTx() matched cc myaddr (%s)\n", myaddr); diff --git a/src/cc/rogue/io.c b/src/cc/rogue/io.c index c64b9c8b0..38252fafd 100644 --- a/src/cc/rogue/io.c +++ b/src/cc/rogue/io.c @@ -159,12 +159,14 @@ readchar(struct rogue_state *rs) { //if ( rs->ind == rs->numkeys-1 ) // rs->replaydone = (uint32_t)time(NULL); - fprintf(stderr,"(%c) ",rs->keystrokes[rs->ind]); + //fprintf(stderr,"(%c) ",rs->keystrokes[rs->ind]); return(rs->keystrokes[rs->ind++]); } fprintf(stderr,"replay finished but readchar called\n"); rs->replaydone = (uint32_t)time(NULL); - return('y'); + if ( (rand() & 1) == 0 ) + return(ESCAPE); + else return('y'); } if ( rs == 0 || rs->guiflag != 0 ) { diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index 28fd07f6a..ff8ab88c2 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -839,9 +839,12 @@ UniValue rogue_finishgame(uint64_t txfee,struct CCcontract_info *cp,cJSON *param return(cclib_error(result,"highlander must be a winner or last one standing")); cashout += numplayers * buyin; } - if ( (inputsum= AddCClibInputs(cp,mtx,roguepk,cashout,16,cp->unspendableCCaddr)) > (uint64_t)P.gold*mult ) - CCchange = (inputsum - cashout); - mtx.vout.push_back(CTxOut(cashout,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG)); + if ( cashout >= txfee ) + { + if ( (inputsum= AddCClibInputs(cp,mtx,roguepk,cashout,16,cp->unspendableCCaddr)) > (uint64_t)P.gold*mult ) + CCchange = (inputsum - cashout); + mtx.vout.push_back(CTxOut(cashout,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG)); + } //for (i=0; i_o._o_type,o->_o._o_packch,o->_o._o_packch); } @@ -849,7 +852,7 @@ UniValue rogue_finishgame(uint64_t txfee,struct CCcontract_info *cp,cJSON *param Myprivkey(mypriv); CCaddr1of2set(cp,roguepk,mypk,mypriv,myrogueaddr); rawtx = FinalizeCCTx(0,cp,mtx,mypk,txfee,rogue_highlanderopret(funcid,gametxid,mypk,newdata)); - return(rogue_rawtxresult(result,rawtx,1)); + return(rogue_rawtxresult(result,rawtx,0)); } result.push_back(Pair("result","success")); }