diff --git a/src/cc/cclib.cpp b/src/cc/cclib.cpp index 000245e56..8a0f0aeca 100644 --- a/src/cc/cclib.cpp +++ b/src/cc/cclib.cpp @@ -29,9 +29,16 @@ #define FAUCET2SIZE COIN #define EVAL_FAUCET2 EVAL_FIRSTUSER -#define EVAL_SUDOKU 17 +#ifdef BUILD_ROGUE +#define EVAL_ROGUE 17 +std::string MYCCLIBNAME = (char *)"rogue"; +#else + +#define EVAL_SUDOKU 17 std::string MYCCLIBNAME = (char *)"sudoku"; +#endif + char *CClib_name() { return((char *)MYCCLIBNAME.c_str()); } struct CClib_rpcinfo @@ -44,23 +51,34 @@ CClib_methods[] = { { (char *)"faucet2", (char *)"fund", (char *)"amount", 1, 1, 'F', EVAL_FAUCET2 }, { (char *)"faucet2", (char *)"get", (char *)"", 0, 0, 'G', EVAL_FAUCET2 }, +#ifdef BUILD_ROGUE +#else { (char *)"sudoku", (char *)"gen", (char *)"", 0, 0, 'G', EVAL_SUDOKU }, { (char *)"sudoku", (char *)"txidinfo", (char *)"txid", 1, 1, 'T', EVAL_SUDOKU }, { (char *)"sudoku", (char *)"pending", (char *)"", 0, 0, 'U', EVAL_SUDOKU }, { (char *)"sudoku", (char *)"solution", (char *)"txid solution timestamps[81]", 83, 83, 'S', EVAL_SUDOKU }, +#endif }; std::string CClib_rawtxgen(struct CCcontract_info *cp,uint8_t funcid,cJSON *params); +#ifdef BUILD_ROGUE +#else bool sudoku_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx); UniValue sudoku_txidinfo(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); UniValue sudoku_generate(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); UniValue sudoku_solution(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); UniValue sudoku_pending(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); +#endif UniValue CClib_method(struct CCcontract_info *cp,char *method,cJSON *params) { UniValue result(UniValue::VOBJ); uint64_t txfee = 10000; +#ifdef BUILD_ROGUE + if ( cp->evalcode == EVAL_ROGUE ) + { + } +#else if ( cp->evalcode == EVAL_SUDOKU ) { //printf("CClib_method params.%p\n",params); @@ -80,6 +98,7 @@ UniValue CClib_method(struct CCcontract_info *cp,char *method,cJSON *params) return(result); } } +#endif else { result.push_back(Pair("result","error")); @@ -195,7 +214,14 @@ bool CClib_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C int32_t numvins,numvouts,preventCCvins,preventCCvouts,i,numblocks; bool retval; uint256 txid; uint8_t hash[32]; char str[65],destaddr[64]; std::vector > txids; if ( cp->evalcode != EVAL_FAUCET2 ) + { +#ifdef BUILD_ROGUE + //return(rogue_validate(cp,height,eval,tx)); + return(false); +#else return(sudoku_validate(cp,height,eval,tx)); +#endif + } numvins = tx.vin.size(); numvouts = tx.vout.size(); preventCCvins = preventCCvouts = -1; @@ -365,5 +391,8 @@ std::string CClib_rawtxgen(struct CCcontract_info *cp,uint8_t funcid,cJSON *para return(""); } +#ifdef BUILD_ROGUE +#else #include "sudoku.cpp" +#endif diff --git a/src/cc/makecclib b/src/cc/makecclib index 0aecab072..b9a50a892 100755 --- a/src/cc/makecclib +++ b/src/cc/makecclib @@ -1 +1 @@ -gcc -std=c++11 -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c -o ../libcc.so cclib.cpp +gcc -std=c++11 $1 -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c -o ../libcc.so cclib.cpp diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index f638afa8a..b0d299090 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1190,7 +1190,7 @@ uint64_t komodo_commission(const CBlock *pblock,int32_t height) n = pblock->vtx[i].vout.size(); for (j=0; j 100000 && ASSETCHAINS_STAKED != 0 && txn_count > 1 && i == txn_count-1 && n == 1 ) + if ( height > 100000 && ASSETCHAINS_STAKED != 0 && txn_count > 1 && i == txn_count-1 && j == 1 ) break; //fprintf(stderr,"(%d %.8f).%d ",i,dstr(pblock->vtx[i].vout[j].nValue),j); if ( i != 0 || j != 1 )