From 90f6d123adca067618208cb942c1175f73f41223 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Sun, 26 May 2019 23:43:27 +0800 Subject: [PATCH 01/65] fix build --- src/cc/makecclib | 2 +- src/wallet/db.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cc/makecclib b/src/cc/makecclib index 5241ea675..e9a015e2f 100755 --- a/src/cc/makecclib +++ b/src/cc/makecclib @@ -7,7 +7,7 @@ make -f Makefile_rogue rm ../libcc.so cp librogue.so ../libcc.so -#exit 0 +exit 0 echo sudoku/musig/dilithium gcc -O3 -std=c++11 -I../secp256k1/include -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c -o sudokucc.so cclib.cpp diff --git a/src/wallet/db.h b/src/wallet/db.h index e1ae52909..f23122830 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -34,8 +34,8 @@ #include // If CCLIB fails to compile with this, use the one below. -#include -//#include "../depends/x86_64-unknown-linux-gnu/include/db_cxx.h" +//#include +#include "../depends/x86_64-unknown-linux-gnu/include/db_cxx.h" extern unsigned int nWalletDBUpdated; From 784679fff6564757b761d9af6aedfd5fc1169f6b Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Mon, 27 May 2019 02:51:11 +0800 Subject: [PATCH 02/65] This kind of works, result comes out as negative number though. --- src/rpc/mining.cpp | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index c95d7b891..8e5de0f53 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -59,6 +59,20 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he * Return average network hashes per second based on the last 'lookup' blocks, * or over the difficulty averaging window if 'lookup' is nonpositive. * If 'height' is nonnegative, compute the estimate at the time when a given block was found. +time =0, lastBlockTime=time_of_last_block, PoWblocks=0 +for x = 1 to 100 +get block info +if PoS then + lastBlockTime = ThisBlockTime + next x +else + PoWblocks += 1 + some var/array about diff + newTime = timeNow - lastBlockTime + totalTime = totalTime + newTime + lastBlockTime = newTime +next x +do math of num PoW blocks over PoW active Time with stored diff info */ int64_t GetNetworkHashPS(int lookup, int height) { CBlockIndex *pb = chainActive.LastTip(); @@ -79,21 +93,36 @@ int64_t GetNetworkHashPS(int lookup, int height) { CBlockIndex *pb0 = pb; int64_t minTime = pb0->GetBlockTime(); + int64_t timeoffset = 0, n=0,i=0; int64_t maxTime = minTime; - for (int i = 0; i < lookup; i++) { + for (i = 0; i < lookup; i++) { pb0 = pb0->pprev; + // if PoW block save block time, and skip the hash. + if ( pb0->segid >= 0 && pb0->segid != -2 ) + { + n++; + // only staking chains should ever set this. + + timeoffset += pb0->GetBlockTime() - pb0->pprev->GetBlockTime(); + //fprintf(stderr, "staking tx.%li segid.%i blocktime.%li\n", n, pb0->segid, (pb0->GetBlockTime() - pb0->pprev->GetBlockTime())); + if ( lookup > pb->GetHeight() ) + break; + lookup++; + continue; + } int64_t time = pb0->GetBlockTime(); minTime = std::min(time, minTime); maxTime = std::max(time, maxTime); } + //fprintf(stderr, "number blocks scanned.%li\n",i ); // In case there's a situation where minTime == maxTime, we don't want a divide by zero exception. if (minTime == maxTime) return 0; arith_uint256 workDiff = pb->chainPower.chainWork - pb0->chainPower.chainWork; - int64_t timeDiff = maxTime - minTime; - + int64_t timeDiff = maxTime - minTime;// - timeoffset; + fprintf(stderr, "timediff.%li timeoffset.%li mintime.%li maxtime.%li\n", timeDiff, timeoffset, minTime, maxTime); return (int64_t)(workDiff.getdouble() / timeDiff); } From 1c6723b9f1428f3e79ed614275a1863d556ee77f Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Mon, 27 May 2019 16:22:43 +0800 Subject: [PATCH 03/65] for gcharang --- src/rpc/blockchain.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 76d35ff61..ddb5dab12 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -51,6 +51,7 @@ using namespace std; extern int32_t KOMODO_INSYNC; extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry); void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex); +int32_t komodo_notarized_height(int32_t *prevMoMheightp,uint256 *hashp,uint256 *txidp); #include "komodo_defs.h" #include "komodo_structs.h" @@ -133,6 +134,9 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex) result.push_back(Pair("error", "null blockhash")); return(result); } + uint256 notarized_hash,notarized_desttxid; int32_t prevMoMheight,notarized_height; + notarized_height = komodo_notarized_height(&prevMoMheight,¬arized_hash,¬arized_desttxid); + result.push_back(Pair("last_notarized_height", notarized_height)); result.push_back(Pair("hash", blockindex->GetBlockHash().GetHex())); int confirmations = -1; // Only report confirmations if the block is on the main chain @@ -284,6 +288,9 @@ UniValue blockToDeltasJSON(const CBlock& block, const CBlockIndex* blockindex) UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false) { UniValue result(UniValue::VOBJ); + uint256 notarized_hash,notarized_desttxid; int32_t prevMoMheight,notarized_height; + notarized_height = komodo_notarized_height(&prevMoMheight,¬arized_hash,¬arized_desttxid); + result.push_back(Pair("last_notarized_height", notarized_height)); result.push_back(Pair("hash", block.GetHash().GetHex())); int confirmations = -1; // Only report confirmations if the block is on the main chain From f08a7d2d03f47036f25845931faa2a060cd04a32 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Mon, 27 May 2019 17:58:23 +0800 Subject: [PATCH 04/65] add ENABLE LABS global var to build cclib correctly with start.sh. --- src/cc/makecclib | 5 ++++- src/wallet/db.h | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/cc/makecclib b/src/cc/makecclib index e9a015e2f..0d82463c4 100755 --- a/src/cc/makecclib +++ b/src/cc/makecclib @@ -7,7 +7,10 @@ make -f Makefile_rogue rm ../libcc.so cp librogue.so ../libcc.so -exit 0 +if [ "${LABS_FLAGS}" = "ENABLE_LABS" ] +then + exit +fi echo sudoku/musig/dilithium gcc -O3 -std=c++11 -I../secp256k1/include -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c -o sudokucc.so cclib.cpp diff --git a/src/wallet/db.h b/src/wallet/db.h index f23122830..3aaf3d34b 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -33,9 +33,11 @@ #include -// If CCLIB fails to compile with this, use the one below. -//#include -#include "../depends/x86_64-unknown-linux-gnu/include/db_cxx.h" +#ifdef BUILD_ROGUE + #include "../depends/x86_64-unknown-linux-gnu/include/db_cxx.h" +#else + #include +#endif extern unsigned int nWalletDBUpdated; From 0f24aec58740a6afeedd186705e9dc8e1c39e880 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Mon, 27 May 2019 21:31:15 -0700 Subject: [PATCH 05/65] Give correct CLI asset name and RPC ports in rpc examples --- src/rpc/server.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 500d175e0..e36e8b4c9 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -1,5 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2019 The Hush developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -45,6 +46,7 @@ using namespace RPCServer; using namespace std; +extern uint16_t ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT; static bool fRPCRunning = false; static bool fRPCInWarmup = true; @@ -853,21 +855,30 @@ UniValue CRPCTable::execute(const std::string &strMethod, const UniValue ¶ms std::string HelpExampleCli(const std::string& methodname, const std::string& args) { - return "> komodo-cli " + methodname + " " + args + "\n"; + if ( ASSETCHAINS_SYMBOL[0] == 0 ) { + return "> komodo-cli " + methodname + " " + args + "\n"; + } else if ((strncmp(ASSETCHAINS_SYMBOL, "HUSH3", 5) == 0) ) { + return "> hush-cli " + methodname + " " + args + "\n"; + } else { + return "> komodo-cli -ac_name=" + strprintf("%s", ASSETCHAINS_SYMBOL) + " " + methodname + " " + args + "\n"; + } } std::string HelpExampleRpc(const std::string& methodname, const std::string& args) { - return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", " - "\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:7771/\n"; + return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", " + "\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:" + to_string(ASSETCHAINS_RPCPORT) + "/\n"; } string experimentalDisabledHelpMsg(const string& rpc, const string& enableArg) { + string daemon = ASSETCHAINS_SYMBOL[0] == 0 ? "komodod" : "hushd"; + string ticker = ASSETCHAINS_SYMBOL[0] == 0 ? "komodo" : ASSETCHAINS_SYMBOL; + return "\nWARNING: " + rpc + " is disabled.\n" - "To enable it, restart zcashd with the -experimentalfeatures and\n" + "To enable it, restart " + daemon + " with the -experimentalfeatures and\n" "-" + enableArg + " commandline options, or add these two lines\n" - "to the zcash.conf file:\n\n" + "to the " + ticker + ".conf file:\n\n" "experimentalfeatures=1\n" + enableArg + "=1\n"; } From 01f597a2c83264fc7dddf9496bec972d9ba8ed68 Mon Sep 17 00:00:00 2001 From: Mihailo Milenkovic Date: Tue, 28 May 2019 15:40:43 +0200 Subject: [PATCH 06/65] Oracles pubkey spoofing in register tx fix - Fix activation on July 15th 2019 00:00 - Added oraclesfund tx to fund Oracles CC address of pubkey that will register, and spend it in register tx - oraclessamples gets baton address as input instead of txid to show all data from publisher --- src/cc/CCOracles.h | 4 +- src/cc/oracles.cpp | 246 ++++++++++++++++++++++++++++++++------- src/rpc/server.cpp | 1 + src/rpc/server.h | 1 + src/wallet/rpcwallet.cpp | 28 ++++- 5 files changed, 233 insertions(+), 47 deletions(-) diff --git a/src/cc/CCOracles.h b/src/cc/CCOracles.h index 7f952e5f5..9f6a35966 100644 --- a/src/cc/CCOracles.h +++ b/src/cc/CCOracles.h @@ -21,12 +21,12 @@ bool OraclesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn); std::string OracleCreate(int64_t txfee,std::string name,std::string description,std::string format); +std::string OracleFund(int64_t txfee,uint256 oracletxid); std::string OracleRegister(int64_t txfee,uint256 oracletxid,int64_t datafee); std::string OracleSubscribe(int64_t txfee,uint256 oracletxid,CPubKey publisher,int64_t amount); std::string OracleData(int64_t txfee,uint256 oracletxid,std::vector data); - // CCcustom -UniValue OracleDataSamples(uint256 reforacletxid,uint256 batontxid,int32_t num); +UniValue OracleDataSamples(uint256 reforacletxid,char* batonaddr,int32_t num); UniValue OracleInfo(uint256 origtxid); UniValue OraclesList(); diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 7cd429182..f019ae271 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -92,10 +92,11 @@ vout.n-1: opreturn with oracletxid, prevbatontxid and data in proper format */ +extern int32_t komodo_currentheight(); +#define PUBKEY_SPOOFING_FIX_ACTIVATION 1563148800 +#define CC_MARKER_VALUE 10000 // start of consensus code - - CScript EncodeOraclesCreateOpRet(uint8_t funcid,std::string name,std::string description,std::string format) { CScript opret; uint8_t evalcode = EVAL_ORACLES; @@ -124,6 +125,7 @@ uint8_t DecodeOraclesCreateOpRet(const CScript &scriptPubKey,std::string &name,s CScript EncodeOraclesOpRet(uint8_t funcid,uint256 oracletxid,CPubKey pk,int64_t num) { CScript opret; uint8_t evalcode = EVAL_ORACLES; + opret << OP_RETURN << E_MARSHAL(ss << evalcode << funcid << oracletxid << pk << num); return(opret); } @@ -131,11 +133,12 @@ CScript EncodeOraclesOpRet(uint8_t funcid,uint256 oracletxid,CPubKey pk,int64_t uint8_t DecodeOraclesOpRet(const CScript &scriptPubKey,uint256 &oracletxid,CPubKey &pk,int64_t &num) { std::vector vopret; uint8_t *script,e,f; + GetOpReturnData(scriptPubKey,vopret); script = (uint8_t *)vopret.data(); if ( vopret.size() > 2 && script[0] == EVAL_ORACLES ) { - if (script[0] == EVAL_ORACLES && (script[1]== 'R' || script[1] == 'S') && E_UNMARSHAL(vopret,ss >> e; ss >> f; ss >> oracletxid; ss >> pk; ss >> num)!=0) + if (script[0] == EVAL_ORACLES && (script[1]== 'R' || script[1] == 'S' || script[1] == 'F') && E_UNMARSHAL(vopret,ss >> e; ss >> f; ss >> oracletxid; ss >> pk; ss >> num)!=0) return(f); else return(script[1]); } @@ -633,9 +636,25 @@ bool OraclesDataValidate(struct CCcontract_info *cp,Eval* eval,const CTransactio else return(true); } +int32_t GetLatestTimestamp(int32_t height) +{ + uint256 blockHash; CBlock block; CBlockIndex* pindex; + + blockHash = chainActive[height]->GetBlockHash(); + pindex = mapBlockIndex[blockHash]; + if ( komodo_blockload(block,pindex) == 0 ) + { + return(block.nTime); + } + return(0); +} + bool OraclesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn) { - uint256 txid,oracletxid,batontxid; uint64_t txfee=10000; int32_t numvins,numvouts,preventCCvins,preventCCvouts; uint8_t *script; std::vector vopret,data; CScript scriptPubKey; CPubKey publisher; + uint256 oracletxid,batontxid; uint64_t txfee=10000; int32_t numvins,numvouts,preventCCvins,preventCCvouts; int64_t amount; uint256 hashblock; + uint8_t *script; std::vector vopret,data; CPubKey publisher,tmppk,oraclespk; char tmpaddress[64],vinaddress[64],oraclesaddr[64]; + CTransaction tmptx; std::string name,desc,format; + numvins = tx.vin.size(); numvouts = tx.vout.size(); preventCCvins = preventCCvouts = -1; @@ -643,10 +662,11 @@ bool OraclesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t return eval->Invalid("no vouts"); else { - txid = tx.GetHash(); GetOpReturnData(tx.vout[numvouts-1].scriptPubKey,vopret); if ( vopret.size() > 2 ) - { + { + oraclespk=GetUnspendable(cp,0); + Getscriptaddress(oraclesaddr,CScript() << ParseHex(HexStr(oraclespk)) << OP_CHECKSIG); script = (uint8_t *)vopret.data(); switch ( script[1] ) { @@ -657,13 +677,45 @@ bool OraclesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t // vout.n-1: opreturn with name and description and format for data return eval->Invalid("unexpected OraclesValidate for create"); break; - case 'R': // register + case 'F': // fund (activation on Jul 15th 2019 00:00) // vins.*: normal inputs + // vout.0: txfee to oracle CC address of users pubkey + // vout.1: change, if any + // vout.n-1: opreturn with createtxid, pubkey and amount + return eval->Invalid("unexpected OraclesValidate for create"); + break; + case 'R': // register + // vin.0: normal inputs + // vin.n-1: CC input from pubkeys oracle CC addres - to prove that register came from pubkey that is registred (activation on Jul 15th 2019 00:00) // vout.0: txfee tag to normal marker address // vout.1: baton CC utxo - // vout.2: change, if any + // vout.2: marker from oraclesfund tx to normal pubkey address (activation on Jul 15th 2019 00:00) + // vout.n-2: change, if any // vout.n-1: opreturn with createtxid, pubkey and price per data point - return eval->Invalid("unexpected OraclesValidate for register"); + if (GetLatestTimestamp(eval->GetCurrentHeight())>PUBKEY_SPOOFING_FIX_ACTIVATION) + { + if ((numvouts=tx.vout.size()) < 1 || DecodeOraclesOpRet(tx.vout[numvouts-1].scriptPubKey,oracletxid,tmppk,amount)!='R') + return eval->Invalid("invalid oraclesregister OP_RETURN data!"); + else if (myGetTransaction(oracletxid,tmptx,hashblock) == 0) + return eval->Invalid("invalid oraclescreate txid!"); + else if ((numvouts=tmptx.vout.size()) < 1 || DecodeOraclesCreateOpRet(tmptx.vout[numvouts-1].scriptPubKey,name,desc,format)!='C') + return eval->Invalid("invalid oraclescreate OP_RETURN data!"); + else if ( IsCCInput(tmptx.vin[0].scriptSig) != 0 ) + return eval->Invalid("vin.0 is normal for oraclescreate!"); + else if (ConstrainVout(tmptx.vout[0],0,oraclesaddr,txfee)==0) + return eval->Invalid("invalid marker for oraclescreate!"); + else if ( IsCCInput(tx.vin[0].scriptSig) != 0 ) + return eval->Invalid("vin.0 is normal for oraclesregister!"); + else if ((*cp->ismyvin)(tx.vin[tx.vin.size()-1].scriptSig) == 0 || myGetTransaction(tx.vin[tx.vin.size()-1].prevout.hash,tmptx,hashblock)==0 + || tmptx.vout[tx.vin[tx.vin.size()-1].prevout.n].nValue!=CC_MARKER_VALUE || !Getscriptaddress(vinaddress,tmptx.vout[tx.vin[tx.vin.size()-1].prevout.n].scriptPubKey) + || !GetCCaddress(cp,tmpaddress,tmppk) || strcmp(tmpaddress,vinaddress)!=0) + return eval->Invalid("vin."+std::to_string(tx.vin.size()-1)+" is CC for oraclesregister or pubkey not same as vin pubkey, register must be done from owner of pubkey that registers to oracle!!"); + else if (CCtxidaddr(tmpaddress,oracletxid).IsValid() && ConstrainVout(tx.vout[0],0,tmpaddress,txfee)==0) + return eval->Invalid("invalid marker for oraclesregister!"); + else if (!Getscriptaddress(tmpaddress,CScript() << ParseHex(HexStr(tmppk)) << OP_CHECKSIG) || ConstrainVout(tx.vout[2],0,tmpaddress,CC_MARKER_VALUE)==0) + return eval->Invalid("pubkey in OP_RETURN and in vout.2 not matching, register must be done from owner of pubkey that registers to oracle!"); + } + else return eval->Invalid("unexpected OraclesValidate for register"); break; case 'S': // subscribe // vins.*: normal inputs @@ -762,6 +814,45 @@ int64_t LifetimeOraclesFunds(struct CCcontract_info *cp,uint256 oracletxid,CPubK return(total); } +int64_t AddMyOraclesFunds(struct CCcontract_info *cp,CMutableTransaction &mtx,CPubKey pk,uint256 oracletxid) +{ + char coinaddr[64],funcid; int64_t nValue,tmpamount; uint256 tmporacletxid,txid,hashBlock,ignoretxid; int32_t numvouts,vout,ignorevin; + std::vector > unspentOutputs; CTransaction vintx; CPubKey tmppk; + + GetCCaddress(cp,coinaddr,pk); + SetCCunspents(unspentOutputs,coinaddr,true); + for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) + { + txid = it->first.txhash; + vout = (int32_t)it->first.index; + nValue = it->second.satoshis; + if ( GetTransaction(txid,vintx,hashBlock,false) != 0 && (numvouts=vintx.vout.size())>0) + { + if ((funcid=DecodeOraclesOpRet(vintx.vout[numvouts-1].scriptPubKey,tmporacletxid,tmppk,tmpamount))!=0 && funcid=='F' && tmppk==pk + && tmporacletxid==oracletxid && tmpamount==nValue && myIsutxo_spentinmempool(ignoretxid,ignorevin,txid,vout)==0) + { + mtx.vin.push_back(CTxIn(txid,vout,CScript())); + return (nValue); + } + } else fprintf(stderr,"couldnt find transaction\n"); + } + + BOOST_FOREACH(const CTxMemPoolEntry &e, mempool.mapTx) + { + const CTransaction &txmempool = e.GetTx(); + const uint256 &hash = txmempool.GetHash(); + nValue=txmempool.vout[0].nValue; + + if ((funcid=DecodeOraclesOpRet(txmempool.vout[txmempool.vout.size()-1].scriptPubKey,tmporacletxid,tmppk,tmpamount))!=0 && funcid=='F' + && tmppk==pk && tmporacletxid==oracletxid && tmpamount==nValue && myIsutxo_spentinmempool(ignoretxid,ignorevin,hash,0)==0) + { + mtx.vin.push_back(CTxIn(hash,0,CScript())); + return (nValue); + } + } + return (0); +} + std::string OracleCreate(int64_t txfee,std::string name,std::string description,std::string format) { CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight()); @@ -802,10 +893,36 @@ std::string OracleCreate(int64_t txfee,std::string name,std::string description, return(""); } +std::string OracleFund(int64_t txfee,uint256 oracletxid) +{ + CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight()); + CPubKey mypk,oraclespk; struct CCcontract_info *cp,C; + + if (GetLatestTimestamp(komodo_currentheight())evalcode,CC_MARKER_VALUE,mypk)); + return(FinalizeCCTx(0,cp,mtx,mypk,txfee,EncodeOraclesOpRet('F',oracletxid,mypk,CC_MARKER_VALUE))); + } + CCerror = strprintf("error adding normal inputs"); + fprintf(stderr,"%s\n", CCerror.c_str() ); + return(""); +} + std::string OracleRegister(int64_t txfee,uint256 oracletxid,int64_t datafee) { CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight()); - CPubKey mypk,markerpubkey,batonpk; struct CCcontract_info *cp,C; char markeraddr[64],batonaddr[64]; + CPubKey mypk,markerpubkey,batonpk,oraclespk; struct CCcontract_info *cp,C; char markeraddr[64],batonaddr[64]; + cp = CCinit(&C,EVAL_ORACLES); if ( txfee == 0 ) txfee = 10000; @@ -816,12 +933,20 @@ std::string OracleRegister(int64_t txfee,uint256 oracletxid,int64_t datafee) return(""); } mypk = pubkey2pk(Mypubkey()); + oraclespk = GetUnspendable(cp,0); batonpk = OracleBatonPk(batonaddr,cp); markerpubkey = CCtxidaddr(markeraddr,oracletxid); - if ( AddNormalinputs(mtx,mypk,3*txfee,4) > 0 ) + if (AddNormalinputs(mtx,mypk,3*txfee,4)) { + if (GetLatestTimestamp(komodo_currentheight())>PUBKEY_SPOOFING_FIX_ACTIVATION && AddMyOraclesFunds(cp,mtx,mypk,oracletxid)!=CC_MARKER_VALUE) + { + CCerror = strprintf("error adding inputs from your Oracles CC address, please fund it first with oraclesfund rpc!"); + fprintf(stderr,"%s\n", CCerror.c_str() ); + return(""); + } mtx.vout.push_back(CTxOut(txfee,CScript() << ParseHex(HexStr(markerpubkey)) << OP_CHECKSIG)); mtx.vout.push_back(MakeCC1vout(cp->evalcode,txfee,batonpk)); + if (GetLatestTimestamp(komodo_currentheight())>PUBKEY_SPOOFING_FIX_ACTIVATION) mtx.vout.push_back(CTxOut(txfee,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG)); return(FinalizeCCTx(0,cp,mtx,mypk,txfee,EncodeOraclesOpRet('R',oracletxid,mypk,datafee))); } CCerror = strprintf("error adding normal inputs"); @@ -924,43 +1049,70 @@ std::string OracleData(int64_t txfee,uint256 oracletxid,std::vector da UniValue OracleFormat(uint8_t *data,int32_t datalen,char *format,int32_t formatlen) { - uint256 hash; int32_t i,j=0; int64_t val; char str[IGUANA_MAXSCRIPTSIZE*2+1]; + UniValue obj(UniValue::VARR); uint256 hash; int32_t i,j=0; int64_t val; char str[IGUANA_MAXSCRIPTSIZE*2+1]; for (i=0; i= datalen ) break; } - return(str); + return(obj); } -UniValue OracleDataSamples(uint256 reforacletxid,uint256 batontxid,int32_t num) +UniValue OracleDataSamples(uint256 reforacletxid,char* batonaddr,int32_t num) { - UniValue result(UniValue::VOBJ),b(UniValue::VARR); CTransaction tx,oracletx; uint256 hashBlock,btxid,oracletxid; - CPubKey pk; std::string name,description,format; int32_t numvouts,n=0; std::vector data; char str[67], *formatstr = 0; + UniValue result(UniValue::VOBJ),b(UniValue::VARR); CTransaction tx,oracletx; uint256 txid,hashBlock,btxid,oracletxid; + CPubKey pk; std::string name,description,format; int32_t numvouts,n=0,vout; std::vector data; char *formatstr = 0; + std::vector > addressIndex; int64_t nValue; result.push_back(Pair("result","success")); if ( GetTransaction(reforacletxid,oracletx,hashBlock,false) != 0 && (numvouts=oracletx.vout.size()) > 0 ) { if ( DecodeOraclesCreateOpRet(oracletx.vout[numvouts-1].scriptPubKey,name,description,format) == 'C' ) { - while ( GetTransaction(batontxid,tx,hashBlock,false) != 0 && (numvouts=tx.vout.size()) > 0 ) + BOOST_FOREACH(const CTxMemPoolEntry &e, mempool.mapTx) { - if ( DecodeOraclesData(tx.vout[numvouts-1].scriptPubKey,oracletxid,btxid,pk,data) == 'D' && reforacletxid == oracletxid ) + const CTransaction &txmempool = e.GetTx(); + const uint256 &hash = txmempool.GetHash(); + if ((numvouts=txmempool.vout.size())>0 && DecodeOraclesData(txmempool.vout[numvouts-1].scriptPubKey,oracletxid,btxid,pk,data) == 'D' && reforacletxid == oracletxid ) { if ( (formatstr= (char *)format.c_str()) == 0 ) formatstr = (char *)""; UniValue a(UniValue::VOBJ); - a.push_back(Pair("data",OracleFormat((uint8_t *)data.data(),(int32_t)data.size(),formatstr,(int32_t)format.size()))); - a.push_back(Pair("txid",uint256_str(str,batontxid))); + a.push_back(Pair("txid",hash.GetHex())); + a.push_back(Pair("data",OracleFormat((uint8_t *)data.data(),(int32_t)data.size(),formatstr,(int32_t)format.size()))); b.push_back(a); - batontxid = btxid; if ( ++n >= num && num != 0) break; - } else break; + } + } + SetCCtxids(addressIndex,batonaddr,true); + if (addressIndex.size()>0) + { + for (std::vector >::const_iterator it=addressIndex.end()-1; it!=addressIndex.begin(); it--) + { + txid=it->first.txhash; + vout = (int32_t)it->first.index; + nValue = (int64_t)it->second; + if (vout==1 && nValue==10000 && GetTransaction(txid,tx,hashBlock,false) != 0 && (numvouts=tx.vout.size()) > 0 ) + { + if ( DecodeOraclesData(tx.vout[numvouts-1].scriptPubKey,oracletxid,btxid,pk,data) == 'D' && reforacletxid == oracletxid ) + { + if ( (formatstr= (char *)format.c_str()) == 0 ) + formatstr = (char *)""; + UniValue a(UniValue::VOBJ); + a.push_back(Pair("txid",txid.GetHex())); + a.push_back(Pair("data",OracleFormat((uint8_t *)data.data(),(int32_t)data.size(),formatstr,(int32_t)format.size()))); + b.push_back(a); + if ( ++n >= num && num != 0) + break; + } + } + } } } } @@ -971,10 +1123,12 @@ UniValue OracleDataSamples(uint256 reforacletxid,uint256 batontxid,int32_t num) UniValue OracleInfo(uint256 origtxid) { UniValue result(UniValue::VOBJ),a(UniValue::VARR); - std::vector > unspentOutputs; + std::vector > unspentOutputs; int32_t height; CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight()); - CTransaction regtx,tx; std::string name,description,format; uint256 hashBlock,txid,oracletxid,batontxid; CPubKey pk; + CTransaction tx; std::string name,description,format; uint256 hashBlock,txid,oracletxid,batontxid; CPubKey pk; struct CCcontract_info *cp,C; int64_t datafee,funding; char str[67],markeraddr[64],numstr[64],batonaddr[64]; std::vector data; + std::map> publishers; + cp = CCinit(&C,EVAL_ORACLES); CCtxidaddr(markeraddr,origtxid); if ( GetTransaction(origtxid,tx,hashBlock,false) == 0 ) @@ -998,28 +1152,38 @@ UniValue OracleInfo(uint256 origtxid) for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) { txid = it->first.txhash; - if ( GetTransaction(txid,regtx,hashBlock,false) != 0 ) + height = (int32_t)it->second.blockHeight; + if ( GetTransaction(txid,tx,hashBlock,false) != 0 && tx.vout.size() > 0 && + DecodeOraclesOpRet(tx.vout[tx.vout.size()-1].scriptPubKey,oracletxid,pk,datafee) == 'R' && oracletxid == origtxid ) { - if ( regtx.vout.size() > 0 && DecodeOraclesOpRet(regtx.vout[regtx.vout.size()-1].scriptPubKey,oracletxid,pk,datafee) == 'R' && oracletxid == origtxid ) + if (publishers.find(pk)==publishers.end() || height>publishers[pk].second) { - UniValue obj(UniValue::VOBJ); - obj.push_back(Pair("publisher",pubkey33_str(str,(uint8_t *)pk.begin()))); - Getscriptaddress(batonaddr,regtx.vout[1].scriptPubKey); - batontxid = OracleBatonUtxo(10000,cp,oracletxid,batonaddr,pk,data); - obj.push_back(Pair("baton",batonaddr)); - obj.push_back(Pair("batontxid",uint256_str(str,batontxid))); - funding = LifetimeOraclesFunds(cp,oracletxid,pk); - sprintf(numstr,"%.8f",(double)funding/COIN); - obj.push_back(Pair("lifetime",numstr)); - funding = AddOracleInputs(cp,mtx,oracletxid,pk,0,0); - sprintf(numstr,"%.8f",(double)funding/COIN); - obj.push_back(Pair("funds",numstr)); - sprintf(numstr,"%.8f",(double)datafee/COIN); - obj.push_back(Pair("datafee",numstr)); - a.push_back(obj); + publishers[pk].first=txid; + publishers[pk].second=height; } } } + for (std::map>::iterator it = publishers.begin(); it != publishers.end(); ++it) + { + if ( GetTransaction(it->second.first,tx,hashBlock,false) != 0 && DecodeOraclesOpRet(tx.vout[tx.vout.size()-1].scriptPubKey,oracletxid,pk,datafee) == 'R') + { + UniValue obj(UniValue::VOBJ); + obj.push_back(Pair("publisher",pubkey33_str(str,(uint8_t *)pk.begin()))); + Getscriptaddress(batonaddr,tx.vout[1].scriptPubKey); + batontxid = OracleBatonUtxo(10000,cp,oracletxid,batonaddr,pk,data); + obj.push_back(Pair("baton",batonaddr)); + obj.push_back(Pair("batontxid",uint256_str(str,batontxid))); + funding = LifetimeOraclesFunds(cp,oracletxid,pk); + sprintf(numstr,"%.8f",(double)funding/COIN); + obj.push_back(Pair("lifetime",numstr)); + funding = AddOracleInputs(cp,mtx,oracletxid,pk,0,0); + sprintf(numstr,"%.8f",(double)funding/COIN); + obj.push_back(Pair("funds",numstr)); + sprintf(numstr,"%.8f",(double)datafee/COIN); + obj.push_back(Pair("datafee",numstr)); + a.push_back(obj); + } + } result.push_back(Pair("registered",a)); } } diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index e36e8b4c9..5d7fd6d74 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -456,6 +456,7 @@ static const CRPCCommand vRPCCommands[] = { "oracles", "oracleslist", &oracleslist, true }, { "oracles", "oraclesinfo", &oraclesinfo, true }, { "oracles", "oraclescreate", &oraclescreate, true }, + { "oracles", "oraclesfund", &oraclesfund, true }, { "oracles", "oraclesregister", &oraclesregister, true }, { "oracles", "oraclessubscribe", &oraclessubscribe, true }, { "oracles", "oraclesdata", &oraclesdata, true }, diff --git a/src/rpc/server.h b/src/rpc/server.h index b9fb33198..27e7288cd 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -267,6 +267,7 @@ extern UniValue oraclesaddress(const UniValue& params, bool fHelp); extern UniValue oracleslist(const UniValue& params, bool fHelp); extern UniValue oraclesinfo(const UniValue& params, bool fHelp); extern UniValue oraclescreate(const UniValue& params, bool fHelp); +extern UniValue oraclesfund(const UniValue& params, bool fHelp); extern UniValue oraclesregister(const UniValue& params, bool fHelp); extern UniValue oraclessubscribe(const UniValue& params, bool fHelp); extern UniValue oraclesdata(const UniValue& params, bool fHelp); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index e9a9e38c6..e6e66caf7 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -6760,6 +6760,26 @@ UniValue oraclesinfo(const UniValue& params, bool fHelp) return(OracleInfo(txid)); } +UniValue oraclesfund(const UniValue& params, bool fHelp) +{ + UniValue result(UniValue::VOBJ); uint256 txid; std::string hex; + if ( fHelp || params.size() != 1 ) + throw runtime_error("oraclesfund oracletxid\n"); + if ( ensure_CCrequirements(EVAL_ORACLES) < 0 ) + throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n"); + const CKeyStore& keystore = *pwalletMain; + LOCK2(cs_main, pwalletMain->cs_wallet); + txid = Parseuint256((char *)params[0].get_str().c_str()); + hex = OracleFund(0,txid); + RETURN_IF_ERROR(CCerror); + if ( hex.size() > 0 ) + { + result.push_back(Pair("result", "success")); + result.push_back(Pair("hex", hex)); + } else ERR_RESULT("couldnt fund with oracle txid"); + return(result); +} + UniValue oraclesregister(const UniValue& params, bool fHelp) { UniValue result(UniValue::VOBJ); uint256 txid; int64_t datafee; std::string hex; @@ -6806,17 +6826,17 @@ UniValue oraclessubscribe(const UniValue& params, bool fHelp) UniValue oraclessamples(const UniValue& params, bool fHelp) { - UniValue result(UniValue::VOBJ); uint256 txid,batontxid; int32_t num; + UniValue result(UniValue::VOBJ); uint256 txid; int32_t num; char *batonaddr; if ( fHelp || params.size() != 3 ) - throw runtime_error("oraclessamples oracletxid batonutxo num\n"); + throw runtime_error("oraclessamples oracletxid batonaddress num\n"); if ( ensure_CCrequirements(EVAL_ORACLES) < 0 ) throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n"); const CKeyStore& keystore = *pwalletMain; LOCK2(cs_main, pwalletMain->cs_wallet); txid = Parseuint256((char *)params[0].get_str().c_str()); - batontxid = Parseuint256((char *)params[1].get_str().c_str()); + batonaddr = (char *)params[1].get_str().c_str(); num = atoi((char *)params[2].get_str().c_str()); - return(OracleDataSamples(txid,batontxid,num)); + return(OracleDataSamples(txid,batonaddr,num)); } UniValue oraclesdata(const UniValue& params, bool fHelp) From b04b41e19d9547785ab15a06401a5c165bf02d81 Mon Sep 17 00:00:00 2001 From: smk762 <35845239+smk762@users.noreply.github.com> Date: Wed, 29 May 2019 16:41:15 +0800 Subject: [PATCH 07/65] Update cryptoconditions_oracles.py -change tests to use baton address instead of baton utxo -update samples results reference index -add test for oraclesfund -modify test loop flow to avoid spent utxo errors. Note: Successful test requires timestamp after July 15th 2019, or changing PUBKEY_SPOOFING_FIX_ACTIVATION value in oracles.cpp --- qa/rpc-tests/cryptoconditions_oracles.py | 121 +++++++++++++++-------- 1 file changed, 78 insertions(+), 43 deletions(-) diff --git a/qa/rpc-tests/cryptoconditions_oracles.py b/qa/rpc-tests/cryptoconditions_oracles.py index 953df5ca9..1db33bef7 100755 --- a/qa/rpc-tests/cryptoconditions_oracles.py +++ b/qa/rpc-tests/cryptoconditions_oracles.py @@ -3,7 +3,6 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. - from test_framework.test_framework import CryptoconditionsTestFramework from test_framework.authproxy import JSONRPCException from test_framework.util import assert_equal, assert_greater_than, \ @@ -11,13 +10,11 @@ from test_framework.util import assert_equal, assert_greater_than, \ stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises from cryptoconditions import assert_success, assert_error, generate_random_string - class CryptoconditionsOraclesTest(CryptoconditionsTestFramework): def run_oracles_tests(self): rpc = self.nodes[0] rpc1 = self.nodes[1] - result = rpc1.oraclesaddress() result = rpc.oraclesaddress() @@ -54,159 +51,197 @@ class CryptoconditionsOraclesTest(CryptoconditionsTestFramework): too_long_description = generate_random_string(4100) result = rpc.oraclescreate("Test", too_long_description, "s") assert_error(result) + + # need uxtos to create oracle? Crashes if without generate + rpc.generate(2) + # valid creating oracles of different types # using such naming to re-use it for data publishing / reading (e.g. oracle_s for s type) + valid_formats = ["s", "S", "d", "D", "c", "C", "t", "T", "i", "I", "l", "L", "h", "Ihh"] for f in valid_formats: - result = rpc.oraclescreate("Test", "Test", f) + result = rpc.oraclescreate("Test_"+f, "Test_"+f, f) assert_success(result) globals()["oracle_{}".format(f)] = self.send_and_mine(result['hex'], rpc) # trying to register with negative datafee - for f in valid_formats: result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "-100") assert_error(result) # trying to register with zero datafee - for f in valid_formats: result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "0") assert_error(result) # trying to register with datafee less than txfee - for f in valid_formats: result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "500") assert_error(result) - # trying to register valid - for f in valid_formats: + # trying to register valid (unfunded) result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "10000") + assert_error(result) + + # Fund the oracles + result = rpc.oraclesfund(globals()["oracle_{}".format(f)]) + assert_success(result) + fund_txid = self.send_and_mine(result["hex"], rpc) + assert fund_txid, "got txid" + + # trying to register valid (funded) + result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "10000") + print(f) assert_success(result) register_txid = self.send_and_mine(result["hex"], rpc) assert register_txid, "got txid" # TODO: for most of the non valid oraclesregister and oraclessubscribe transactions generating and broadcasting now # so trying only valid oraclessubscribe atm - for f in valid_formats: result = rpc.oraclessubscribe(globals()["oracle_{}".format(f)], self.pubkey, "1") assert_success(result) subscribe_txid = self.send_and_mine(result["hex"], rpc) assert register_txid, "got txid" + rpc.generate(1) + # now lets publish and read valid data for each oracle type # s type result = rpc.oraclesdata(globals()["oracle_{}".format("s")], "05416e746f6e") assert_success(result) - # baton - oraclesdata_s = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("s")], oraclesdata_s, "1") - assert_equal("[u'Anton']", str(result["samples"][0]), "Data match") + oraclesdata_s = self.send_and_mine(result["hex"], rpc) + info = rpc.oraclesinfo(globals()["oracle_{}".format("s")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("s")], batonaddr, "1") + assert_equal("[u'Anton']", str(result["samples"][0]['data']), "Data match") # S type result = rpc.oraclesdata(globals()["oracle_{}".format("S")], "000161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161") assert_success(result) - # baton oraclesdata_S = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("S")], oraclesdata_S, "1") - assert_equal("[u'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("S")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("S")], batonaddr, "1") + assert_equal("[u'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa']", str(result["samples"][0]['data']), "Data match") # d type result = rpc.oraclesdata(globals()["oracle_{}".format("d")], "0101") assert_success(result) # baton oraclesdata_d = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("d")], oraclesdata_d, "1") - assert_equal("[u'01']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("d")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("d")], batonaddr, "1") + assert_equal("[u'01']", str(result["samples"][0]['data']), "Data match") # D type result = rpc.oraclesdata(globals()["oracle_{}".format("D")], "010001") assert_success(result) # baton oraclesdata_D = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("D")], oraclesdata_D, "1") - assert_equal("[u'01']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("D")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("D")], batonaddr, "1") + assert_equal("[u'01']", str(result["samples"][0]['data']), "Data match") # c type result = rpc.oraclesdata(globals()["oracle_{}".format("c")], "ff") assert_success(result) # baton oraclesdata_c = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("c")], oraclesdata_c, "1") - assert_equal("[u'-1']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("c")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("c")], batonaddr, "1") + assert_equal("[u'-1']", str(result["samples"][0]['data']), "Data match") # C type result = rpc.oraclesdata(globals()["oracle_{}".format("C")], "ff") assert_success(result) # baton oraclesdata_C = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("C")], oraclesdata_C, "1") - assert_equal("[u'255']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("C")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("C")], batonaddr, "1") + assert_equal("[u'255']", str(result["samples"][0]['data']), "Data match") # t type result = rpc.oraclesdata(globals()["oracle_{}".format("t")], "ffff") assert_success(result) # baton oraclesdata_t = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("t")], oraclesdata_t, "1") - assert_equal("[u'-1']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("t")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("t")], batonaddr, "1") + assert_equal("[u'-1']", str(result["samples"][0]['data']), "Data match") # T type result = rpc.oraclesdata(globals()["oracle_{}".format("T")], "ffff") assert_success(result) # baton oraclesdata_T = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("T")], oraclesdata_T, "1") - assert_equal("[u'65535']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("T")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("T")], batonaddr, "1") + assert_equal("[u'65535']", str(result["samples"][0]['data']), "Data match") # i type result = rpc.oraclesdata(globals()["oracle_{}".format("i")], "ffffffff") assert_success(result) # baton oraclesdata_i = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("i")], oraclesdata_i, "1") - assert_equal("[u'-1']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("i")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("i")], batonaddr, "1") + assert_equal("[u'-1']", str(result["samples"][0]['data']), "Data match") # I type result = rpc.oraclesdata(globals()["oracle_{}".format("I")], "ffffffff") assert_success(result) # baton oraclesdata_I = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("I")], oraclesdata_I, "1") - assert_equal("[u'4294967295']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("I")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("I")], batonaddr, "1") + assert_equal("[u'4294967295']", str(result["samples"][0]['data']), "Data match") # l type result = rpc.oraclesdata(globals()["oracle_{}".format("l")], "00000000ffffffff") assert_success(result) # baton oraclesdata_l = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("l")], oraclesdata_l, "1") - # TODO: working not correct now! - #assert_equal("[u'-4294967296']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("l")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("l")], batonaddr, "1") + assert_equal("[u'-4294967296']", str(result["samples"][0]['data']), "Data match") # L type result = rpc.oraclesdata(globals()["oracle_{}".format("L")], "00000000ffffffff") assert_success(result) # baton oraclesdata_L = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("L")], oraclesdata_L, "1") - assert_equal("[u'18446744069414584320']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("L")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("L")], batonaddr, "1") + assert_equal("[u'18446744069414584320']", str(result["samples"][0]['data']), "Data match") # h type result = rpc.oraclesdata(globals()["oracle_{}".format("h")], "00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff") assert_success(result) # baton oraclesdata_h = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("h")], oraclesdata_h, "1") - assert_equal("[u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000']", str(result["samples"][0]), "Data match") + info = rpc.oraclesinfo(globals()["oracle_{}".format("h")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("h")], batonaddr, "1") + assert_equal("[u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000']", str(result["samples"][0]['data']), "Data match") # Ihh type result = rpc.oraclesdata(globals()["oracle_{}".format("Ihh")], "ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff") assert_success(result) # baton oraclesdata_Ihh = self.send_and_mine(result["hex"], rpc) - result = rpc.oraclessamples(globals()["oracle_{}".format("Ihh")], oraclesdata_Ihh, "1") - assert_equal("[u'4294967295', u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000', u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000']", str(result["samples"][0]), "Data match") - + info = rpc.oraclesinfo(globals()["oracle_{}".format("Ihh")]) + batonaddr = info['registered'][0]['baton'] + result = rpc.oraclessamples(globals()["oracle_{}".format("Ihh")], batonaddr, "1") + print(result) + assert_equal("[u'4294967295', u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000', u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000']", str(result["samples"][0]['data']), "Data match") def run_test(self): print("Mining blocks...") From 9a5de83ebc486053aed16db8011f60e66fcf84fe Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Wed, 29 May 2019 23:14:15 +0300 Subject: [PATCH 08/65] sort64 / revsort64s has void return-type --- src/cc/crypto777/OS_portable.h | 4 ++-- src/komodo_gateway.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cc/crypto777/OS_portable.h b/src/cc/crypto777/OS_portable.h index d6abc98c5..aeb45bc32 100755 --- a/src/cc/crypto777/OS_portable.h +++ b/src/cc/crypto777/OS_portable.h @@ -309,8 +309,8 @@ char *uppercase_str(char *buf,char *str); char *lowercase_str(char *buf,char *str); int32_t strsearch(char *strs[],int32_t num,char *name); int32_t OS_getline(int32_t waitflag,char *line,int32_t max,char *dispstr); -int32_t sort64s(uint64_t *buf,uint32_t num,int32_t size); -int32_t revsort64s(uint64_t *buf,uint32_t num,int32_t size); +void sort64s(uint64_t *buf,uint32_t num,int32_t size); +void revsort64s(uint64_t *buf,uint32_t num,int32_t size); int decode_base32(uint8_t *token,uint8_t *tokenstr,int32_t len); int init_base32(char *tokenstr,uint8_t *token,int32_t len); char *OS_mvstr(); diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 1455c34b3..7cfe870b4 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -2597,7 +2597,7 @@ static int cmp_llu(const void *a, const void*b) else return(1); } -static int64_t sort64(int64_t *l, int32_t llen) +static void sort64(int64_t *l, int32_t llen) { qsort(l,llen,sizeof(uint64_t),cmp_llu); } @@ -2611,7 +2611,7 @@ static int revcmp_llu(const void *a, const void*b) else return(1); } -static int64_t revsort64(int64_t *l, int32_t llen) +static void revsort64(int64_t *l, int32_t llen) { qsort(l,llen,sizeof(uint64_t),revcmp_llu); } From 33a0059a18d416a4ee7695381bbca755a018a8c1 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Thu, 30 May 2019 00:11:50 +0300 Subject: [PATCH 09/65] gcc-8: fix komodo_connectblock reaches end of non-void function error --- src/komodo.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index cd7c6573a..4de6ee4f3 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -803,7 +803,10 @@ int32_t komodo_notarycmp(uint8_t *scriptPubKey,int32_t scriptlen,uint8_t pubkeys return(-1); } -// int32_t ! +// int32_t (!!!) +/* + read blackjok3rtt comments in main.cpp +*/ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block) { static int32_t hwmheight; @@ -897,8 +900,8 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block) } numvalid = bitweight(signedmask); if ( ((height < 90000 || (signedmask & 1) != 0) && numvalid >= KOMODO_MINRATIFY) || - (numvalid >= KOMODO_MINRATIFY && ASSETCHAINS_SYMBOL[0] != 0) || - numvalid > (numnotaries/5) ) + (numvalid >= KOMODO_MINRATIFY && ASSETCHAINS_SYMBOL[0] != 0) || + numvalid > (numnotaries/5) ) { if ( !fJustCheck && ASSETCHAINS_SYMBOL[0] != 0) { @@ -918,7 +921,7 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block) fflush(signedfp); } transaction = i; - printf("[%s] ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d <<<<<<<<<<< notarized\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts); + printf("[%s] ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d <<<<<<<<<<< notarized\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts); } notarized = 1; } @@ -1014,7 +1017,9 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block) printf("%s ht.%d\n",ASSETCHAINS_SYMBOL[0] == 0 ? "KMD" : ASSETCHAINS_SYMBOL,height); if ( !fJustCheck && pindex->GetHeight() == hwmheight ) komodo_stateupdate(height,0,0,0,zero,0,0,0,0,height,(uint32_t)pindex->nTime,0,0,0,0,zero,0); - } else fprintf(stderr,"komodo_connectblock: unexpected null pindex\n"); + } + else + { fprintf(stderr,"komodo_connectblock: unexpected null pindex\n"); return(0); } //KOMODO_INITDONE = (uint32_t)time(NULL); //fprintf(stderr,"%s end connect.%d\n",ASSETCHAINS_SYMBOL,pindex->GetHeight()); if (fJustCheck) @@ -1025,6 +1030,12 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block) return(1); if ( notarisations.size() > 1 || (notarisations.size() == 1 && notarisations[0] != 1) ) return(-1); + + fprintf(stderr,"komodo_connectblock: unxexpected behaviour when fJustCheck == true, report blackjok3rtt plz ! \n"); + /* this needed by gcc-8, it counts here that control reaches end of non-void function without this. + by default, we count that if control reached here -> the valid notarization isnt in position 1 or there are too many notarizations in this block. + */ + return(-1); } else return(0); } From 4f989b26ebf76a424ed9df4f78e24205c0168aef Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Thu, 30 May 2019 00:23:38 +0300 Subject: [PATCH 10/65] fix notarisationTx type --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index c14e4351d..a8ae8b60c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3392,7 +3392,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin { // do a full block scan to get notarisation position and to enforce a valid notarization is in position 1. // if notarisation in the block, must be position 1 and the coinbase must pay notaries. - int notarisationTx = komodo_connectblock(true,pindex,*(CBlock *)&block); + int32_t notarisationTx = komodo_connectblock(true,pindex,*(CBlock *)&block); // -1 means that the valid notarization isnt in position 1 or there are too many notarizations in this block. if ( notarisationTx == -1 ) return state.DoS(100, error("ConnectBlock(): Notarization is not in TX position 1 or block contains more than 1 notarization! Invalid Block!"), From 8c9fc38a928cbd21b9034dd9a12fa07a5cc0ce73 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Thu, 30 May 2019 21:19:15 +0800 Subject: [PATCH 11/65] fix --- src/cc/makecclib | 5 ----- src/cc/makerogue | 3 +++ zcutil/build.sh | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/cc/makecclib b/src/cc/makecclib index 0d82463c4..e4816c55c 100755 --- a/src/cc/makecclib +++ b/src/cc/makecclib @@ -7,11 +7,6 @@ make -f Makefile_rogue rm ../libcc.so cp librogue.so ../libcc.so -if [ "${LABS_FLAGS}" = "ENABLE_LABS" ] -then - exit -fi - echo sudoku/musig/dilithium gcc -O3 -std=c++11 -I../secp256k1/include -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c -o sudokucc.so cclib.cpp diff --git a/src/cc/makerogue b/src/cc/makerogue index ff16cbb16..a389ba2dd 100755 --- a/src/cc/makerogue +++ b/src/cc/makerogue @@ -35,3 +35,6 @@ else echo ROGUE BUILD FAILED exit 1 fi + +rm ../libcc.so +cp librogue.so ../libcc.so diff --git a/zcutil/build.sh b/zcutil/build.sh index dc4d027b1..df3dfa234 100755 --- a/zcutil/build.sh +++ b/zcutil/build.sh @@ -106,7 +106,7 @@ CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$HARDENING_ARG" WD=$PWD cd src/cc echo $PWD -./makecclib +./makerogue cd $WD "$MAKE" "$@" V=1 From 5e6d7bad4b8f47aed3eac35c68665a17a789a1a2 Mon Sep 17 00:00:00 2001 From: ca333 Date: Fri, 31 May 2019 03:11:54 +0200 Subject: [PATCH 12/65] fix OSX this fixes the faulty OSX patch --- src/cc/Makefile_rogue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/Makefile_rogue b/src/cc/Makefile_rogue index baf8767aa..3b2f65e00 100644 --- a/src/cc/Makefile_rogue +++ b/src/cc/Makefile_rogue @@ -1,6 +1,6 @@ SHELL = /bin/sh CC = gcc -CC_DARWIN = g++-6 +CC_DARWIN = g++-8 CC_WIN = x86_64-w64-mingw32-gcc-posix CFLAGS_DARWIN = -DBUILD_ROGUE -std=c++11 -arch x86_64 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -Wl,-undefined -Wl,dynamic_lookup -Wno-write-strings -shared -dynamiclib CFLAGS = -Wno-write-strings -DBUILD_ROGUE -std=c++11 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared @@ -14,7 +14,7 @@ TARGET = librogue.so TARGET_DARWIN = librogue.dylib TARGET_WIN = librogue.dll SOURCES = cclib.cpp -#HEADERS = $(shell echo ../cryptoconditions/include/*.h) -I/usr/local/Cellar/gcc\@6/6.4.0_2/include/c++/6.4.0/ +#HEADERS = $(shell echo ../cryptoconditions/include/*.h) -I/usr/local/Cellar/gcc\@8/8.3.0/include/c++/8.3.0/ all: $(TARGET) From 43d3043d34e08eb631938e1826da489ef74ae304 Mon Sep 17 00:00:00 2001 From: ca333 Date: Fri, 31 May 2019 03:12:33 +0200 Subject: [PATCH 13/65] fix OSX this fixes the faulty OSX patch --- depends/hosts/darwin.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index d01e8b5a3..7be744aeb 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,9 +1,9 @@ -OSX_MIN_VERSION=10.8 -OSX_SDK_VERSION=10.11 +OSX_MIN_VERSION=10.12 +OSX_SDK_VERSION=10.12 OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk LD64_VERSION=253.9 -darwin_CC=gcc-6 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -darwin_CXX=g++-6 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) +darwin_CC=gcc-8 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) +darwin_CXX=g++-8 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) darwin_CFLAGS=-pipe darwin_CXXFLAGS=$(darwin_CFLAGS) From 2d5a95ca8886e4650e33dea861347aa57a46ce45 Mon Sep 17 00:00:00 2001 From: ca333 Date: Fri, 31 May 2019 03:12:58 +0200 Subject: [PATCH 14/65] fix OSX --- zcutil/build-mac.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zcutil/build-mac.sh b/zcutil/build-mac.sh index 5f1817e9e..89847ddac 100755 --- a/zcutil/build-mac.sh +++ b/zcutil/build-mac.sh @@ -1,6 +1,6 @@ #!/bin/bash -export CC=gcc-6 -export CXX=g++-6 +export CC=gcc-8 +export CXX=g++-8 export LIBTOOL=libtool export AR=ar export RANLIB=ranlib @@ -52,7 +52,7 @@ cd $WD ./autogen.sh CPPFLAGS="-I$PREFIX/include -arch x86_64" LDFLAGS="-L$PREFIX/lib -arch x86_64 -Wl,-no_pie" \ -CXXFLAGS='-arch x86_64 -I/usr/local/Cellar/gcc\@6/6.4.0_2/include/c++/6.4.0/ -I$PREFIX/include -fwrapv -fno-strict-aliasing -Wno-builtin-declaration-mismatch -Werror -g -Wl,-undefined -Wl,dynamic_lookup' \ +CXXFLAGS='-arch x86_64 -I/usr/local/Cellar/gcc\@8/8.3.0/include/c++/8.3.0/ -I$PREFIX/include -fwrapv -fno-strict-aliasing -Wno-builtin-declaration-mismatch -Werror -g -Wl,-undefined -Wl,dynamic_lookup' \ ./configure --prefix="${PREFIX}" --with-gui=no "$HARDENING_ARG" "$LCOV_ARG" make "$@" V=1 NO_GTEST=1 STATIC=1 From df7f46285ae0525bbfbb00da481033cd8b836756 Mon Sep 17 00:00:00 2001 From: ca333 Date: Fri, 31 May 2019 03:14:38 +0200 Subject: [PATCH 15/65] fix OSX --- toolchain-info.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain-info.sh b/toolchain-info.sh index 0bb39c19b..6a0fc7e75 100755 --- a/toolchain-info.sh +++ b/toolchain-info.sh @@ -1,6 +1,6 @@ #!/bin/bash -tools=("gcc-6" "g++-6" "otool" "nm") +tools=("gcc-8" "g++-8" "otool" "nm") echo "Platform: `uname -a`" echo "-------------------------------------" From 01fb676782b5a0c26ca165c49ce5b2690d73f670 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Fri, 31 May 2019 10:53:02 +0200 Subject: [PATCH 16/65] Allow duplicate receivers in z_sendmany --- src/wallet/rpcwallet.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index e9a9e38c6..ffec43355 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4353,8 +4353,9 @@ UniValue z_sendmany(const UniValue& params, bool fHelp) //else if ( ASSETCHAINS_PRIVATE != 0 && komodo_isnotaryvout((char *)address.c_str()) == 0 ) // throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "cant use transparent addresses in private chain"); - if (setAddress.count(address)) - throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+address); + // Allowing duplicate receivers helps various HushList protocol operations + //if (setAddress.count(address)) + // throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+address); setAddress.insert(address); UniValue memoValue = find_value(o, "memo"); From f5d4ff421e035592a21cff2f42811652bb2cfe64 Mon Sep 17 00:00:00 2001 From: Mihail Fedorov Date: Mon, 3 Jun 2019 02:04:54 +0300 Subject: [PATCH 17/65] Notaries 2019 --- src/komodo_defs.h | 66 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/komodo_defs.h b/src/komodo_defs.h index cf15f0b19..656c20c53 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -178,6 +178,72 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"webworker01_NA", "03bb7d005e052779b1586f071834c5facbb83470094cff5112f0072b64989f97d7" }, {"xrobesx_NA", "03f0cc6d142d14a40937f12dbd99dbd9021328f45759e26f1877f2a838876709e1" }, }, + { + {"madmax_NA", "02016371f90f195ed9aeaf37be06f3fbbfbfe2ef8a4fd66378378289476e7751db", "03489b67faabdf450c9661ca386ba8a65eca859f39b3ec4c7a6be40c9c7bf153b7" }, + {"alright_AR", "020566fe2fb3874258b2d3cf1809a5d650e0edc7ba746fa5eec72750c5188c9cc9", "036a6bca1c2a8166f79fa8a979662892742346cc972b432f8e61950a358d705517" }, + {"strob_NA", "0206f7a2e972d9dfef1c424c731503a0a27de1ba7a15a91a362dc7ec0d0fb47685", "02049202f3872877e81035549f6f3a0f868d0ad1c9b0e0d2b48b1f30324255d26d" }, + {"dwy_EU", "020a77f454a1d3fcdc0312048fc58d713fe6153189e0c59cdd12fedbf09553d4b0", "021a7e11182f3603720436daea4e9a2ad5a9990943f0c96d6bcb5d7823040317fa" }, + {"phm87_SH", "021773a38db1bc3ede7f28142f901a161c7b7737875edbb40082a201c55dcf0add", "03889a10f9df2caef57220628515693cf25316fe1b0693b0241419e75d0d0e66ed" }, + {"chainmakers_NA", "021ad488cc063e17d0f1a2aade6be65ef8b5ff879987cb0b86bb700733099fe524", "0369aa258f317f028afd3acbe74658c4b483b7e0069107c5885ac49128dd18a13d" }, + {"indenodes_EU", "0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c", "03a416533cace0814455a1bb1cd7861ce825a543c6f6284a432c4c8d8875b7ace9" }, + {"blackjok3r_SH", "0226293d7644e1380555ecc2d385ba038a66f4202b24b643ab31bcad0dc1474de2", "03c90bee400010904acb42464807feb0039ab42cc86d5401222299280b876b52e3" }, + {"chainmakers_EU", "022a6b583e8820d14d911a11820fd80853c5b8406e91a0a6fcac1f133d098d75cb", "034a6ae969bbd13258f9b7d3bbbdb81c93f2914d3fdb01ce31ad1d2a9078ef5fcd" }, + {"titomane_AR", "023e3aa9834c46971ff3e7cb86a200ec9c8074a9566a3ea85d400d5739662ee989", "0358cd6d7460654a0ddd5125dd6fa0402d0719999444c6cc3888689a0b4446136a" }, + {"fullmoon_SH", "02639998420688ee935d279d1cd52f1c6f3ae12c1f3afc20b3bf7ece1057f8b93b", "0370f07837cfefe1542f030b80e8fffa57218f4b7fff2dd181b0e21700c5480a7b" }, // 10 + {"indenodes_NA", "02698c6f1c9e43b66e82dbb163e8df0e5a2f62f3a7a882ca387d82f86e0b3fa988", "02b3908eda4078f0e9b6704451cdc24d418e899c0f515fab338d7494da6f0a647b" }, + {"chmex_EU", "0281304ebbcc39e4f09fda85f4232dd8dacd668e20e5fc11fba6b985186c90086e", "03e5b7ab96b7271ecd585d6f22807fa87da374210a843ec3a90134cbf4a62c3db1" }, + {"metaphilibert_SH", "0284af1a5ef01503e6316a2ca4abf8423a794e9fc17ac6846f042b6f4adedc3309", "03b21ff042bf1730b28bde43f44c064578b41996117ac7634b567c3773089e3be3" }, + {"ca333_DEV", "02856843af2d9457b5b1c907068bef6077ea0904cc8bd4df1ced013f64bf267958", "029c0342ce2a4f9146c7d1ee012b26f5c2df78b507fb4461bf48df71b4e3031b56" }, + {"cipi_NA", "02858904a2a1a0b44df4c937b65ee1f5b66186ab87a751858cf270dee1d5031f18", "034406ac4cf94e84561c5d3f25384dd59145e92fefc5972a037dc6a44bfa286688" }, + {"pungocloud_SH", "02863628f842a8aa424daf745cf43a1717cfcd571338ba87bfcec4d340703d01d6", "03f42c8052decf9a9d2eba60b1c8cd8b2b8e858d6b1ef0e5f09ba8a9ac1b1ced62" }, + {"voskcoin_EU", "028cfb0bbce2207425bc8d40fff634269bb61aade2d1d03883398275550b465600", "037135718fa54e59bcb71f9f9e9c4ab43daa86be50dbaadce10bc176a4f611d546" }, + {"decker_DEV", "028eea44a09674dda00d88ffd199a09c9b75ba9782382cc8f1e97c0fd565fe5707", "02fca8ee50e49f480de275745618db7b0b3680b0bdcce7dcae7d2e0fd5c3345744" }, + {"cryptoeconomy_EU", "0290ab4937e85246e048552df3e9a66cba2c1602db76e03763e16c671e750145d1", "037d04b7d16de61a44a3fc766bea4b7791023a36675d6cee862fe53defd04dd8f2" }, + {"etszombi_EU", "0293ea48d8841af7a419a24d9da11c34b39127ef041f847651bae6ab14dcd1f6b4", "02f65da26061d1b9f1756a274918a37e83086dbfe9a43d2f0b35b9d2f593b31907" }, // 20 + {"karasugoi_NA", "02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982", "024ba10f7f5325fd6ec6cab50c5242d142d00fab3537c0002097c0e98f72014177" }, + {"pirate_AR", "02a5e865af771eee0c6bd3bd238f01f5eb589907ba52efa9f37e5102375c8eb7a0", "0228431427395f0cefdb0d10402d0d726119508945eb66ca9c0bba5d64df79832c" }, + {"metaphilibert_AR", "02adad675fae12b25fdd0f57250b0caf7f795c43f346153a31fe3e72e7db1d6ac6", "0239e34ad22957bbf4c8df824401f237b2afe8d40f7a645ecd43e8f27dde1ab0da" }, + {"zatjum_SH", "02b315714f99fdd70bafd50a4c3aa4b9db0fd8d63978bd8d47763773400b28734c", "031675aae243d2e4f3e8b67dbc4a68f50f487a37df959d739b26a80ce917b10d84" }, + {"madmax_AR", "02b37913ac0250d17cca5bb94ef65928b1515f13f839075446db73b9b067c13aa0", "032f5fc01607c2e82417cfe822b981116262961c0a66f715fbb7e84614aadfe5df" }, + {"lukechilds_NA", "02c191a085bbb0bd86d126c62d3e801c503038b69c0c2de121c9a7abe3e6684420", "03dbda3ea207b1aca24803fa53f990402b0bea9ec6bdc4486d9878add7623faf35" }, + {"cipi_AR", "02c4f89a5b382750836cb787880d30e23502265054e1c327a5bfce67116d757ce8", "025b7655826f5fd3a807cbb4918ef9f02fe64661153ca170db981e9b0861f8c5ad" }, + {"tonyl_AR", "02cc8bc862f2b65ad4f99d5f68d3011c138bf517acdc8d4261166b0be8f64189e1", "03a8db38075c80348889871b4318b0a79a1fd7e9e21daefb4ca6e4f05e5963569c" }, + {"infotech_DEV", "02d7d63ac441dbcd5535bcad741701519c190e89e17e4180aa0f61fdda0b6195ea", "032a8265e3c5029d17bbb5a46da81aedd81dad74c152a21568ef082d3d497dcada" }, + {"fullmoon_NA", "02da228a67e519b21bca6426ed982509a21d24d45f1ac1bdf698b6083fed442ec3", "0291038301dea2ec683a3f686579dcebe37b2113cc6137ef0bfe87b505bcd16016" }, // 30 + {"etszombi_AR", "02e55e104aa94f70cde68165d7df3e162d4410c76afd4643b161dea044aa6d06ce", "03c786702b81e0122157739c8e2377cf945998d36c0d187ec5c5ff95855848dfdd" }, + {"node-9_EU", "02e90f0528f8fd7d2b7f28d53ed7368cc4b1dfc5814c70c486c533862ee05e37dc", "03a48773670b53e7d139182e1be70b8b3deeb38298af1950f7f9e9061a78156032" }, + {"phba2061_EU", "02eaa599f5434039adc5748b3b830f605342e11b51273046b04f24acc5bcecc74a", "03f1bc7f22f3895069ba11442f8868211dd5953105dd6a65862775c8f033535f32" }, + {"indenodes_AR", "02ec0fa5a40f47fd4a38ea5c89e375ad0b6ddf4807c99733c9c3dc15fb978ee147", "0242778789986d614f75bcf629081651b851a12ab1cc10c73995b27b90febb75a2" }, + {"and1-89_EU", "02f2af778c62888cfb106c0ef5c89cefe012ef3e6abed3ef28425092637d7ae3cc", "02bca5e635c2d1c3506510c3c662e317636e41495688fa8f37cff42737fe048565" }, + {"komodopioneers_SH", "02ffde73d51b56bf9e23b6f03008ac7916cacd3be090f44eab59877792e08b6751", "02805ef7a915c90d0719d83f1287b9509c481be735d019df212b71002a21bb860f" }, + {"komodopioneers_EU", "03014f3fceb9f851f9dba5f5b371c7758b3f1fe44a70b4e60e3d6c70d1e5265358", "0222a74c839d67346250b953a790abcb3d92cb5187f1c25f02d193f8d10d04ed64" }, + {"d0ct0r_NA", "0303725d8525b6f969122faf04152653eb4bf34e10de92182263321769c334bf58", "0235b211469d7c1881d30ab647e0d6ddb4daf9466f60e85e6a33a92e39dedde3a7" }, + {"kolo_DEV", "030f34af4b908fb8eb2099accb56b8d157d49f6cfb691baa80fdd34f385efed961", "0292cec4c966787ebd436bc2af6fc375a8292b6d368385ce717f27fac64c1a9ed4" }, + {"peer2cloud_AR", "030fe3c77db0f91d79c26f951b674bba557b899f16570cd75332829a07031b0097", "03e63fbeff5db594b6903128b38630abc1b89bb1995ef76d0f5f5b7f88f473df78" }, // 40 + {"webworker01_SH", "031e50ba6de3c16f99d414bb89866e578d963a54bde7916c810608966fb5700776", "0221365d89a6f6373b15daa4a50d56d34ad1b4b8a48a7fd090163b6b5a5ecd7a0a" }, + {"webworker01_NA", "032735e9cad1bb00eaababfa6d27864fa4c1db0300c85e01e52176be2ca6a243ce", "03bfc36a60194b495c075b89995f307bec68c1bcbe381b6b29db47af23494430f9" }, + {"pbca26_NA", "0331c51abb78a9891d1b9483747a7fd9bbbbdd5256f40af23c87384e3d9a974289", "0371bf57314b24a0e4dfc31e8df83fb76231173912d962172600a5c395d59312f3" }, + {"indenodes_SH", "0334e6e1ec8285c4b85bd6dae67e17d67d1f20e7328efad17ce6fd24ae97cdd65e", "031d1584cf0eb4a2d314465e49e2677226b1615c3718013b8d6b4854c15676a58c" }, + {"pirate_NA", "033c8cef71f704f357c9ac1aeaafde3acd7bbfd0a09494e5e129ee0999fb2bc368", "035f1d94fd43ce3bf334c493cab29ab0635f75704650aaadb1d476a2bb3d74f34f" }, + {"lukechilds_AR", "035004d780316008c8afd5ac28d08aae56f4746bf70eb2c999e3c7d9a7a50ca8b6", "02b1a3fb6e47f566f96efc4dcd450abe370692806dff9090c24733c46728e9a342" }, + {"dragonhound_NA", "0354c779b9b111fdc825ee0250b33a79a837e0775a111a89916853d02a8999285c", "03c0d07f0b9932d5db003fe047e328f2bfd61fc24e19db79ef9471efd10ea4c102" }, + {"fullmoon_AR", "035673e913d603137f7f517d88bf316e51d408e0ec2b2cdcbfbdd5c0b553fc9351", "022e316df71f51f2bda83318aaeaebe7a12514429e85ba4f5402b1478c6d7873a4" }, + {"chainzilla_SH", "0360804b8817fd25ded6e9c0b50e3b0782ac666545b5416644198e18bc3903d9f9", "03fe36ff13cb224217898682ce8b87ba6e3cdd4a98941bb7060c04508b57a6b014" }, + {"titomane_EU", "03772ac0aad6b0e9feec5e591bff5de6775d6132e888633e73d3ba896bdd8e0afb", "03d691cd0914a711f651082e2b7b27bee778c1309a38840e40a6cf650682d17bb5" }, // 50 + {"jeezy_EU", "037f182facbad35684a6e960699f5da4ba89e99f0d0d62a87e8400dd086c8e5dd7", "022bca828b572cb2b3daff713ed2eb0bbc7378df20f799191eebecf3ef319509cd" }, + {"titomane_SH", "03850fdddf2413b51790daf51dd30823addb37313c8854b508ea6228205047ef9b", "038c2a64f7647633c0e74eec93f9a668d4bf80214a43ed7cd08e4e30d3f2f7acfb" }, + {"alien_AR", "03911a60395801082194b6834244fa78a3c30ff3e888667498e157b4aa80b0a65f", "024f20c096b085308e21893383f44b4faf1cdedea9ad53cc7d7e7fbfa0c30c1e71" }, + {"pirate_EU", "03986339bebe3891e369a528356a220bc17a5bef3d337edfcf0114e66e6b1c120f", "0377d4ed0264ad80fea05b3cd68cb1700404c0c08981830ba8ffae56b944e2ee77" }, + {"thegaltmines_NA", "03b113c7aa1042c965154bf791713f562891ac75e60ab78886205535bcaabb5013", "022138be032da85227fde7d1d5cc665ea21ba3f149601e8c23db269750991bc0c3" }, + {"computergenie_NA", "03b41c764c8cd63b48b79f15f112a9b5105a0dce35df7d6990d6919503a1f3f245", "02e01fe2bc6fd6eeeda6e84fdd67647b94058ee4ffd090d3ac67fd546f8bced39a" }, + {"nutellalicka_SH", "03b422ec85a8465ae42e7004bc6d0856a458f0f920ec0f58fd4d5613994f3faa5b", "03c8220bb835791b875f4060ff2d40c2dcc9346cc3390c04f5e202d207a1980b59" }, + {"chainstrike_SH", "03b806be3bf7a1f2f6290ec5c1ea7d3ea57774dcfcf2129a82b2569e585100e1cb", "0221f9dee04b7da1f3833c6ea7f7325652c951b1c239052b0dadb57209084ca6a8" }, + {"dwy_SH", "03b9162f9713d7cddd89aaad0398b67f66377cc17547ec0643a67c2d6fb099ecf0", "02f221458f84a3cf918cae6ec7fe553eff20bbed9fc4289e75af69b69478ccf0a4" }, // 60 + {"alien_EU", "03bb749e337b9074465fa28e757b5aa92cb1f0fea1a39589bca91a602834d443cd", "022b85908191788f409506ebcf96a892f3274f352864c3ed566c5a16de63953236" }, + {"gt_AR", "03e22a6aad65c9a4c2ce2e724b26edf631b5f41253449dd5feaeba68e7c0cf3058", "038b4f509468bfe51937bdce3f4529702d806b0e8fd4f7c487235d06d9c1b411ef" }, + {"patchkez_SH", "03f45e9beb5c4cd46525db8195eb05c1db84ae7ef3603566b3d775770eba3b96ee", "03d7c187689bf829ca076a30bbf36d2e67bb74e16a3290d8a55df21d6cb15c80c1" }, + {"decker_AR", "03ffdf1a116300a78729608d9930742cd349f11a9d64fcc336b8f18592dd9c91bc", "02a85540db8d41c7e60bf0d33d1364b4151cad883dd032878ea4c037f67b769635" }, + }, { {"webworker01_NA", "03bb7d005e052779b1586f071834c5facbb83470094cff5112f0072b64989f97d7" } } From c62ddda360ab44527702d7029212e574fe0ffea4 Mon Sep 17 00:00:00 2001 From: Mihail Fedorov Date: Mon, 3 Jun 2019 17:36:28 +0300 Subject: [PATCH 18/65] Notaries 2019 --- src/komodo_defs.h | 131 ++++++++++++++++++++++------------------------ 1 file changed, 64 insertions(+), 67 deletions(-) diff --git a/src/komodo_defs.h b/src/komodo_defs.h index 656c20c53..b3e4d7ad2 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -179,73 +179,70 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"xrobesx_NA", "03f0cc6d142d14a40937f12dbd99dbd9021328f45759e26f1877f2a838876709e1" }, }, { - {"madmax_NA", "02016371f90f195ed9aeaf37be06f3fbbfbfe2ef8a4fd66378378289476e7751db", "03489b67faabdf450c9661ca386ba8a65eca859f39b3ec4c7a6be40c9c7bf153b7" }, - {"alright_AR", "020566fe2fb3874258b2d3cf1809a5d650e0edc7ba746fa5eec72750c5188c9cc9", "036a6bca1c2a8166f79fa8a979662892742346cc972b432f8e61950a358d705517" }, - {"strob_NA", "0206f7a2e972d9dfef1c424c731503a0a27de1ba7a15a91a362dc7ec0d0fb47685", "02049202f3872877e81035549f6f3a0f868d0ad1c9b0e0d2b48b1f30324255d26d" }, - {"dwy_EU", "020a77f454a1d3fcdc0312048fc58d713fe6153189e0c59cdd12fedbf09553d4b0", "021a7e11182f3603720436daea4e9a2ad5a9990943f0c96d6bcb5d7823040317fa" }, - {"phm87_SH", "021773a38db1bc3ede7f28142f901a161c7b7737875edbb40082a201c55dcf0add", "03889a10f9df2caef57220628515693cf25316fe1b0693b0241419e75d0d0e66ed" }, - {"chainmakers_NA", "021ad488cc063e17d0f1a2aade6be65ef8b5ff879987cb0b86bb700733099fe524", "0369aa258f317f028afd3acbe74658c4b483b7e0069107c5885ac49128dd18a13d" }, - {"indenodes_EU", "0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c", "03a416533cace0814455a1bb1cd7861ce825a543c6f6284a432c4c8d8875b7ace9" }, - {"blackjok3r_SH", "0226293d7644e1380555ecc2d385ba038a66f4202b24b643ab31bcad0dc1474de2", "03c90bee400010904acb42464807feb0039ab42cc86d5401222299280b876b52e3" }, - {"chainmakers_EU", "022a6b583e8820d14d911a11820fd80853c5b8406e91a0a6fcac1f133d098d75cb", "034a6ae969bbd13258f9b7d3bbbdb81c93f2914d3fdb01ce31ad1d2a9078ef5fcd" }, - {"titomane_AR", "023e3aa9834c46971ff3e7cb86a200ec9c8074a9566a3ea85d400d5739662ee989", "0358cd6d7460654a0ddd5125dd6fa0402d0719999444c6cc3888689a0b4446136a" }, - {"fullmoon_SH", "02639998420688ee935d279d1cd52f1c6f3ae12c1f3afc20b3bf7ece1057f8b93b", "0370f07837cfefe1542f030b80e8fffa57218f4b7fff2dd181b0e21700c5480a7b" }, // 10 - {"indenodes_NA", "02698c6f1c9e43b66e82dbb163e8df0e5a2f62f3a7a882ca387d82f86e0b3fa988", "02b3908eda4078f0e9b6704451cdc24d418e899c0f515fab338d7494da6f0a647b" }, - {"chmex_EU", "0281304ebbcc39e4f09fda85f4232dd8dacd668e20e5fc11fba6b985186c90086e", "03e5b7ab96b7271ecd585d6f22807fa87da374210a843ec3a90134cbf4a62c3db1" }, - {"metaphilibert_SH", "0284af1a5ef01503e6316a2ca4abf8423a794e9fc17ac6846f042b6f4adedc3309", "03b21ff042bf1730b28bde43f44c064578b41996117ac7634b567c3773089e3be3" }, - {"ca333_DEV", "02856843af2d9457b5b1c907068bef6077ea0904cc8bd4df1ced013f64bf267958", "029c0342ce2a4f9146c7d1ee012b26f5c2df78b507fb4461bf48df71b4e3031b56" }, - {"cipi_NA", "02858904a2a1a0b44df4c937b65ee1f5b66186ab87a751858cf270dee1d5031f18", "034406ac4cf94e84561c5d3f25384dd59145e92fefc5972a037dc6a44bfa286688" }, - {"pungocloud_SH", "02863628f842a8aa424daf745cf43a1717cfcd571338ba87bfcec4d340703d01d6", "03f42c8052decf9a9d2eba60b1c8cd8b2b8e858d6b1ef0e5f09ba8a9ac1b1ced62" }, - {"voskcoin_EU", "028cfb0bbce2207425bc8d40fff634269bb61aade2d1d03883398275550b465600", "037135718fa54e59bcb71f9f9e9c4ab43daa86be50dbaadce10bc176a4f611d546" }, - {"decker_DEV", "028eea44a09674dda00d88ffd199a09c9b75ba9782382cc8f1e97c0fd565fe5707", "02fca8ee50e49f480de275745618db7b0b3680b0bdcce7dcae7d2e0fd5c3345744" }, - {"cryptoeconomy_EU", "0290ab4937e85246e048552df3e9a66cba2c1602db76e03763e16c671e750145d1", "037d04b7d16de61a44a3fc766bea4b7791023a36675d6cee862fe53defd04dd8f2" }, - {"etszombi_EU", "0293ea48d8841af7a419a24d9da11c34b39127ef041f847651bae6ab14dcd1f6b4", "02f65da26061d1b9f1756a274918a37e83086dbfe9a43d2f0b35b9d2f593b31907" }, // 20 - {"karasugoi_NA", "02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982", "024ba10f7f5325fd6ec6cab50c5242d142d00fab3537c0002097c0e98f72014177" }, - {"pirate_AR", "02a5e865af771eee0c6bd3bd238f01f5eb589907ba52efa9f37e5102375c8eb7a0", "0228431427395f0cefdb0d10402d0d726119508945eb66ca9c0bba5d64df79832c" }, - {"metaphilibert_AR", "02adad675fae12b25fdd0f57250b0caf7f795c43f346153a31fe3e72e7db1d6ac6", "0239e34ad22957bbf4c8df824401f237b2afe8d40f7a645ecd43e8f27dde1ab0da" }, - {"zatjum_SH", "02b315714f99fdd70bafd50a4c3aa4b9db0fd8d63978bd8d47763773400b28734c", "031675aae243d2e4f3e8b67dbc4a68f50f487a37df959d739b26a80ce917b10d84" }, - {"madmax_AR", "02b37913ac0250d17cca5bb94ef65928b1515f13f839075446db73b9b067c13aa0", "032f5fc01607c2e82417cfe822b981116262961c0a66f715fbb7e84614aadfe5df" }, - {"lukechilds_NA", "02c191a085bbb0bd86d126c62d3e801c503038b69c0c2de121c9a7abe3e6684420", "03dbda3ea207b1aca24803fa53f990402b0bea9ec6bdc4486d9878add7623faf35" }, - {"cipi_AR", "02c4f89a5b382750836cb787880d30e23502265054e1c327a5bfce67116d757ce8", "025b7655826f5fd3a807cbb4918ef9f02fe64661153ca170db981e9b0861f8c5ad" }, - {"tonyl_AR", "02cc8bc862f2b65ad4f99d5f68d3011c138bf517acdc8d4261166b0be8f64189e1", "03a8db38075c80348889871b4318b0a79a1fd7e9e21daefb4ca6e4f05e5963569c" }, - {"infotech_DEV", "02d7d63ac441dbcd5535bcad741701519c190e89e17e4180aa0f61fdda0b6195ea", "032a8265e3c5029d17bbb5a46da81aedd81dad74c152a21568ef082d3d497dcada" }, - {"fullmoon_NA", "02da228a67e519b21bca6426ed982509a21d24d45f1ac1bdf698b6083fed442ec3", "0291038301dea2ec683a3f686579dcebe37b2113cc6137ef0bfe87b505bcd16016" }, // 30 - {"etszombi_AR", "02e55e104aa94f70cde68165d7df3e162d4410c76afd4643b161dea044aa6d06ce", "03c786702b81e0122157739c8e2377cf945998d36c0d187ec5c5ff95855848dfdd" }, - {"node-9_EU", "02e90f0528f8fd7d2b7f28d53ed7368cc4b1dfc5814c70c486c533862ee05e37dc", "03a48773670b53e7d139182e1be70b8b3deeb38298af1950f7f9e9061a78156032" }, - {"phba2061_EU", "02eaa599f5434039adc5748b3b830f605342e11b51273046b04f24acc5bcecc74a", "03f1bc7f22f3895069ba11442f8868211dd5953105dd6a65862775c8f033535f32" }, - {"indenodes_AR", "02ec0fa5a40f47fd4a38ea5c89e375ad0b6ddf4807c99733c9c3dc15fb978ee147", "0242778789986d614f75bcf629081651b851a12ab1cc10c73995b27b90febb75a2" }, - {"and1-89_EU", "02f2af778c62888cfb106c0ef5c89cefe012ef3e6abed3ef28425092637d7ae3cc", "02bca5e635c2d1c3506510c3c662e317636e41495688fa8f37cff42737fe048565" }, - {"komodopioneers_SH", "02ffde73d51b56bf9e23b6f03008ac7916cacd3be090f44eab59877792e08b6751", "02805ef7a915c90d0719d83f1287b9509c481be735d019df212b71002a21bb860f" }, - {"komodopioneers_EU", "03014f3fceb9f851f9dba5f5b371c7758b3f1fe44a70b4e60e3d6c70d1e5265358", "0222a74c839d67346250b953a790abcb3d92cb5187f1c25f02d193f8d10d04ed64" }, - {"d0ct0r_NA", "0303725d8525b6f969122faf04152653eb4bf34e10de92182263321769c334bf58", "0235b211469d7c1881d30ab647e0d6ddb4daf9466f60e85e6a33a92e39dedde3a7" }, - {"kolo_DEV", "030f34af4b908fb8eb2099accb56b8d157d49f6cfb691baa80fdd34f385efed961", "0292cec4c966787ebd436bc2af6fc375a8292b6d368385ce717f27fac64c1a9ed4" }, - {"peer2cloud_AR", "030fe3c77db0f91d79c26f951b674bba557b899f16570cd75332829a07031b0097", "03e63fbeff5db594b6903128b38630abc1b89bb1995ef76d0f5f5b7f88f473df78" }, // 40 - {"webworker01_SH", "031e50ba6de3c16f99d414bb89866e578d963a54bde7916c810608966fb5700776", "0221365d89a6f6373b15daa4a50d56d34ad1b4b8a48a7fd090163b6b5a5ecd7a0a" }, - {"webworker01_NA", "032735e9cad1bb00eaababfa6d27864fa4c1db0300c85e01e52176be2ca6a243ce", "03bfc36a60194b495c075b89995f307bec68c1bcbe381b6b29db47af23494430f9" }, - {"pbca26_NA", "0331c51abb78a9891d1b9483747a7fd9bbbbdd5256f40af23c87384e3d9a974289", "0371bf57314b24a0e4dfc31e8df83fb76231173912d962172600a5c395d59312f3" }, - {"indenodes_SH", "0334e6e1ec8285c4b85bd6dae67e17d67d1f20e7328efad17ce6fd24ae97cdd65e", "031d1584cf0eb4a2d314465e49e2677226b1615c3718013b8d6b4854c15676a58c" }, - {"pirate_NA", "033c8cef71f704f357c9ac1aeaafde3acd7bbfd0a09494e5e129ee0999fb2bc368", "035f1d94fd43ce3bf334c493cab29ab0635f75704650aaadb1d476a2bb3d74f34f" }, - {"lukechilds_AR", "035004d780316008c8afd5ac28d08aae56f4746bf70eb2c999e3c7d9a7a50ca8b6", "02b1a3fb6e47f566f96efc4dcd450abe370692806dff9090c24733c46728e9a342" }, - {"dragonhound_NA", "0354c779b9b111fdc825ee0250b33a79a837e0775a111a89916853d02a8999285c", "03c0d07f0b9932d5db003fe047e328f2bfd61fc24e19db79ef9471efd10ea4c102" }, - {"fullmoon_AR", "035673e913d603137f7f517d88bf316e51d408e0ec2b2cdcbfbdd5c0b553fc9351", "022e316df71f51f2bda83318aaeaebe7a12514429e85ba4f5402b1478c6d7873a4" }, - {"chainzilla_SH", "0360804b8817fd25ded6e9c0b50e3b0782ac666545b5416644198e18bc3903d9f9", "03fe36ff13cb224217898682ce8b87ba6e3cdd4a98941bb7060c04508b57a6b014" }, - {"titomane_EU", "03772ac0aad6b0e9feec5e591bff5de6775d6132e888633e73d3ba896bdd8e0afb", "03d691cd0914a711f651082e2b7b27bee778c1309a38840e40a6cf650682d17bb5" }, // 50 - {"jeezy_EU", "037f182facbad35684a6e960699f5da4ba89e99f0d0d62a87e8400dd086c8e5dd7", "022bca828b572cb2b3daff713ed2eb0bbc7378df20f799191eebecf3ef319509cd" }, - {"titomane_SH", "03850fdddf2413b51790daf51dd30823addb37313c8854b508ea6228205047ef9b", "038c2a64f7647633c0e74eec93f9a668d4bf80214a43ed7cd08e4e30d3f2f7acfb" }, - {"alien_AR", "03911a60395801082194b6834244fa78a3c30ff3e888667498e157b4aa80b0a65f", "024f20c096b085308e21893383f44b4faf1cdedea9ad53cc7d7e7fbfa0c30c1e71" }, - {"pirate_EU", "03986339bebe3891e369a528356a220bc17a5bef3d337edfcf0114e66e6b1c120f", "0377d4ed0264ad80fea05b3cd68cb1700404c0c08981830ba8ffae56b944e2ee77" }, - {"thegaltmines_NA", "03b113c7aa1042c965154bf791713f562891ac75e60ab78886205535bcaabb5013", "022138be032da85227fde7d1d5cc665ea21ba3f149601e8c23db269750991bc0c3" }, - {"computergenie_NA", "03b41c764c8cd63b48b79f15f112a9b5105a0dce35df7d6990d6919503a1f3f245", "02e01fe2bc6fd6eeeda6e84fdd67647b94058ee4ffd090d3ac67fd546f8bced39a" }, - {"nutellalicka_SH", "03b422ec85a8465ae42e7004bc6d0856a458f0f920ec0f58fd4d5613994f3faa5b", "03c8220bb835791b875f4060ff2d40c2dcc9346cc3390c04f5e202d207a1980b59" }, - {"chainstrike_SH", "03b806be3bf7a1f2f6290ec5c1ea7d3ea57774dcfcf2129a82b2569e585100e1cb", "0221f9dee04b7da1f3833c6ea7f7325652c951b1c239052b0dadb57209084ca6a8" }, - {"dwy_SH", "03b9162f9713d7cddd89aaad0398b67f66377cc17547ec0643a67c2d6fb099ecf0", "02f221458f84a3cf918cae6ec7fe553eff20bbed9fc4289e75af69b69478ccf0a4" }, // 60 - {"alien_EU", "03bb749e337b9074465fa28e757b5aa92cb1f0fea1a39589bca91a602834d443cd", "022b85908191788f409506ebcf96a892f3274f352864c3ed566c5a16de63953236" }, - {"gt_AR", "03e22a6aad65c9a4c2ce2e724b26edf631b5f41253449dd5feaeba68e7c0cf3058", "038b4f509468bfe51937bdce3f4529702d806b0e8fd4f7c487235d06d9c1b411ef" }, - {"patchkez_SH", "03f45e9beb5c4cd46525db8195eb05c1db84ae7ef3603566b3d775770eba3b96ee", "03d7c187689bf829ca076a30bbf36d2e67bb74e16a3290d8a55df21d6cb15c80c1" }, - {"decker_AR", "03ffdf1a116300a78729608d9930742cd349f11a9d64fcc336b8f18592dd9c91bc", "02a85540db8d41c7e60bf0d33d1364b4151cad883dd032878ea4c037f67b769635" }, - }, - { - {"webworker01_NA", "03bb7d005e052779b1586f071834c5facbb83470094cff5112f0072b64989f97d7" } + {"madmax_NA", "02016371f90f195ed9aeaf37be06f3fbbfbfe2ef8a4fd66378378289476e7751db" }, + {"alright_AR", "020566fe2fb3874258b2d3cf1809a5d650e0edc7ba746fa5eec72750c5188c9cc9" }, + {"strob_NA", "0206f7a2e972d9dfef1c424c731503a0a27de1ba7a15a91a362dc7ec0d0fb47685" }, + {"dwy_EU", "020a77f454a1d3fcdc0312048fc58d713fe6153189e0c59cdd12fedbf09553d4b0" }, + {"phm87_SH", "021773a38db1bc3ede7f28142f901a161c7b7737875edbb40082a201c55dcf0add" }, + {"chainmakers_NA", "021ad488cc063e17d0f1a2aade6be65ef8b5ff879987cb0b86bb700733099fe524" }, + {"indenodes_EU", "0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c" }, + {"blackjok3r_SH", "0226293d7644e1380555ecc2d385ba038a66f4202b24b643ab31bcad0dc1474de2" }, + {"chainmakers_EU", "022a6b583e8820d14d911a11820fd80853c5b8406e91a0a6fcac1f133d098d75cb" }, + {"titomane_AR", "023e3aa9834c46971ff3e7cb86a200ec9c8074a9566a3ea85d400d5739662ee989" }, + {"fullmoon_SH", "02639998420688ee935d279d1cd52f1c6f3ae12c1f3afc20b3bf7ece1057f8b93b" }, // 10 + {"indenodes_NA", "02698c6f1c9e43b66e82dbb163e8df0e5a2f62f3a7a882ca387d82f86e0b3fa988" }, + {"chmex_EU", "0281304ebbcc39e4f09fda85f4232dd8dacd668e20e5fc11fba6b985186c90086e" }, + {"metaphilibert_SH", "0284af1a5ef01503e6316a2ca4abf8423a794e9fc17ac6846f042b6f4adedc3309" }, + {"ca333_DEV", "02856843af2d9457b5b1c907068bef6077ea0904cc8bd4df1ced013f64bf267958" }, + {"cipi_NA", "02858904a2a1a0b44df4c937b65ee1f5b66186ab87a751858cf270dee1d5031f18" }, + {"pungocloud_SH", "02863628f842a8aa424daf745cf43a1717cfcd571338ba87bfcec4d340703d01d6" }, + {"voskcoin_EU", "028cfb0bbce2207425bc8d40fff634269bb61aade2d1d03883398275550b465600" }, + {"decker_DEV", "028eea44a09674dda00d88ffd199a09c9b75ba9782382cc8f1e97c0fd565fe5707" }, + {"cryptoeconomy_EU", "0290ab4937e85246e048552df3e9a66cba2c1602db76e03763e16c671e750145d1" }, + {"etszombi_EU", "0293ea48d8841af7a419a24d9da11c34b39127ef041f847651bae6ab14dcd1f6b4" }, // 20 + {"karasugoi_NA", "02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982" }, + {"pirate_AR", "02a5e865af771eee0c6bd3bd238f01f5eb589907ba52efa9f37e5102375c8eb7a0" }, + {"metaphilibert_AR", "02adad675fae12b25fdd0f57250b0caf7f795c43f346153a31fe3e72e7db1d6ac6" }, + {"zatjum_SH", "02b315714f99fdd70bafd50a4c3aa4b9db0fd8d63978bd8d47763773400b28734c" }, + {"madmax_AR", "02b37913ac0250d17cca5bb94ef65928b1515f13f839075446db73b9b067c13aa0" }, + {"lukechilds_NA", "02c191a085bbb0bd86d126c62d3e801c503038b69c0c2de121c9a7abe3e6684420" }, + {"cipi_AR", "02c4f89a5b382750836cb787880d30e23502265054e1c327a5bfce67116d757ce8" }, + {"tonyl_AR", "02cc8bc862f2b65ad4f99d5f68d3011c138bf517acdc8d4261166b0be8f64189e1" }, + {"infotech_DEV", "02d7d63ac441dbcd5535bcad741701519c190e89e17e4180aa0f61fdda0b6195ea" }, + {"fullmoon_NA", "02da228a67e519b21bca6426ed982509a21d24d45f1ac1bdf698b6083fed442ec3" }, // 30 + {"etszombi_AR", "02e55e104aa94f70cde68165d7df3e162d4410c76afd4643b161dea044aa6d06ce" }, + {"node-9_EU", "02e90f0528f8fd7d2b7f28d53ed7368cc4b1dfc5814c70c486c533862ee05e37dc" }, + {"phba2061_EU", "02eaa599f5434039adc5748b3b830f605342e11b51273046b04f24acc5bcecc74a" }, + {"indenodes_AR", "02ec0fa5a40f47fd4a38ea5c89e375ad0b6ddf4807c99733c9c3dc15fb978ee147" }, + {"and1-89_EU", "02f2af778c62888cfb106c0ef5c89cefe012ef3e6abed3ef28425092637d7ae3cc" }, + {"komodopioneers_SH", "02ffde73d51b56bf9e23b6f03008ac7916cacd3be090f44eab59877792e08b6751" }, + {"komodopioneers_EU", "03014f3fceb9f851f9dba5f5b371c7758b3f1fe44a70b4e60e3d6c70d1e5265358" }, + {"d0ct0r_NA", "0303725d8525b6f969122faf04152653eb4bf34e10de92182263321769c334bf58" }, + {"kolo_DEV", "030f34af4b908fb8eb2099accb56b8d157d49f6cfb691baa80fdd34f385efed961" }, + {"peer2cloud_AR", "030fe3c77db0f91d79c26f951b674bba557b899f16570cd75332829a07031b0097" }, // 40 + {"webworker01_SH", "031e50ba6de3c16f99d414bb89866e578d963a54bde7916c810608966fb5700776" }, + {"webworker01_NA", "032735e9cad1bb00eaababfa6d27864fa4c1db0300c85e01e52176be2ca6a243ce" }, + {"pbca26_NA", "0331c51abb78a9891d1b9483747a7fd9bbbbdd5256f40af23c87384e3d9a974289" }, + {"indenodes_SH", "0334e6e1ec8285c4b85bd6dae67e17d67d1f20e7328efad17ce6fd24ae97cdd65e" }, + {"pirate_NA", "033c8cef71f704f357c9ac1aeaafde3acd7bbfd0a09494e5e129ee0999fb2bc368" }, + {"lukechilds_AR", "035004d780316008c8afd5ac28d08aae56f4746bf70eb2c999e3c7d9a7a50ca8b6" }, + {"dragonhound_NA", "0354c779b9b111fdc825ee0250b33a79a837e0775a111a89916853d02a8999285c" }, + {"fullmoon_AR", "035673e913d603137f7f517d88bf316e51d408e0ec2b2cdcbfbdd5c0b553fc9351" }, + {"chainzilla_SH", "0360804b8817fd25ded6e9c0b50e3b0782ac666545b5416644198e18bc3903d9f9" }, + {"titomane_EU", "03772ac0aad6b0e9feec5e591bff5de6775d6132e888633e73d3ba896bdd8e0afb" }, // 50 + {"jeezy_EU", "037f182facbad35684a6e960699f5da4ba89e99f0d0d62a87e8400dd086c8e5dd7" }, + {"titomane_SH", "03850fdddf2413b51790daf51dd30823addb37313c8854b508ea6228205047ef9b" }, + {"alien_AR", "03911a60395801082194b6834244fa78a3c30ff3e888667498e157b4aa80b0a65f" }, + {"pirate_EU", "03986339bebe3891e369a528356a220bc17a5bef3d337edfcf0114e66e6b1c120f" }, + {"thegaltmines_NA", "03b113c7aa1042c965154bf791713f562891ac75e60ab78886205535bcaabb5013" }, + {"computergenie_NA", "03b41c764c8cd63b48b79f15f112a9b5105a0dce35df7d6990d6919503a1f3f245" }, + {"nutellalicka_SH", "03b422ec85a8465ae42e7004bc6d0856a458f0f920ec0f58fd4d5613994f3faa5b" }, + {"chainstrike_SH", "03b806be3bf7a1f2f6290ec5c1ea7d3ea57774dcfcf2129a82b2569e585100e1cb" }, + {"dwy_SH", "03b9162f9713d7cddd89aaad0398b67f66377cc17547ec0643a67c2d6fb099ecf0" }, // 60 + {"alien_EU", "03bb749e337b9074465fa28e757b5aa92cb1f0fea1a39589bca91a602834d443cd" }, + {"gt_AR", "03e22a6aad65c9a4c2ce2e724b26edf631b5f41253449dd5feaeba68e7c0cf3058" }, + {"patchkez_SH", "03f45e9beb5c4cd46525db8195eb05c1db84ae7ef3603566b3d775770eba3b96ee" }, + {"decker_AR", "03ffdf1a116300a78729608d9930742cd349f11a9d64fcc336b8f18592dd9c91bc" }, } }; From b29c95a26d1a6b9ec9caf551e5e3ab8d85ebf577 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 4 Jun 2019 11:53:38 +0800 Subject: [PATCH 19/65] fix PIRATE forced rescan. --- src/wallet/walletdb.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index e81eba03d..bed635d3b 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -488,7 +488,8 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, auto verifier = libzcash::ProofVerifier::Strict(); // ac_public chains set at height like KMD and ZEX, will force a rescan if we dont ignore this error: bad-txns-acpublic-chain // there cannot be any ztx in the wallet on ac_public chains that started from block 1, so this wont affect those. - if ( !(CheckTransaction(0,wtx, state, verifier) && (wtx.GetHash() == hash) && state.IsValid()) && (state.GetRejectReason() != "bad-txns-acpublic-chain") ) + // PIRATE fails this check for notary nodes, need exception. Triggers full rescan without it. + if ( !(CheckTransaction(0,wtx, state, verifier) && (wtx.GetHash() == hash) && state.IsValid()) && (state.GetRejectReason() != "bad-txns-acpublic-chain" || state.GetRejectReason() != "bad-txns-acprivacy-chain") ) { //fprintf(stderr, "tx failed: %s rejectreason.%s\n", wtx.GetHash().GetHex().c_str(), state.GetRejectReason().c_str()); // vin-empty on staking chains is error relating to a failed staking tx, that for some unknown reason did not fully erase. save them here to erase and re-add later on. From 86926e33f0ec9f66b4e7811d78af28d22a51c7f9 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 4 Jun 2019 13:34:50 +0800 Subject: [PATCH 20/65] fix uint --- src/komodo_notary.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index e2c7dfb4c..028bc4dc2 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -65,7 +65,6 @@ const char *Notaries_genesis[][2] = int32_t getkmdseason(int32_t height) { - int8_t season = 0; if ( height <= KMD_SEASON_HEIGHTS[0] ) return(1); for (int32_t i = 1; i < NUM_KMD_SEASONS; i++) @@ -76,9 +75,8 @@ int32_t getkmdseason(int32_t height) return(0); }; -int32_t getacseason(int32_t timestamp) +int32_t getacseason(uint32_t timestamp) { - int8_t season = 0; if ( timestamp <= KMD_SEASON_TIMESTAMPS[0] ) return(1); for (int32_t i = 1; i < NUM_KMD_SEASONS; i++) From 17dd062feebb409589c4ec2716281367ad7772b9 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 4 Jun 2019 14:10:15 +0800 Subject: [PATCH 21/65] woops --- src/wallet/walletdb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index bed635d3b..d2d90a85f 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -489,7 +489,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, // ac_public chains set at height like KMD and ZEX, will force a rescan if we dont ignore this error: bad-txns-acpublic-chain // there cannot be any ztx in the wallet on ac_public chains that started from block 1, so this wont affect those. // PIRATE fails this check for notary nodes, need exception. Triggers full rescan without it. - if ( !(CheckTransaction(0,wtx, state, verifier) && (wtx.GetHash() == hash) && state.IsValid()) && (state.GetRejectReason() != "bad-txns-acpublic-chain" || state.GetRejectReason() != "bad-txns-acprivacy-chain") ) + if ( !(CheckTransaction(0,wtx, state, verifier) && (wtx.GetHash() == hash) && state.IsValid()) && (state.GetRejectReason() != "bad-txns-acpublic-chain" && state.GetRejectReason() != "bad-txns-acprivacy-chain") ) { //fprintf(stderr, "tx failed: %s rejectreason.%s\n", wtx.GetHash().GetHex().c_str(), state.GetRejectReason().c_str()); // vin-empty on staking chains is error relating to a failed staking tx, that for some unknown reason did not fully erase. save them here to erase and re-add later on. From ee3aef50668054683f5f50040ecd463b6ec19e2d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 3 Jun 2019 21:10:49 -1100 Subject: [PATCH 22/65] Define getacseason --- src/komodo_defs.h | 1 + src/komodo_utils.h | 1 - src/main.cpp | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/komodo_defs.h b/src/komodo_defs.h index b3e4d7ad2..c6d4dd30b 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -304,6 +304,7 @@ extern int32_t ASSETCHAINS_EARLYTXIDCONTRACT; int tx_height( const uint256 &hash ); extern std::vector vWhiteListAddress; void komodo_netevent(std::vector payload); +int32_t getacseason(uint32_t timestamp); #define IGUANA_MAXSCRIPTSIZE 10001 #define KOMODO_KVDURATION 1440 diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 11cbea808..48c29ea6f 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1665,7 +1665,6 @@ uint64_t komodo_ac_block_subsidy(int nHeight) extern int64_t MAX_MONEY; void komodo_cbopretupdate(int32_t forceflag); -int32_t getacseason(int32_t timestamp); void SplitStr(const std::string& strVal, std::vector &outVals); int8_t equihash_params_possible(uint64_t n, uint64_t k) diff --git a/src/main.cpp b/src/main.cpp index a8ae8b60c..9f837a016 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1373,8 +1373,6 @@ bool CheckTransaction(uint32_t tiptime,const CTransaction& tx, CValidationState } } -extern int32_t getacseason(int32_t timestamp); - int32_t komodo_isnotaryvout(char *coinaddr,uint32_t tiptime) // from ac_private chains only { int32_t season = getacseason(tiptime); From bc69675fc386b0977df26a57b8d73109cd99a198 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 4 Jun 2019 17:55:34 +0800 Subject: [PATCH 23/65] undo attempt at hs/s for staking chains --- src/rpc/mining.cpp | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 8e5de0f53..53a744497 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -59,22 +59,9 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he * Return average network hashes per second based on the last 'lookup' blocks, * or over the difficulty averaging window if 'lookup' is nonpositive. * If 'height' is nonnegative, compute the estimate at the time when a given block was found. -time =0, lastBlockTime=time_of_last_block, PoWblocks=0 -for x = 1 to 100 -get block info -if PoS then - lastBlockTime = ThisBlockTime - next x -else - PoWblocks += 1 - some var/array about diff - newTime = timeNow - lastBlockTime - totalTime = totalTime + newTime - lastBlockTime = newTime -next x -do math of num PoW blocks over PoW active Time with stored diff info */ -int64_t GetNetworkHashPS(int lookup, int height) { +int64_t GetNetworkHashPS(int lookup, int height) +{ CBlockIndex *pb = chainActive.LastTip(); if (height >= 0 && height < chainActive.Height()) @@ -93,36 +80,21 @@ int64_t GetNetworkHashPS(int lookup, int height) { CBlockIndex *pb0 = pb; int64_t minTime = pb0->GetBlockTime(); - int64_t timeoffset = 0, n=0,i=0; int64_t maxTime = minTime; - for (i = 0; i < lookup; i++) { + for (int i = 0; i < lookup; i++) { pb0 = pb0->pprev; - // if PoW block save block time, and skip the hash. - if ( pb0->segid >= 0 && pb0->segid != -2 ) - { - n++; - // only staking chains should ever set this. - - timeoffset += pb0->GetBlockTime() - pb0->pprev->GetBlockTime(); - //fprintf(stderr, "staking tx.%li segid.%i blocktime.%li\n", n, pb0->segid, (pb0->GetBlockTime() - pb0->pprev->GetBlockTime())); - if ( lookup > pb->GetHeight() ) - break; - lookup++; - continue; - } int64_t time = pb0->GetBlockTime(); minTime = std::min(time, minTime); maxTime = std::max(time, maxTime); } - //fprintf(stderr, "number blocks scanned.%li\n",i ); // In case there's a situation where minTime == maxTime, we don't want a divide by zero exception. if (minTime == maxTime) return 0; arith_uint256 workDiff = pb->chainPower.chainWork - pb0->chainPower.chainWork; - int64_t timeDiff = maxTime - minTime;// - timeoffset; - fprintf(stderr, "timediff.%li timeoffset.%li mintime.%li maxtime.%li\n", timeDiff, timeoffset, minTime, maxTime); + int64_t timeDiff = maxTime - minTime; + return (int64_t)(workDiff.getdouble() / timeDiff); } From 439e7cb5d74b7234f4cc63e65ad20fe18afb87a2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jun 2019 08:51:38 -1100 Subject: [PATCH 24/65] Fix getchaintips rpc crash. Thanks mike tout!! --- src/cc/dapps/zmigrate.c | 197 ++++++++++++++++++++++++++++++++++++++++ src/rpc/blockchain.cpp | 1 - 2 files changed, 197 insertions(+), 1 deletion(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 33d776650..fe4fefcd5 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -938,7 +938,204 @@ int32_t have_pending_opid(char *coinstr,int32_t clearresults) return(pending); } +int64_t utxo_value(char *refcoin,char *srcaddr,bits256 txid,int32_t v) +{ + cJSON *txjson,*vouts,*vout,*sobj,*array; int32_t numvouts,numaddrs; int64_t val,value = 0; char *addr,str[65]; + srcaddr[0] = 0; + if ( (txjson= get_rawtransaction(refcoin,"",txid)) != 0 ) + { + if ( (vouts= jarray(&numvouts,txjson,"vout")) != 0 && v < numvouts ) + { + vout = jitem(vouts,v); + if ( (val= jdouble(vout,"value")*SATOSHIDEN) != 0 && (sobj= jobj(vout,"scriptPubKey")) != 0 ) + { + if ( (array= jarray(&numaddrs,sobj,"addresses")) != 0 && numaddrs == 1 && (addr= jstri(array,0)) != 0 && strlen(addr) < 64 ) + { + strcpy(srcaddr,addr); + value = val; + } else printf("couldnt get unique address for %s/%d\n",bits256_str(str,txid),v); + } else printf("error getting value for %s/v%d\n",bits256_str(str,txid),v); + } + } + return(value); +} + +struct addritem { int64_t total,numutxos; char addr[64]; } ADDRESSES[1200]; +struct claimitem { int64_t total,numutxos; char oldaddr[64],destaddr[64],username[64]; } CLAIMS[1200]; +int32_t NUM_ADDRESSES,NUM_CLAIMS; + +int32_t update_claimstats(char *username,char *oldaddr,char *destaddr,int64_t amount) +{ + +} + +int32_t update_addrstats(char *srcaddr,int64_t amount) +{ + int32_t i; struct addritem *item; + for (i=0; itotal = amount; + item->numutxos = 1; + strcpy(item->addr,srcaddr); + printf("%d new address %s\n",NUM_ADDRESSES,srcaddr); + return(-1); +} + +int64_t sum_of_vins(char *refcoin,int32_t *totalvinsp,int32_t *uniqaddrsp,bits256 txid) +{ + cJSON *txjson,*vins,*vin; char str[65],srcaddr[64]; int32_t i,numarray; int64_t amount,total = 0; + if ( (txjson= get_rawtransaction(refcoin,"",txid)) != 0 ) + { + if ( (vins= jarray(&numarray,txjson,"vin")) != 0) + { + for (i=0; i 0 ) + { + //printf("%d.(%s)\n",numlines,buf); + str = buf; + n = i = 0; + memset(fields,0,sizeof(fields)); + while ( *str != 0 ) + { + if ( *str == ',' || *str == '\n' || *str == '\r' ) + { + fields[n][i] = 0; + i = 0; + if ( n != 4 && n > 1 ) + { + printf("(%16s) ",fields[n]); + } + n++; + if ( *str == '\n' || *str == '\r' ) + break; + } + if ( *str == ',' || *str == ' ' ) + str++; + else fields[n][i++] = *str++; + } + printf("%s\n",fields[0]); + //for (i=0; i coin\n"); + return(-1); + } + if ( strcmp(argv[1],"KMD") == 0 ) + { + REFCOIN_CLI = "./komodo-cli"; + coinstr = clonestr("KMD"); + } + else + { + sprintf(buf,"./komodo-cli -ac_name=%s",argv[1]); + REFCOIN_CLI = clonestr(buf); + coinstr = clonestr(argv[1]); + } + if ( 1 ) + { + sprintf(buf,"%s-Claims.csv",coinstr); + reconcile_claims(buf); + } + else if ( (retjson= get_listunspent(coinstr,"")) != 0 ) + { + if ( (n= cJSON_GetArraySize(retjson)) > 0 ) + { + for (i=0; i= SATOSHIDEN ) + { + payout = ADDRESSES[i].total / SATOSHIDEN; + if ( payout > maxpayout ) + maxpayout = payout; + totalpayout += payout; + numpayouts++; + if ( payout >= 7 ) + { + numsmall++; + smallpayout += payout; + genpayout(coinstr,ADDRESSES[i].addr,payout); + } + //printf("%-4d: %-64s numutxos.%-4lld %llu\n",i,ADDRESSES[i].addr,ADDRESSES[i].numutxos,(long long)payout); + } + } + printf("num.%d total %.8f vs vintotal %.8f, totalvins.%d uniqaddrs.%d:%d totalpayout %llu maxpayout %llu numpayouts.%d numsmall.%d %llu\n",num,dstr(total),dstr(total2),totalvins,uniqaddrs,NUM_ADDRESSES,(long long)totalpayout,(long long)maxpayout,numpayouts,numsmall,(long long)smallpayout); + } +} + +int32_t oldmain(int32_t argc,char **argv) { char buf[1024],*zsaddr,*coinstr; if ( argc != 3 ) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index ddb5dab12..9c55c807b 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1853,7 +1853,6 @@ UniValue getchaintips(const UniValue& params, bool fHelp) /* Construct the output array. */ UniValue res(UniValue::VARR); const CBlockIndex *forked; - BOOST_FOREACH(const CBlockIndex* block, setTips) BOOST_FOREACH(const CBlockIndex* block, setTips) { UniValue obj(UniValue::VOBJ); From d206cc9c6c2db93f6f8fa1883f154bfd72889d14 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sat, 8 Jun 2019 01:22:28 +0200 Subject: [PATCH 25/65] add security info --- SECURITY.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..6bcbe7706 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,30 @@ +## Reporting a Vulnerability + +Please use the below [contact data](https://komodoplatform.com/.well-known/security.txt.asc) to report vulnerabilities. We kindly ask you to not publish or exploit any found vulnerabilities. + +``` +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +Contact: security@komodoplatform.com +Contact: ca333@komodoplatform.com +Contact: noashh@komodoplatform.com +Encryption: http://pgp.key-server.io:11371/0x379287998EE6CF47 +-----BEGIN PGP SIGNATURE----- + +iQJNBAEBCAA3FiEEVez5U2AlPa805zvqN5KHmY7mz0cFAlz6EuMZHGNhMzMzQGtv +bW9kb3BsYXRmb3JtLmNvbQAKCRA3koeZjubPR8cIEACP+JjyXDIzjgIewMMi/02b +tsYswPyQ+9bAoEJnis3r94d1FP1rqXmt4oNz6VwFTqQLEa5opW+gvvaxBTFJSPb0 +UzbS+1PjfAOox5cnT3Dnv9kcy4ECslnW/G+mH+85BUgz1HuqYc8A3kNQJL7KqLoi +YeD0Hd09KtlG+B4PWdnqLw/uvfbavSKdMn6WSIU6adNZWX0ewSubWPXvrWea5cI2 +yKDdMcDqB8Sc9J4JR2L9zW8NqPQuaxfLQbkCt2tg9QjlClrAqQgb8OZQJgY9f1T/ +kBlVXoA4ZUZeifvjSKxQ/3TdRFP+jbV9xsb6sr14zTx+Wcoqtgsh3l9F4+T3V2m8 +/c/iS4mFlK31pJtwYyrJAq9hpggqymdCVi0Pa3yLZsEj3orBPaPWbmq2v7xeF3J8 +y8vqAkt3M3T6251aZAKEcaN5RXYJW70CTseadwp0tmrAL2nIVmziNCMOF+Bufyxi +HddkasTcNX8VYfPCLWqBwrocx8d3n3E7dBGeS2x2iwuRVQ85pH5d+imxaMftcbqm +YrNuiqcI/0XDGk9pS6f1gpu5Eh5Q2QXGmOoRlfosfkAEfgFxfaMvmcu5Ay1s0gSR +MsTn0PrQyMYC3t3KpyP47C8ui9x7FtJFltR/QT4yzBF1QyDmINnK86ldQqSui402 +2+gQFt7YFvLIBUiy1fh1Jw== +=UITq +-----END PGP SIGNATURE----- +``` From e73b3c5c9d66e35fa8a1544268b0433598049f8d Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Sat, 8 Jun 2019 12:50:10 +0800 Subject: [PATCH 26/65] Disable all CCs that are not used. Still needs list of ccs for KMDICE from Alright. --- src/komodo_utils.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 48c29ea6f..93d4f245e 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -2296,6 +2296,60 @@ void komodo_args(char *argv0) fprintf(stderr,"-ac_private for a non-PIRATE chain is not supported. The only reason to have an -ac_private chain is for total privacy and that is best achieved with the largest anon set. PIRATE has that and it is recommended to just use PIRATE\n"); StartShutdown(); } + // Set cc enables for all existing ac_cc chains here. + if ( strcmp("AXO",ASSETCHAINS_SYMBOL) == 0 ) + { + // No CCs used on this chain yet please ask AXO777 what he needs. + memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + } + if ( strcmp("CCL",ASSETCHAINS_SYMBOL) == 0 ) + { + // No CCs used on this chain yet. + memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + } + if ( strcmp("COQUI",ASSETCHAINS_SYMBOL) == 0 ) + { + memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + ASSETCHAINS_CCDISABLES[230] = 0; // DICE + ASSETCHAINS_CCDISABLES[235] = 0; // CHANNELS + ASSETCHAINS_CCDISABLES[236] = 0; // ORACLES + } + if ( strcmp("DION",ASSETCHAINS_SYMBOL) == 0 ) + { + // No CCs used on this chain yet. + memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + } + if ( strcmp("EQL",ASSETCHAINS_SYMBOL) == 0 ) + { + // No CCs used on this chain yet. + memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + } + if ( strcmp("ILN",ASSETCHAINS_SYMBOL) == 0 ) + { + // No CCs used on this chain yet. + memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + } + if ( strcmp("MORTY",ASSETCHAINS_SYMBOL) == 0 ) + { + memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + ASSETCHAINS_CCDISABLES[228] = 0; // FAUCET + } + if ( strcmp("RICK",ASSETCHAINS_SYMBOL) == 0 ) + { + memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + ASSETCHAINS_CCDISABLES[228] = 1; // FAUCET + } + if ( strcmp("SEC",ASSETCHAINS_SYMBOL) == 0 ) + { + memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + ASSETCHAINS_CCDISABLES[227] = 0; // ASSETS + ASSETCHAINS_CCDISABLES[242] = 0; // TOKENS + } + if ( strcmp("KMDICE",ASSETCHAINS_SYMBOL) == 0 ) + { + memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + ASSETCHAINS_CCDISABLES[230] = 0; // DICE + } } else BITCOIND_RPCPORT = GetArg("-rpcport", BaseParams().RPCPort()); KOMODO_DPOWCONFS = GetArg("-dpowconfs",dpowconfs); if ( ASSETCHAINS_SYMBOL[0] == 0 || strcmp(ASSETCHAINS_SYMBOL,"SUPERNET") == 0 || strcmp(ASSETCHAINS_SYMBOL,"DEX") == 0 || strcmp(ASSETCHAINS_SYMBOL,"COQUI") == 0 || strcmp(ASSETCHAINS_SYMBOL,"PIRATE") == 0 || strcmp(ASSETCHAINS_SYMBOL,"KMDICE") == 0 ) From 65fd65078210bf064c2fb93a628040c693c024fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 7 Jun 2019 22:53:59 -1100 Subject: [PATCH 27/65] Rescue stuff --- src/cc/dapps/zmigrate.c | 43 ++++++++++++++++++++++++++++++----------- src/komodo_gateway.h | 19 +++++++++++++++--- src/komodo_globals.h | 1 + src/main.cpp | 17 +++++++++------- 4 files changed, 59 insertions(+), 21 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index fe4fefcd5..ef6524947 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -961,12 +961,35 @@ int64_t utxo_value(char *refcoin,char *srcaddr,bits256 txid,int32_t v) } struct addritem { int64_t total,numutxos; char addr[64]; } ADDRESSES[1200]; -struct claimitem { int64_t total,numutxos; char oldaddr[64],destaddr[64],username[64]; } CLAIMS[1200]; +struct claimitem { int64_t total; int32_t numutxos,disputed; char oldaddr[64],destaddr[64],username[64]; } CLAIMS[1200]; int32_t NUM_ADDRESSES,NUM_CLAIMS; -int32_t update_claimstats(char *username,char *oldaddr,char *destaddr,int64_t amount) +int64_t update_claimstats(char *username,char *oldaddr,char *destaddr,int64_t amount) { - + int32_t i; struct claimitem *item; + for (i=0; idestaddr) != 0 )//|| strcmp(username,item->username) != 0 ) + { + item->disputed++; + printf("disputed.%d claim.%-4d: (%36s -> %36s %s) vs. (%36s -> %36s %s) \n",item->disputed,i,oldaddr,destaddr,username,item->oldaddr,item->destaddr,item->username); + } + item->numutxos++; + item->total += amount; + return(amount); + } + } + item = &CLAIMS[NUM_CLAIMS++]; + item->total = amount; + item->numutxos = 1; + strncpy(item->oldaddr,oldaddr,sizeof(item->oldaddr)); + strncpy(item->destaddr,destaddr,sizeof(item->destaddr)); + strncpy(item->username,username,sizeof(item->username)); + //printf("new claim.%-4d: %36s %16.8f -> %36s %s\n",NUM_CLAIMS,oldaddr,dstr(amount),destaddr,username); + return(amount); } int32_t update_addrstats(char *srcaddr,int64_t amount) @@ -1031,7 +1054,7 @@ void genpayout(char *coinstr,char *destaddr,int32_t amount) void reconcile_claims(char *fname) { - FILE *fp; double amount; int32_t i,n,numlines = 0; char buf[1024],fields[16][256],*str; + FILE *fp; double amount; int32_t i,n,numlines = 0; char buf[1024],fields[16][256],*str; int64_t total = 0; if ( (fp= fopen(fname,"rb")) != 0 ) { while ( fgets(buf,sizeof(buf),fp) > 0 ) @@ -1048,7 +1071,7 @@ void reconcile_claims(char *fname) i = 0; if ( n != 4 && n > 1 ) { - printf("(%16s) ",fields[n]); + //printf("(%16s) ",fields[n]); } n++; if ( *str == '\n' || *str == '\r' ) @@ -1058,15 +1081,13 @@ void reconcile_claims(char *fname) str++; else fields[n][i++] = *str++; } - printf("%s\n",fields[0]); - //for (i=0; i= indallvouts) ) + if ( block.vtx[i].vin[j].prevout.hash == array[k] && komodo_checkvout(block.vtx[i].vin[j].prevout.n,k,indallvouts) != 0 ) //(block.vtx[i].vin[j].prevout.n == 1 || k >= indallvouts) ) { printf("banned tx.%d being used at ht.%d txi.%d vini.%d\n",k,height,i,j); return(-1); diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 099cddd4b..9d6d97100 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -29,6 +29,7 @@ uint64_t komodo_paxtotal(); int32_t komodo_longestchain(); uint64_t komodo_maxallowed(int32_t baseid); int32_t komodo_bannedset(int32_t *indallvoutsp,uint256 *array,int32_t max); +int32_t komodo_checkvout(int32_t vout,int32_t k,int32_t indallvouts); pthread_mutex_t komodo_mutex,staked_mutex; diff --git a/src/main.cpp b/src/main.cpp index 9f837a016..30783e2ab 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1341,16 +1341,19 @@ bool CheckTransaction(uint32_t tiptime,const CTransaction& tx, CValidationState if ( *(int32_t *)&array[0] == 0 ) numbanned = komodo_bannedset(&indallvouts,array,(int32_t)(sizeof(array)/sizeof(*array))); n = tx.vin.size(); - for (j=0; j= indallvouts) ) + for (k=0; kGetHeight(),j); - return(false); + if ( tx.vin[j].prevout.hash == array[k] && komodo_checkvout(tx.vin[j].prevout.n,k,indallvouts) != 0 ) //(tx.vin[j].prevout.n == 1 || k >= indallvouts) ) + { + static uint32_t counter; + if ( counter++ < 100 ) + printf("MEMPOOL: banned tx.%d being used at ht.%d vout.%d\n",k,(int32_t)chainActive.Tip()->GetHeight(),j); + return(false); + } } } } From 6bb5f308fa4570e54218c4340bd977d81c0f9f14 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 9 Jun 2019 09:32:37 +0200 Subject: [PATCH 28/65] add contribution guideline --- CONTRIBUTING.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..826c2b974 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,59 @@ + +# Komodo Core (komodod) Software Contribution Guidelines + +Thank you for reaching out and trying to make Komodo an even better software application and blockchain platform. These contribution guidelines shall help you figuring out where you can be helpful and how to easily get started. + +## Table of Contents + +0. [Types of contributions we're looking for](#types-of-contributions-were-looking-for) +0. [Ground rules & expectations](#ground-rules--expectations) +0. [How to contribute](#how-to-contribute) +0. [Style guide](#style-guide) +0. [Setting up your environment](#setting-up-your-environment) +0. [Contribution review process](#contribution-review-process) +0. [Community](#community) + +## Types of contributions we're looking for +There are many ways you can directly contribute to Komodo: + +* Debug and test the Komodo Core code +* Find and fix bugs +* Improve suboptimal code +* Extend our software +* Perform a secure code review of Komodo Core and other Komodo-related software + +Interested in making a contribution? Read on! + +## Ground rules & expectations + +Before we get started, here are a few things we expect from you (and that you should expect from others): + +* Be kind and thoughtful in your conversations around this project. We all come from different backgrounds and projects, which means we likely have different perspectives on "how open source is done." Try to listen to others rather than convince them that your way is correct. +* Open Source Guides are released with a [Contributor Code of Conduct](./CODE_OF_CONDUCT.md). By participating in this project, you agree to abide by its terms. +* If you open a pull request, please ensure that your contribution passes all tests. If there are test failures, you will need to address them before we can merge your contribution. +* When adding content, please consider if it is widely valuable. Please don't add references or links to things you or your employer have created as others will do so if they appreciate it. + +## How to contribute + +If you'd like to contribute, start by searching through the [issues](https://github.com/komodoplatform/komodo/issues) and [pull requests](https://github.com/komodoplatform/komodo/pulls) to see whether someone else has raised a similar idea or question. + +If you don't see your idea listed, and you think it can contribute to Komodo, do one of the following: +* **If your contribution is minor,** such as a fixing a typo, open a pull request. +* **If your contribution is major,** such as a new feature or bugfix, start by opening an issue first. That way, other contributors can weigh in on the discussion before you do any work. + +## Style guide +Write clear, clean and consistent code. Follow well-known and established style guidelines like [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) or [Bjarne Stroustrup C++ Style FAQ](http://www.stroustrup.com/bs_faq2.html). + +## Setting up your environment + +The Komodo Core (komodod) is mainly written in C++ with specific modules written in C. Follow the [Getting Started](https://github.com/komodoplatform/komodo#getting-started) instructions to build komodod from sources. + +## Contribution review process + +Our team and community will review your contribution and start a transparent testing and quality assurance process. + +## Community + +Discussions about Komodo's development take place on our [discord server](https://discord.gg/yhfzqsg). Anybody is welcome to join these conversations. There is also a [newsletter](http://komodoplatform.com) with regular updates. + +Wherever possible, do not take these conversations to private channels, including contacting the maintainers directly. Keeping communication public means everybody can benefit and learn from the conversation. From f0171a9bbc05cb9950db32391c3324fce22cfd5a Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 9 Jun 2019 09:33:23 +0200 Subject: [PATCH 29/65] update code of conduct --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 826c2b974..2184454a8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,7 +29,7 @@ Interested in making a contribution? Read on! Before we get started, here are a few things we expect from you (and that you should expect from others): * Be kind and thoughtful in your conversations around this project. We all come from different backgrounds and projects, which means we likely have different perspectives on "how open source is done." Try to listen to others rather than convince them that your way is correct. -* Open Source Guides are released with a [Contributor Code of Conduct](./CODE_OF_CONDUCT.md). By participating in this project, you agree to abide by its terms. +* Open Source Guides are released with a [Contributor Code of Conduct](./code_of_conduct.md). By participating in this project, you agree to abide by its terms. * If you open a pull request, please ensure that your contribution passes all tests. If there are test failures, you will need to address them before we can merge your contribution. * When adding content, please consider if it is widely valuable. Please don't add references or links to things you or your employer have created as others will do so if they appreciate it. From dd1e2e757664af7d311acd78e626e80c14e464e7 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 9 Jun 2019 09:36:00 +0200 Subject: [PATCH 30/65] add src --- CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2184454a8..33e5fe027 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,3 +57,6 @@ Our team and community will review your contribution and start a transparent tes Discussions about Komodo's development take place on our [discord server](https://discord.gg/yhfzqsg). Anybody is welcome to join these conversations. There is also a [newsletter](http://komodoplatform.com) with regular updates. Wherever possible, do not take these conversations to private channels, including contacting the maintainers directly. Keeping communication public means everybody can benefit and learn from the conversation. + + +This contribution guideline is adapted from the Open Source Guides. From 3d313229d892eaa1f26e1c5a5686af022cb3911d Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 9 Jun 2019 09:43:52 +0200 Subject: [PATCH 31/65] add dev docs --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 33e5fe027..c64c2953a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,11 +46,11 @@ Write clear, clean and consistent code. Follow well-known and established style ## Setting up your environment -The Komodo Core (komodod) is mainly written in C++ with specific modules written in C. Follow the [Getting Started](https://github.com/komodoplatform/komodo#getting-started) instructions to build komodod from sources. +The Komodo Core (komodod) is mainly written in C++ with specific modules written in C. Follow the [Getting Started](https://github.com/komodoplatform/komodo#getting-started) instructions to build komodod from sources. For more informations about the Komodo Platform and a full API documentation please visit the official [Komodo developer documentation](https://docs.komodoplatform.com/). ## Contribution review process -Our team and community will review your contribution and start a transparent testing and quality assurance process. +Our team and community will review your contribution and start a transparent testing and quality assurance process. As soon as your contribution has undergone sucessful review and QA signoff it gets merged into the Komodo sourcecode. ## Community From 219e684a50232ef3c73f7f036b620fa332349b1f Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 9 Jun 2019 09:48:39 +0200 Subject: [PATCH 32/65] fix typo --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c64c2953a..b7ff449d6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,7 +42,7 @@ If you don't see your idea listed, and you think it can contribute to Komodo, do * **If your contribution is major,** such as a new feature or bugfix, start by opening an issue first. That way, other contributors can weigh in on the discussion before you do any work. ## Style guide -Write clear, clean and consistent code. Follow well-known and established style guidelines like [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) or [Bjarne Stroustrup C++ Style FAQ](http://www.stroustrup.com/bs_faq2.html). +Write clear, clean and consistent code. Follow well-known and established style guidelines like [Google's C++ Style Guide](https://google.github.io/styleguide/cppguide.html) or [Bjarne Stroustrup's C++ Style FAQ](http://www.stroustrup.com/bs_faq2.html). ## Setting up your environment From c42116ba3b58606c268f160579735c859de4426b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 8 Jun 2019 22:19:33 -1100 Subject: [PATCH 33/65] Refund processor --- src/cc/dapps/zmigrate.c | 300 +++++++++++++++++++++++++++++++++++++--- src/komodo_gateway.h | 3 + 2 files changed, 287 insertions(+), 16 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index ef6524947..5144b4cf4 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -960,10 +960,225 @@ int64_t utxo_value(char *refcoin,char *srcaddr,bits256 txid,int32_t v) return(value); } -struct addritem { int64_t total,numutxos; char addr[64]; } ADDRESSES[1200]; -struct claimitem { int64_t total; int32_t numutxos,disputed; char oldaddr[64],destaddr[64],username[64]; } CLAIMS[1200]; +int32_t verify_vin(char *refcoin,bits256 txid,int32_t v,char *cmpaddr) +{ + cJSON *txjson,*vins,*vin; int32_t numvins; char vinaddr[64],str[65]; + vinaddr[0] = 0; + if ( (txjson= get_rawtransaction(refcoin,"",txid)) != 0 ) + { + if ( (vins= jarray(&numvins,txjson,"vin")) != 0 && v < numvins ) + { + vin = jitem(vins,v); + if ( utxo_value(refcoin,vinaddr,jbits256(vin,"txid"),jint(vin,"vout")) > 0 && strcmp(vinaddr,cmpaddr) == 0 ) + return(0); + printf("mismatched vinaddr.(%s) vs %s\n",vinaddr,cmpaddr); + } + } + return(-1); +} + +int32_t txid_in_vins(char *refcoin,bits256 txid,bits256 cmptxid) +{ + cJSON *txjson,*vins,*vin; int32_t numvins,v,vinvout; bits256 vintxid; char str[65]; + if ( (txjson= get_rawtransaction(refcoin,"",txid)) != 0 ) + { + if ( (vins= jarray(&numvins,txjson,"vin")) != 0 ) + { + for (v=0; vrefundvalue < 0 ) + return(-1); + sprintf(url,"https://kmd.explorer.dexstats.info/insight-api-komodo/addr/%s",item->destaddr); + if ( (retstr= send_curl(url,"/tmp/itemvalid")) != 0 ) + { + if ( (curljson= cJSON_Parse(retstr)) != 0 ) + { + if ( (txids= jarray(&numtxids,curljson,"transactions")) != 0 ) + { + for (i=0; itxid) == 0 ) + { + printf("found item->txid %s inside %s\n",bits256_str(str,item->txid),bits256_str(str2,txid)); + item->approved = 1; + break; + } + } + } + free_json(curljson); + } + //printf("%s\n",retstr); + free(retstr); + } + if ( item->approved != 0 ) + return(1); + *waitingp = item->refundvalue; + return(-1); +} + +void scan_claims(int32_t issueflag,char *refcoin,int32_t batchid) +{ + char str[65]; int32_t i,num,numstolen=0,numcandidates=0,numinvalids=0,numrefunded=0,numwaiting=0; struct claimitem *item; int64_t batchmin,batchmax,waiting,refunded,possiblerefund=0,possiblestolen = 0,invalidsum=0,totalrefunded=0,waitingsum=0; + if ( batchid == 0 ) + { + batchmin = 0; + batchmax = 7 * SATOSHIDEN; + } + else if ( batchid == 1 ) + { + batchmin = 7 * SATOSHIDEN; + batchmax = 777 * SATOSHIDEN; + } + else if ( batchid == 2 ) + { + batchmin = 777 * SATOSHIDEN; + batchmax = 7777 * SATOSHIDEN; + } + else if ( batchid == 3 ) + { + batchmin = 7777 * SATOSHIDEN; + batchmax = 1000000 * SATOSHIDEN; + } + for (i=0; irefundvalue < batchmin || item->refundvalue >= batchmax ) + continue; + if ( itemvalid(refcoin,&refunded,&waiting,item) < 0 ) + { + if ( refunded != 0 ) + { + numrefunded++; + totalrefunded += refunded; + } + else if ( waiting != 0 ) + { + numwaiting++; + waitingsum += waiting; + } + else + { + invalidsum += item->refundvalue; + numinvalids++; + } + continue; + } + if ( item->total > item->refundvalue*1.05 + 10*SATOSHIDEN ) + { + //if ( (item->total-item->refundvalue) > 777*SATOSHIDEN ) + printf("possible.%d stolen %s %.8f vs refund %.8f -> %.8f\n",batchid,item->oldaddr,dstr(item->total),dstr(item->refundvalue),dstr(item->total)-dstr(item->refundvalue)); + numstolen++; + possiblestolen += (item->total - item->refundvalue); + item->approved = 0; + } + else + { + printf("candidate.%d %s %.8f vs refund %.8f -> %s\n",batchid,item->oldaddr,dstr(item->total),dstr(item->refundvalue),item->destaddr); + numcandidates++; + possiblerefund += item->refundvalue; + } + } + printf("batchid.%d TOTAL exposure %d %.8f, possible refund %d %.8f, invalids %d %.8f, numrefunded %d %.8f, waiting %d %.8f\n",batchid,numstolen,dstr(possiblestolen),numcandidates,dstr(possiblerefund),numinvalids,dstr(invalidsum),numrefunded,dstr(totalrefunded),numwaiting,dstr(waitingsum)); + for (i=num=0; iapproved != 0 ) + { + printf("%d.%d: approved.%d %s %.8f vs refund %.8f -> %s\n",i,num,batchid,item->oldaddr,dstr(item->total),dstr(item->refundvalue),item->destaddr); + num++; + if ( issueflag != 0 ) + { + static FILE *fp; char cmd[1024]; + if ( fp == 0 ) + fp = fopen("refund.log","wb"); + genrefund(cmd,refcoin,item->txid,item->destaddr,item->refundvalue); + if ( fp != 0 ) + { + fprintf(fp,"%s,%s,%s,%s,%s,%.8f,%s\n",item->username,refcoin,bits256_str(str,item->txid),item->oldaddr,item->destaddr,dstr(item->refundvalue),cmd); + fflush(fp); + } + memset(&SECONDVIN,0,sizeof(SECONDVIN)); + SECONDVOUT = 1; +//printf(">>>>>>>>>>>>>>>>>> getchar after (%s)\n",cmd); +//getchar(); + } + } + } +} + +int32_t update_claimvalue(int32_t *disputedp,char *addr,int64_t amount,bits256 txid) +{ + int32_t i; struct claimitem *item; + *disputedp = 0; + for (i=0; irefundvalue = amount; + if ( bits256_nonz(item->txid) != 0 ) + printf("disputed.%d %s claimed %.8f vs %.8f\n",item->disputed,addr,dstr(item->total),dstr(amount)); + item->txid = txid; + if ( item->disputed != 0 ) + *disputedp = 1; + return(i); + } + } + return(-1); +} + int64_t update_claimstats(char *username,char *oldaddr,char *destaddr,int64_t amount) { int32_t i; struct claimitem *item; @@ -988,7 +1203,7 @@ int64_t update_claimstats(char *username,char *oldaddr,char *destaddr,int64_t am strncpy(item->oldaddr,oldaddr,sizeof(item->oldaddr)); strncpy(item->destaddr,destaddr,sizeof(item->destaddr)); strncpy(item->username,username,sizeof(item->username)); - //printf("new claim.%-4d: %36s %16.8f -> %36s %s\n",NUM_CLAIMS,oldaddr,dstr(amount),destaddr,username); + printf("new claim.%-4d: %36s %16.8f -> %36s %s\n",NUM_CLAIMS,oldaddr,dstr(amount),destaddr,username); return(amount); } @@ -1042,16 +1257,6 @@ int64_t sum_of_vins(char *refcoin,int32_t *totalvinsp,int32_t *uniqaddrsp,bits25 return(total); } -void genpayout(char *coinstr,char *destaddr,int32_t amount) -{ - char cmd[1024]; - sprintf(cmd,"curl --url \"http://127.0.0.1:7783\" --data \"{\\\"userpass\\\":\\\"$userpass\\\",\\\"method\\\":\\\"withdraw\\\",\\\"coin\\\":\\\"%s\\\",\\\"outputs\\\":[{\\\"%s\\\":%.8f},{\\\"RWXL82m4xnBTg1kk6PuS2xekonu7oEeiJG\\\":0.0002}],\\\"broadcast\\\":1}\"\nsleep 3\n",coinstr,destaddr,dstr(amount+20000)); - printf("%s",cmd); -} - -// 602.(powerkin#8483,KMD ,RArt9a3piuz3YVhJorAWMnMYd1jwHKdEqo,16,39403c7c5c87e9ba087769cd10023d2b24d11ce4a277c3c41e7efd9da236ed60,RJ37ByppPqsLDauEgQbdwrr3GroTYC2ynE - - void reconcile_claims(char *fname) { FILE *fp; double amount; int32_t i,n,numlines = 0; char buf[1024],fields[16][256],*str; int64_t total = 0; @@ -1069,7 +1274,7 @@ void reconcile_claims(char *fname) { fields[n][i] = 0; i = 0; - if ( n != 4 && n > 1 ) + if ( n > 1 ) { //printf("(%16s) ",fields[n]); } @@ -1082,7 +1287,7 @@ void reconcile_claims(char *fname) else fields[n][i++] = *str++; } //printf("%s\n",fields[0]); - total += update_claimstats(fields[0],fields[2],fields[5],atof(fields[3])*SATOSHIDEN + 0.0000000049); + total += update_claimstats(fields[0],fields[2],fields[4],atof(fields[3])*SATOSHIDEN + 0.0000000049); numlines++; } fclose(fp); @@ -1092,7 +1297,7 @@ void reconcile_claims(char *fname) int32_t main(int32_t argc,char **argv) { - char *coinstr,*addr,buf[64]; cJSON *retjson,*item; int32_t i,n,numsmall=0,numpayouts=0,num=0,totalvins=0,uniqaddrs=0; int64_t amount,total = 0,total2 = 0,payout,maxpayout,smallpayout=0,totalpayout = 0; + char *coinstr,*addr,buf[64],srcaddr[64],str[65]; cJSON *retjson,*item; int32_t i,n,disputed,numdisputed,numsmall=0,numpayouts=0,numclaims=0,num=0,totalvins=0,uniqaddrs=0; int64_t amount,total = 0,total2 = 0,payout,maxpayout,smallpayout=0,totalpayout = 0,totaldisputed = 0,totaldisputed2 = 0,fundingamount = 0; if ( argc != 2 ) { printf("argc needs to be 2: coin\n"); @@ -1113,6 +1318,69 @@ int32_t main(int32_t argc,char **argv) { sprintf(buf,"%s-Claims.csv",coinstr); reconcile_claims(buf); + for (i=0; i 0 ) + { + for (i=0; i fundingamount ) + { + fundingamount = amount; + SECONDVIN = jbits256(item,"txid"); + SECONDVOUT = jint(item,"vout"); + printf("set SECONDVIN to %s/v%d %.8f\n",bits256_str(str,SECONDVIN),SECONDVOUT,dstr(amount)); + } + continue; + } + if ( verify_vin(coinstr,jbits256(item,"txid"),0,"R9JCEd6xnCxNUSpLrHEWvzPSh7CNXm7z75") < 0 ) + { + printf("WARNING: imposter dust detected! %s\n",bits256_str(str,jbits256(item,"txid"))); + continue; + } + amount = (utxo_value(coinstr,srcaddr,jbits256(item,"txid"),0) - 20000) * SATOSHIDEN; + //printf("%d: %s claimvalue %.8f\n",num,srcaddr,dstr(amount)); + num++; + total2 += amount; + if ( update_claimvalue(&disputed,srcaddr,amount,jbits256(item,"txid")) >= 0 ) + { + if ( disputed != 0 ) + { + totaldisputed2 += amount; + numdisputed++; + } + else + { + numclaims++; + total += amount; + } + } + } + } + } + free_json(retjson); + printf("remaining refunds.%d %.8f, numclaims.%d %.8f, numdisputed.%d %.8f\n",num,dstr(total2),numclaims,dstr(total),numdisputed,dstr(totaldisputed2)); + } + //scan_claims(1,coinstr,0); + scan_claims(1,coinstr,1); + //scan_claims(0,coinstr,2); + //scan_claims(0,coinstr,3); } else if ( (retjson= get_listunspent(coinstr,"")) != 0 ) { diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 9b238428b..b473ab425 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -649,6 +649,9 @@ const char *banned_txids[] = "1eb295ed54c47f35cbccd7e7e40d03041f1853581da6d41102a9d8813782b6cb", "db121e4012222adfc841824984a2a90b7e5b018dd71307822537d58160195e43", "28f95b8148ac4ae6e09c7380e34422fab41d568a411e53dc94823e36a3d6f386", + "01d8c839463bda2f2f6400ede4611357913684927a767422a8560ead1b22557c", + "6e4980a9e1bd669f4df04732dc6f11b7773b6de88d1abcf89a6b9007d72ef9ac", + "6cc1d0495170bc0e11fd3925297623562e529ea1336b66ea61f8a1159041aed2", }; int32_t komodo_checkvout(int32_t vout,int32_t k,int32_t indallvouts) From 2abffc800cec88c17a8b880a77f27c47e9c09b93 Mon Sep 17 00:00:00 2001 From: Mihail Fedorov Date: Sun, 9 Jun 2019 19:48:21 +0300 Subject: [PATCH 34/65] dev --- src/komodo_defs.h | 56 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/komodo_defs.h b/src/komodo_defs.h index b3e4d7ad2..778b8c101 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -179,70 +179,70 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"xrobesx_NA", "03f0cc6d142d14a40937f12dbd99dbd9021328f45759e26f1877f2a838876709e1" }, }, { - {"madmax_NA", "02016371f90f195ed9aeaf37be06f3fbbfbfe2ef8a4fd66378378289476e7751db" }, + {"madmax_NA", "0237e0d3268cebfa235958808db1efc20cc43b31100813b1f3e15cc5aa647ad2c3" }, // 0 {"alright_AR", "020566fe2fb3874258b2d3cf1809a5d650e0edc7ba746fa5eec72750c5188c9cc9" }, {"strob_NA", "0206f7a2e972d9dfef1c424c731503a0a27de1ba7a15a91a362dc7ec0d0fb47685" }, - {"dwy_EU", "020a77f454a1d3fcdc0312048fc58d713fe6153189e0c59cdd12fedbf09553d4b0" }, + {"dwy_EU", "021c7cf1f10c4dc39d13451123707ab780a741feedab6ac449766affe37515a29e" }, {"phm87_SH", "021773a38db1bc3ede7f28142f901a161c7b7737875edbb40082a201c55dcf0add" }, - {"chainmakers_NA", "021ad488cc063e17d0f1a2aade6be65ef8b5ff879987cb0b86bb700733099fe524" }, + {"chainmakers_NA", "02285d813c30c0bf7eefdab1ff0a8ad08a07a0d26d8b95b3943ce814ac8e24d885" }, {"indenodes_EU", "0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c" }, {"blackjok3r_SH", "0226293d7644e1380555ecc2d385ba038a66f4202b24b643ab31bcad0dc1474de2" }, - {"chainmakers_EU", "022a6b583e8820d14d911a11820fd80853c5b8406e91a0a6fcac1f133d098d75cb" }, + {"chainmakers_EU", "03fdf5a3fce8db7dee89724e706059c32e5aa3f233a6b6cc256fea337f05e3dbf7" }, {"titomane_AR", "023e3aa9834c46971ff3e7cb86a200ec9c8074a9566a3ea85d400d5739662ee989" }, - {"fullmoon_SH", "02639998420688ee935d279d1cd52f1c6f3ae12c1f3afc20b3bf7ece1057f8b93b" }, // 10 + {"fullmoon_SH", "023b7252968ea8a955cd63b9e57dee45a74f2d7ba23b4e0595572138ad1fb42d21" }, // 10 {"indenodes_NA", "02698c6f1c9e43b66e82dbb163e8df0e5a2f62f3a7a882ca387d82f86e0b3fa988" }, {"chmex_EU", "0281304ebbcc39e4f09fda85f4232dd8dacd668e20e5fc11fba6b985186c90086e" }, {"metaphilibert_SH", "0284af1a5ef01503e6316a2ca4abf8423a794e9fc17ac6846f042b6f4adedc3309" }, {"ca333_DEV", "02856843af2d9457b5b1c907068bef6077ea0904cc8bd4df1ced013f64bf267958" }, {"cipi_NA", "02858904a2a1a0b44df4c937b65ee1f5b66186ab87a751858cf270dee1d5031f18" }, {"pungocloud_SH", "02863628f842a8aa424daf745cf43a1717cfcd571338ba87bfcec4d340703d01d6" }, - {"voskcoin_EU", "028cfb0bbce2207425bc8d40fff634269bb61aade2d1d03883398275550b465600" }, + {"voskcoin_EU", "0221365d89a6f6373b15daa4a50d56d34ad1b4b8a48a7fd090163b6b5a5ecd7a0a" }, {"decker_DEV", "028eea44a09674dda00d88ffd199a09c9b75ba9782382cc8f1e97c0fd565fe5707" }, {"cryptoeconomy_EU", "0290ab4937e85246e048552df3e9a66cba2c1602db76e03763e16c671e750145d1" }, - {"etszombi_EU", "0293ea48d8841af7a419a24d9da11c34b39127ef041f847651bae6ab14dcd1f6b4" }, // 20 + {"etszombi_EU", "0293ea48d8841af7a419a24d9da11c34b39127ef041f847651bae6ab14dcd1f6b4" }, // 20 {"karasugoi_NA", "02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982" }, {"pirate_AR", "02a5e865af771eee0c6bd3bd238f01f5eb589907ba52efa9f37e5102375c8eb7a0" }, {"metaphilibert_AR", "02adad675fae12b25fdd0f57250b0caf7f795c43f346153a31fe3e72e7db1d6ac6" }, - {"zatjum_SH", "02b315714f99fdd70bafd50a4c3aa4b9db0fd8d63978bd8d47763773400b28734c" }, - {"madmax_AR", "02b37913ac0250d17cca5bb94ef65928b1515f13f839075446db73b9b067c13aa0" }, - {"lukechilds_NA", "02c191a085bbb0bd86d126c62d3e801c503038b69c0c2de121c9a7abe3e6684420" }, + {"zatjum_SH", "02d6b0c89cacd58a0af038139a9a90c9e02cd1e33803a1f15fceabea1f7e9c263a" }, + {"madmax_AR", "03c5941fe49d673c094bc8e9bb1a95766b4670c88be76d576e915daf2c30a454d3" }, + {"lukechilds_NA", "03f1051e62c2d280212481c62fe52aab0a5b23c95de5b8e9ad5f80d8af4277a64b" }, {"cipi_AR", "02c4f89a5b382750836cb787880d30e23502265054e1c327a5bfce67116d757ce8" }, {"tonyl_AR", "02cc8bc862f2b65ad4f99d5f68d3011c138bf517acdc8d4261166b0be8f64189e1" }, {"infotech_DEV", "02d7d63ac441dbcd5535bcad741701519c190e89e17e4180aa0f61fdda0b6195ea" }, - {"fullmoon_NA", "02da228a67e519b21bca6426ed982509a21d24d45f1ac1bdf698b6083fed442ec3" }, // 30 + {"fullmoon_NA", "032c716701fe3a6a3f90a97b9d874a9d6eedb066419209eed7060b0cc6b710c60b" }, // 30 {"etszombi_AR", "02e55e104aa94f70cde68165d7df3e162d4410c76afd4643b161dea044aa6d06ce" }, {"node-9_EU", "02e90f0528f8fd7d2b7f28d53ed7368cc4b1dfc5814c70c486c533862ee05e37dc" }, - {"phba2061_EU", "02eaa599f5434039adc5748b3b830f605342e11b51273046b04f24acc5bcecc74a" }, + {"phba2061_EU", "03f6bd15dba7e986f0c976ea19d8a9093cb7c989d499f1708a0386c5c5659e6c4e" }, {"indenodes_AR", "02ec0fa5a40f47fd4a38ea5c89e375ad0b6ddf4807c99733c9c3dc15fb978ee147" }, {"and1-89_EU", "02f2af778c62888cfb106c0ef5c89cefe012ef3e6abed3ef28425092637d7ae3cc" }, - {"komodopioneers_SH", "02ffde73d51b56bf9e23b6f03008ac7916cacd3be090f44eab59877792e08b6751" }, - {"komodopioneers_EU", "03014f3fceb9f851f9dba5f5b371c7758b3f1fe44a70b4e60e3d6c70d1e5265358" }, + {"komodopioneers_SH", "032a238a5747777da7e819cfa3c859f3677a2daf14e4dce50916fc65d00ad9c52a" }, + {"komodopioneers_EU", "036d02425916444fff8cc7203fcbfc155c956dda5ceb647505836bef59885b6866" }, {"d0ct0r_NA", "0303725d8525b6f969122faf04152653eb4bf34e10de92182263321769c334bf58" }, - {"kolo_DEV", "030f34af4b908fb8eb2099accb56b8d157d49f6cfb691baa80fdd34f385efed961" }, - {"peer2cloud_AR", "030fe3c77db0f91d79c26f951b674bba557b899f16570cd75332829a07031b0097" }, // 40 + {"kolo_DEV", "02849e12199dcc27ba09c3902686d2ad0adcbfcee9d67520e9abbdda045ba83227" }, + {"peer2cloud_AR", "030fe3c77db0f91d79c26f951b674bba557b899f16570cd75332829a07031b0097" }, // 40 {"webworker01_SH", "031e50ba6de3c16f99d414bb89866e578d963a54bde7916c810608966fb5700776" }, {"webworker01_NA", "032735e9cad1bb00eaababfa6d27864fa4c1db0300c85e01e52176be2ca6a243ce" }, - {"pbca26_NA", "0331c51abb78a9891d1b9483747a7fd9bbbbdd5256f40af23c87384e3d9a974289" }, + {"pbca26_NA", "03a97606153d52338bcffd1bf19bb69ef8ce5a7cbdc2dbc3ff4f89d91ea6bbb4dc" }, {"indenodes_SH", "0334e6e1ec8285c4b85bd6dae67e17d67d1f20e7328efad17ce6fd24ae97cdd65e" }, {"pirate_NA", "033c8cef71f704f357c9ac1aeaafde3acd7bbfd0a09494e5e129ee0999fb2bc368" }, - {"lukechilds_AR", "035004d780316008c8afd5ac28d08aae56f4746bf70eb2c999e3c7d9a7a50ca8b6" }, - {"dragonhound_NA", "0354c779b9b111fdc825ee0250b33a79a837e0775a111a89916853d02a8999285c" }, - {"fullmoon_AR", "035673e913d603137f7f517d88bf316e51d408e0ec2b2cdcbfbdd5c0b553fc9351" }, + {"lukechilds_AR", "025c6a73ff6d750b9ddf6755b390948cffdd00f344a639472d398dd5c6b4735d23" }, + {"dragonhound_NA", "0224a9d951d3a06d8e941cc7362b788bb1237bb0d56cc313e797eb027f37c2d375" }, + {"fullmoon_AR", "03da64dd7cd0db4c123c2f79d548a96095a5a103e5b9d956e9832865818ffa7872" }, {"chainzilla_SH", "0360804b8817fd25ded6e9c0b50e3b0782ac666545b5416644198e18bc3903d9f9" }, - {"titomane_EU", "03772ac0aad6b0e9feec5e591bff5de6775d6132e888633e73d3ba896bdd8e0afb" }, // 50 + {"titomane_EU", "03772ac0aad6b0e9feec5e591bff5de6775d6132e888633e73d3ba896bdd8e0afb" }, // 50 {"jeezy_EU", "037f182facbad35684a6e960699f5da4ba89e99f0d0d62a87e8400dd086c8e5dd7" }, {"titomane_SH", "03850fdddf2413b51790daf51dd30823addb37313c8854b508ea6228205047ef9b" }, {"alien_AR", "03911a60395801082194b6834244fa78a3c30ff3e888667498e157b4aa80b0a65f" }, {"pirate_EU", "03986339bebe3891e369a528356a220bc17a5bef3d337edfcf0114e66e6b1c120f" }, - {"thegaltmines_NA", "03b113c7aa1042c965154bf791713f562891ac75e60ab78886205535bcaabb5013" }, - {"computergenie_NA", "03b41c764c8cd63b48b79f15f112a9b5105a0dce35df7d6990d6919503a1f3f245" }, - {"nutellalicka_SH", "03b422ec85a8465ae42e7004bc6d0856a458f0f920ec0f58fd4d5613994f3faa5b" }, + {"thegaltmines_NA", "02db1a16c7043f45d6033ccfbd0a51c2d789b32db428902f98b9e155cf0d7910ed" }, + {"computergenie_NA", "03a78ae070a5e9e935112cf7ea8293f18950f1011694ea0260799e8762c8a6f0a4" }, + {"nutellalicka_SH", "02f7d90d0510c598ce45915e6372a9cd0ba72664cb65ce231f25d526fc3c5479fc" }, {"chainstrike_SH", "03b806be3bf7a1f2f6290ec5c1ea7d3ea57774dcfcf2129a82b2569e585100e1cb" }, - {"dwy_SH", "03b9162f9713d7cddd89aaad0398b67f66377cc17547ec0643a67c2d6fb099ecf0" }, // 60 - {"alien_EU", "03bb749e337b9074465fa28e757b5aa92cb1f0fea1a39589bca91a602834d443cd" }, - {"gt_AR", "03e22a6aad65c9a4c2ce2e724b26edf631b5f41253449dd5feaeba68e7c0cf3058" }, + {"dwy_SH", "036536d2d52d85f630b68b050f29ea1d7f90f3b42c10f8c5cdf3dbe1359af80aff" }, + {"alien_EU", "03bb749e337b9074465fa28e757b5aa92cb1f0fea1a39589bca91a602834d443cd" }, // 60 + {"gt_AR", "0348430538a4944d3162bb4749d8c5ed51299c2434f3ee69c11a1f7815b3f46135" }, {"patchkez_SH", "03f45e9beb5c4cd46525db8195eb05c1db84ae7ef3603566b3d775770eba3b96ee" }, - {"decker_AR", "03ffdf1a116300a78729608d9930742cd349f11a9d64fcc336b8f18592dd9c91bc" }, + {"decker_AR", "03ffdf1a116300a78729608d9930742cd349f11a9d64fcc336b8f18592dd9c91bc" }, // 63 } }; From 34192e2b229868d356f98c78527346a0887f9775 Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 00:18:16 +0200 Subject: [PATCH 35/65] add multi OS ifdef added ifdef directives for conditional mutli OS build --- src/wallet/db.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wallet/db.h b/src/wallet/db.h index 3aaf3d34b..8ad246de4 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -34,7 +34,13 @@ #include #ifdef BUILD_ROGUE - #include "../depends/x86_64-unknown-linux-gnu/include/db_cxx.h" + #ifdef __APPLE__ + #include "../depends/x86_64-apple-darwin18.6.0/include/db_cxx.h" + #elif defined(_WIN32) + #include "../depends/x86_64-w64-mingw32/include/db_cxx.h" + #else + #include "../depends/x86_64-unknown-linux-gnu/include/db_cxx.h" + #endif #else #include #endif From 77ceea9b15051e8d15031f1ca5405b8186d23793 Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 00:32:19 +0200 Subject: [PATCH 36/65] fix multi OS build --- src/cc/makerogue | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/cc/makerogue b/src/cc/makerogue index a389ba2dd..ff16cbb16 100755 --- a/src/cc/makerogue +++ b/src/cc/makerogue @@ -35,6 +35,3 @@ else echo ROGUE BUILD FAILED exit 1 fi - -rm ../libcc.so -cp librogue.so ../libcc.so From 507cb56c5dbcd413a98342e7a574409cf31553a4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Jun 2019 21:33:46 -1100 Subject: [PATCH 37/65] Tweak batches --- src/cc/dapps/zmigrate.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 5144b4cf4..056d2c402 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -1083,12 +1083,12 @@ void scan_claims(int32_t issueflag,char *refcoin,int32_t batchid) } else if ( batchid == 2 ) { - batchmin = 777 * SATOSHIDEN; - batchmax = 7777 * SATOSHIDEN; + batchmin = 1;//777 * SATOSHIDEN; + batchmax = 17777 * SATOSHIDEN; } else if ( batchid == 3 ) { - batchmin = 7777 * SATOSHIDEN; + batchmin = 17777 * SATOSHIDEN; batchmax = 1000000 * SATOSHIDEN; } for (i=0; i Date: Sun, 9 Jun 2019 22:12:54 -1100 Subject: [PATCH 38/65] Asset chains dust --- src/cc/dapps/zmigrate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 056d2c402..6e5cffba1 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -315,6 +315,8 @@ cJSON *get_komodocli(char *refcoin,char **retstrp,char *acname,char *method,char { long fsize; cJSON *retjson = 0; char cmdstr[32768],*jsonstr,fname[256]; sprintf(fname,"/tmp/zmigrate.%s",method); + if ( (acname == 0 || acname[0] == 0) && strcmp(refcoin,"KMD") != 0 ) + acname = refcoin; if ( acname[0] != 0 ) { if ( refcoin[0] != 0 && strcmp(refcoin,"KMD") != 0 ) @@ -1328,7 +1330,7 @@ int32_t main(int32_t argc,char **argv) } printf("total disputed %.8f\n",dstr(totaldisputed)); totaldisputed2 = 0; - if ( (retjson= get_listunspent(coinstr,"")) != 0 ) + if ( strcmp(coinstr,"KMD") == 0 && (retjson= get_listunspent(coinstr,"")) != 0 ) { if ( (n= cJSON_GetArraySize(retjson)) > 0 ) { From c9a943a86ef59bca5679c580d6eb911ad94fae0a Mon Sep 17 00:00:00 2001 From: Alrighttt Date: Mon, 10 Jun 2019 10:50:23 +0000 Subject: [PATCH 39/65] add oracles, faucet to DICE; add tokens to COQUI --- src/komodo_utils.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 93d4f245e..08e821318 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -2313,6 +2313,8 @@ void komodo_args(char *argv0) ASSETCHAINS_CCDISABLES[230] = 0; // DICE ASSETCHAINS_CCDISABLES[235] = 0; // CHANNELS ASSETCHAINS_CCDISABLES[236] = 0; // ORACLES + ASSETCHAINS_CCDISABLES[227] = 0; // ASSETS + ASSETCHAINS_CCDISABLES[242] = 0; // TOKENS } if ( strcmp("DION",ASSETCHAINS_SYMBOL) == 0 ) { @@ -2348,7 +2350,9 @@ void komodo_args(char *argv0) if ( strcmp("KMDICE",ASSETCHAINS_SYMBOL) == 0 ) { memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + ASSETCHAINS_CCDISABLES[228] = 0; // FAUCET ASSETCHAINS_CCDISABLES[230] = 0; // DICE + ASSETCHAINS_CCDISABLES[236] = 0; // ORACLES } } else BITCOIND_RPCPORT = GetArg("-rpcport", BaseParams().RPCPort()); KOMODO_DPOWCONFS = GetArg("-dpowconfs",dpowconfs); From 4993e1c4778d85b1cb0cba674a905c4d89f3d74b Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Jun 2019 00:06:04 -1100 Subject: [PATCH 40/65] +pritns --- src/cc/dapps/zmigrate.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 6e5cffba1..0d1dcd5b7 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -1246,7 +1246,7 @@ int64_t sum_of_vins(char *refcoin,int32_t *totalvinsp,int32_t *uniqaddrsp,bits25 { if ( update_addrstats(srcaddr,amount) < 0 ) (*uniqaddrsp)++; - //printf("add %s <- %.8f\n",srcaddr,dstr(amount)); + printf("add %s <- %.8f\n",srcaddr,dstr(amount)); total += amount; (*totalvinsp)++; } @@ -1391,6 +1391,7 @@ int32_t main(int32_t argc,char **argv) } else if ( (retjson= get_listunspent(coinstr,"")) != 0 ) { + printf("unspents.(%s)\n",jprint(retjson,0)); if ( (n= cJSON_GetArraySize(retjson)) > 0 ) { for (i=0; i= 7 ) - { - numsmall++; - smallpayout += payout; + //if ( payout >= 7 ) + //{ + // numsmall++; + //smallpayout += payout; genpayout(coinstr,ADDRESSES[i].addr,payout); - } + //} //printf("%-4d: %-64s numutxos.%-4lld %llu\n",i,ADDRESSES[i].addr,ADDRESSES[i].numutxos,(long long)payout); } } From 553f53f11f972ada1f55fc8a88ba3f29ec63ec23 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Jun 2019 00:11:59 -1100 Subject: [PATCH 41/65] +prints --- src/cc/dapps/zmigrate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 0d1dcd5b7..9880cd437 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -331,6 +331,7 @@ cJSON *get_komodocli(char *refcoin,char **retstrp,char *acname,char *method,char //printf("ref.(%s) REFCOIN_CLI (%s)\n",refcoin,cmdstr); } system(cmdstr); + printf("cmdstr(%s)\n",cmdstr); *retstrp = 0; if ( (jsonstr= filestr(&fsize,fname)) != 0 ) { @@ -1299,7 +1300,7 @@ void reconcile_claims(char *fname) int32_t main(int32_t argc,char **argv) { - char *coinstr,*addr,buf[64],srcaddr[64],str[65]; cJSON *retjson,*item; int32_t i,n,disputed,numdisputed,numsmall=0,numpayouts=0,numclaims=0,num=0,totalvins=0,uniqaddrs=0; int64_t amount,total = 0,total2 = 0,payout,maxpayout,smallpayout=0,totalpayout = 0,totaldisputed = 0,totaldisputed2 = 0,fundingamount = 0; + char *coinstr,*acstr,*addr,buf[64],srcaddr[64],str[65]; cJSON *retjson,*item; int32_t i,n,disputed,numdisputed,numsmall=0,numpayouts=0,numclaims=0,num=0,totalvins=0,uniqaddrs=0; int64_t amount,total = 0,total2 = 0,payout,maxpayout,smallpayout=0,totalpayout = 0,totaldisputed = 0,totaldisputed2 = 0,fundingamount = 0; if ( argc != 2 ) { printf("argc needs to be 2: coin\n"); @@ -1309,12 +1310,14 @@ int32_t main(int32_t argc,char **argv) { REFCOIN_CLI = "./komodo-cli"; coinstr = clonestr("KMD"); + acstr = ""; } else { sprintf(buf,"./komodo-cli -ac_name=%s",argv[1]); REFCOIN_CLI = clonestr(buf); coinstr = clonestr(argv[1]); + acstr = coinstr; } if ( 1 ) { @@ -1330,7 +1333,7 @@ int32_t main(int32_t argc,char **argv) } printf("total disputed %.8f\n",dstr(totaldisputed)); totaldisputed2 = 0; - if ( strcmp(coinstr,"KMD") == 0 && (retjson= get_listunspent(coinstr,"")) != 0 ) + if ( strcmp(coinstr,"KMD") == 0 && (retjson= get_listunspent(coinstr,acstr)) != 0 ) { if ( (n= cJSON_GetArraySize(retjson)) > 0 ) { @@ -1389,7 +1392,7 @@ int32_t main(int32_t argc,char **argv) scan_claims(0,coinstr,2); //scan_claims(0,coinstr,3); } - else if ( (retjson= get_listunspent(coinstr,"")) != 0 ) + else if ( (retjson= get_listunspent(coinstr,acstr)) != 0 ) { printf("unspents.(%s)\n",jprint(retjson,0)); if ( (n= cJSON_GetArraySize(retjson)) > 0 ) From 5197c502e92696bc488161fdfa53f52b5ec4f3a6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Jun 2019 00:13:50 -1100 Subject: [PATCH 42/65] Fix ac --- src/cc/dapps/zmigrate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 9880cd437..4f5efc5ac 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -331,7 +331,6 @@ cJSON *get_komodocli(char *refcoin,char **retstrp,char *acname,char *method,char //printf("ref.(%s) REFCOIN_CLI (%s)\n",refcoin,cmdstr); } system(cmdstr); - printf("cmdstr(%s)\n",cmdstr); *retstrp = 0; if ( (jsonstr= filestr(&fsize,fname)) != 0 ) { @@ -1319,7 +1318,7 @@ int32_t main(int32_t argc,char **argv) coinstr = clonestr(argv[1]); acstr = coinstr; } - if ( 1 ) + if ( strcmp(coinstr,"KMD") == 0 ) { sprintf(buf,"%s-Claims.csv",coinstr); reconcile_claims(buf); @@ -1333,7 +1332,7 @@ int32_t main(int32_t argc,char **argv) } printf("total disputed %.8f\n",dstr(totaldisputed)); totaldisputed2 = 0; - if ( strcmp(coinstr,"KMD") == 0 && (retjson= get_listunspent(coinstr,acstr)) != 0 ) + if ( (retjson= get_listunspent(coinstr,acstr)) != 0 ) { if ( (n= cJSON_GetArraySize(retjson)) > 0 ) { From eb99b6f6623a00d1c4ad94355b2db22110cf602a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Jun 2019 00:14:48 -1100 Subject: [PATCH 43/65] -print --- src/cc/dapps/zmigrate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 4f5efc5ac..aaad17a39 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -315,8 +315,8 @@ cJSON *get_komodocli(char *refcoin,char **retstrp,char *acname,char *method,char { long fsize; cJSON *retjson = 0; char cmdstr[32768],*jsonstr,fname[256]; sprintf(fname,"/tmp/zmigrate.%s",method); - if ( (acname == 0 || acname[0] == 0) && strcmp(refcoin,"KMD") != 0 ) - acname = refcoin; + //if ( (acname == 0 || acname[0] == 0) && strcmp(refcoin,"KMD") != 0 ) + // acname = refcoin; if ( acname[0] != 0 ) { if ( refcoin[0] != 0 && strcmp(refcoin,"KMD") != 0 ) @@ -1393,7 +1393,6 @@ int32_t main(int32_t argc,char **argv) } else if ( (retjson= get_listunspent(coinstr,acstr)) != 0 ) { - printf("unspents.(%s)\n",jprint(retjson,0)); if ( (n= cJSON_GetArraySize(retjson)) > 0 ) { for (i=0; i Date: Mon, 10 Jun 2019 20:51:52 +0800 Subject: [PATCH 44/65] Change ccEnable/Disable to macro --- src/cc/CCinclude.h | 2 ++ src/komodo_utils.h | 47 +++++++++++++++++++++++----------------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/cc/CCinclude.h b/src/cc/CCinclude.h index 3681cf2f3..d9f08f624 100644 --- a/src/cc/CCinclude.h +++ b/src/cc/CCinclude.h @@ -59,6 +59,8 @@ one other technical note is that komodod has the insight-explorer extensions bui #define SMALLVAL 0.000000000000001 #define SATOSHIDEN ((uint64_t)100000000L) #define dstr(x) ((double)(x) / SATOSHIDEN) +#define CCDISABLE memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)) +#define CCENABLE 0 #ifndef _BITS256 #define _BITS256 diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 08e821318..36bbb42fb 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -14,6 +14,7 @@ ******************************************************************************/ #include "komodo_defs.h" #include "key_io.h" +#include "cc/CCinclude.h" #include #ifdef _WIN32 @@ -2299,60 +2300,60 @@ void komodo_args(char *argv0) // Set cc enables for all existing ac_cc chains here. if ( strcmp("AXO",ASSETCHAINS_SYMBOL) == 0 ) { - // No CCs used on this chain yet please ask AXO777 what he needs. - memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + // No CCs used on this chain yet. + CCDISABLE; } if ( strcmp("CCL",ASSETCHAINS_SYMBOL) == 0 ) { // No CCs used on this chain yet. - memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + CCDISABLE; } if ( strcmp("COQUI",ASSETCHAINS_SYMBOL) == 0 ) { - memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); - ASSETCHAINS_CCDISABLES[230] = 0; // DICE - ASSETCHAINS_CCDISABLES[235] = 0; // CHANNELS - ASSETCHAINS_CCDISABLES[236] = 0; // ORACLES - ASSETCHAINS_CCDISABLES[227] = 0; // ASSETS - ASSETCHAINS_CCDISABLES[242] = 0; // TOKENS + CCDISABLE; + ASSETCHAINS_CCDISABLES[230] = CCENABLE;; // DICE + ASSETCHAINS_CCDISABLES[235] = CCENABLE;; // CHANNELS + ASSETCHAINS_CCDISABLES[236] = CCENABLE;; // ORACLES + ASSETCHAINS_CCDISABLES[227] = CCENABLE;; // ASSETS + ASSETCHAINS_CCDISABLES[242] = CCENABLE;; // TOKENS } if ( strcmp("DION",ASSETCHAINS_SYMBOL) == 0 ) { // No CCs used on this chain yet. - memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + CCDISABLE; } if ( strcmp("EQL",ASSETCHAINS_SYMBOL) == 0 ) { // No CCs used on this chain yet. - memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + CCDISABLE; } if ( strcmp("ILN",ASSETCHAINS_SYMBOL) == 0 ) { // No CCs used on this chain yet. - memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); + CCDISABLE; } if ( strcmp("MORTY",ASSETCHAINS_SYMBOL) == 0 ) { - memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); - ASSETCHAINS_CCDISABLES[228] = 0; // FAUCET + CCDISABLE; + ASSETCHAINS_CCDISABLES[228] = CCENABLE;; // FAUCET } if ( strcmp("RICK",ASSETCHAINS_SYMBOL) == 0 ) { - memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); - ASSETCHAINS_CCDISABLES[228] = 1; // FAUCET + CCDISABLE; + ASSETCHAINS_CCDISABLES[228] = CCENABLE;; // FAUCET } if ( strcmp("SEC",ASSETCHAINS_SYMBOL) == 0 ) { - memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); - ASSETCHAINS_CCDISABLES[227] = 0; // ASSETS - ASSETCHAINS_CCDISABLES[242] = 0; // TOKENS + CCDISABLE; + ASSETCHAINS_CCDISABLES[227] = CCENABLE;; // ASSETS + ASSETCHAINS_CCDISABLES[242] = CCENABLE;; // TOKENS } if ( strcmp("KMDICE",ASSETCHAINS_SYMBOL) == 0 ) { - memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)); - ASSETCHAINS_CCDISABLES[228] = 0; // FAUCET - ASSETCHAINS_CCDISABLES[230] = 0; // DICE - ASSETCHAINS_CCDISABLES[236] = 0; // ORACLES + CCDISABLE; + ASSETCHAINS_CCDISABLES[228] = CCENABLE;; // FAUCET + ASSETCHAINS_CCDISABLES[230] = CCENABLE;; // DICE + ASSETCHAINS_CCDISABLES[236] = CCENABLE;; // ORACLES } } else BITCOIND_RPCPORT = GetArg("-rpcport", BaseParams().RPCPort()); KOMODO_DPOWCONFS = GetArg("-dpowconfs",dpowconfs); From fd23e3a914d09d2a6dbdc9997fc84945a96b9712 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Mon, 10 Jun 2019 23:30:13 +0800 Subject: [PATCH 45/65] add -ac_ccactivateht=. Fix oracles timestamp activation, to stop loading block from disk for no reason. --- src/cc/eval.cpp | 9 +++++++-- src/cc/oracles.cpp | 7 +------ src/komodo_defs.h | 2 ++ src/komodo_globals.h | 2 ++ src/komodo_utils.h | 23 ++++++++++++++++++++++- src/wallet/rpcwallet.cpp | 9 +++++++-- 6 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/cc/eval.cpp b/src/cc/eval.cpp index a23a7b16c..c580753cf 100644 --- a/src/cc/eval.cpp +++ b/src/cc/eval.cpp @@ -78,8 +78,13 @@ bool Eval::Dispatch(const CC *cond, const CTransaction &txTo, unsigned int nIn) uint8_t ecode = cond->code[0]; if ( ASSETCHAINS_CCDISABLES[ecode] != 0 ) { - fprintf(stderr,"%s evalcode.%d %02x\n",txTo.GetHash().GetHex().c_str(),ecode,ecode); - return Invalid("disabled-code, -ac_ccenables didnt include this ecode"); + // check if a height activation has been set. + if ( mapHeightEvalActivate[ecode] == 0 || this->GetCurrentHeight() == 0 || mapHeightEvalActivate[ecode] > this->GetCurrentHeight() ) + { + fprintf(stderr,"%s evalcode.%d %02x\n",txTo.GetHash().GetHex().c_str(),ecode,ecode); + fprintf(stderr, "ac_ccactivateht: evalcode.%i activates at height.%i vs current height.%i\n", ecode, mapHeightEvalActivate[ecode], this->GetCurrentHeight()); + return Invalid("disabled-code, -ac_ccenables didnt include this ecode"); + } } std::vector vparams(cond->code+1, cond->code+cond->codeLength); if ( ecode >= EVAL_FIRSTUSER && ecode <= EVAL_LASTUSER ) diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index f019ae271..193f66a1a 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -642,11 +642,7 @@ int32_t GetLatestTimestamp(int32_t height) blockHash = chainActive[height]->GetBlockHash(); pindex = mapBlockIndex[blockHash]; - if ( komodo_blockload(block,pindex) == 0 ) - { - return(block.nTime); - } - return(0); + return(pindex->nTime); } bool OraclesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn) @@ -1208,4 +1204,3 @@ UniValue OraclesList() } return(result); } - diff --git a/src/komodo_defs.h b/src/komodo_defs.h index 36e26a310..226600d6f 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -303,6 +303,7 @@ extern int32_t KOMODO_TESTNODE, KOMODO_SNAPSHOT_INTERVAL; extern int32_t ASSETCHAINS_EARLYTXIDCONTRACT; int tx_height( const uint256 &hash ); extern std::vector vWhiteListAddress; +extern std::map mapHeightEvalActivate; void komodo_netevent(std::vector payload); int32_t getacseason(uint32_t timestamp); @@ -333,6 +334,7 @@ uint32_t komodo_heightstamp(int32_t height); int64_t komodo_pricemult(int32_t ind); int32_t komodo_priceget(int64_t *buf64,int32_t ind,int32_t height,int32_t numblocks); uint64_t komodo_accrued_interest(int32_t *txheightp,uint32_t *locktimep,uint256 hash,int32_t n,int32_t checkheight,uint64_t checkvalue,int32_t tipheight); +int32_t komodo_currentheight(); #endif diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 9d6d97100..d8e292431 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -115,6 +115,8 @@ int32_t KOMODO_TESTNODE, KOMODO_SNAPSHOT_INTERVAL; CScript KOMODO_EARLYTXID_SCRIPTPUB; int32_t ASSETCHAINS_EARLYTXIDCONTRACT; +std::map mapHeightEvalActivate; + struct komodo_kv *KOMODO_KV; pthread_mutex_t KOMODO_KV_mutex,KOMODO_CC_mutex; diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 36bbb42fb..4bcd9d7da 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1692,7 +1692,7 @@ int8_t equihash_params_possible(uint64_t n, uint64_t k) void komodo_args(char *argv0) { - std::string name,addn,hexstr,symbol; char *dirname,fname[512],arg0str[64],magicstr[9]; uint8_t magic[4],extrabuf[32756],disablebits[32],*extraptr=0; FILE *fp; uint64_t val; uint16_t port; int32_t i,nonz=0,baseid,len,n,extralen = 0; uint64_t ccenables[256]; + std::string name,addn,hexstr,symbol; char *dirname,fname[512],arg0str[64],magicstr[9]; uint8_t magic[4],extrabuf[32756],disablebits[32],*extraptr=0; FILE *fp; uint64_t val; uint16_t port; int32_t i,nonz=0,baseid,len,n,extralen = 0; uint64_t ccenables[256], ccEnablesHeight[512]; IS_KOMODO_NOTARY = GetBoolArg("-notary", false); IS_STAKED_NOTARY = GetArg("-stakednotary", -1); memset(ccenables,0,sizeof(ccenables)); @@ -1757,6 +1757,27 @@ void komodo_args(char *argv0) ASSETCHAINS_PRIVATE = GetArg("-ac_private",0); KOMODO_SNAPSHOT_INTERVAL = GetArg("-ac_snapshot",0); Split(GetArg("-ac_nk",""), ASSETCHAINS_NK, 0); + + // -ac_ccactivateht=evalcode,height,evalcode,height,evalcode,height.... + Split(GetArg("-ac_ccactivateht",""), ccEnablesHeight, 0); + // fill map with all eval codes and activation height of 0. + for ( int i = 0; i < 256; i++ ) + mapHeightEvalActivate[i] = 0; + for ( int i = 0; i < 512; i++ ) + { + int32_t ecode = ccEnablesHeight[i]; + int32_t ht = ccEnablesHeight[i+1]; + if ( ecode > 256 ) + fprintf(stderr, "ac_ccactivateht: invalid evalcode.%i must be between 0 and 256.\n", ecode); + else if ( ht > 0 ) + { + // update global map. + mapHeightEvalActivate[ecode] = ht; + fprintf(stderr, "ac_ccactivateht: ecode.%i activates at height.%i\n", ecode, mapHeightEvalActivate[ecode]); + } + i++; + } + if ( (KOMODO_REWIND= GetArg("-rewind",0)) != 0 ) { printf("KOMODO_REWIND %d\n",KOMODO_REWIND); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index aa5876e23..bf861662f 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5342,8 +5342,13 @@ int32_t ensure_CCrequirements(uint8_t evalcode) CCerror = ""; if ( ASSETCHAINS_CCDISABLES[evalcode] != 0 || (evalcode == EVAL_MARMARA && ASSETCHAINS_MARMARA == 0) ) { - fprintf(stderr,"evalcode %d disabled\n",evalcode); - return(-1); + // check if a height activation has been set. + fprintf(stderr, "evalcode.%i activates at height. %i current height.%i\n", evalcode, mapHeightEvalActivate[evalcode], komodo_currentheight()); + if ( mapHeightEvalActivate[evalcode] == 0 || komodo_currentheight() == 0 || mapHeightEvalActivate[evalcode] > komodo_currentheight() ) + { + fprintf(stderr,"evalcode %d disabled\n",evalcode); + return(-1); + } } if ( NOTARY_PUBKEY33[0] == 0 ) { From cab05f7f01889b93aa23d05475b78dc1fde0725d Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Mon, 10 Jun 2019 23:53:11 +0800 Subject: [PATCH 46/65] fix --- src/cc/CCinclude.h | 4 ++-- src/komodo_utils.h | 50 ++++++++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/cc/CCinclude.h b/src/cc/CCinclude.h index d9f08f624..1d8cf669e 100644 --- a/src/cc/CCinclude.h +++ b/src/cc/CCinclude.h @@ -59,8 +59,8 @@ one other technical note is that komodod has the insight-explorer extensions bui #define SMALLVAL 0.000000000000001 #define SATOSHIDEN ((uint64_t)100000000L) #define dstr(x) ((double)(x) / SATOSHIDEN) -#define CCDISABLE memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)) -#define CCENABLE 0 +#define CCDISABLEALL memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES)) +#define CCENABLE(x) ASSETCHAINS_CCDISABLES[((uint8_t)x)] = 0 #ifndef _BITS256 #define _BITS256 diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 4bcd9d7da..94ac60515 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -2322,59 +2322,61 @@ void komodo_args(char *argv0) if ( strcmp("AXO",ASSETCHAINS_SYMBOL) == 0 ) { // No CCs used on this chain yet. - CCDISABLE; + CCDISABLEALL; } if ( strcmp("CCL",ASSETCHAINS_SYMBOL) == 0 ) { // No CCs used on this chain yet. - CCDISABLE; + CCDISABLEALL; } if ( strcmp("COQUI",ASSETCHAINS_SYMBOL) == 0 ) { - CCDISABLE; - ASSETCHAINS_CCDISABLES[230] = CCENABLE;; // DICE - ASSETCHAINS_CCDISABLES[235] = CCENABLE;; // CHANNELS - ASSETCHAINS_CCDISABLES[236] = CCENABLE;; // ORACLES - ASSETCHAINS_CCDISABLES[227] = CCENABLE;; // ASSETS - ASSETCHAINS_CCDISABLES[242] = CCENABLE;; // TOKENS + CCDISABLEALL; + CCENABLE(EVAL_DICE); + CCENABLE(EVAL_CHANNELS); + CCENABLE(EVAL_ORACLES); + CCENABLE(EVAL_ASSETS); + CCENABLE(EVAL_TOKENS); } if ( strcmp("DION",ASSETCHAINS_SYMBOL) == 0 ) { // No CCs used on this chain yet. - CCDISABLE; + CCDISABLEALL; } + if ( strcmp("EQL",ASSETCHAINS_SYMBOL) == 0 ) { // No CCs used on this chain yet. - CCDISABLE; + CCDISABLEALL; } if ( strcmp("ILN",ASSETCHAINS_SYMBOL) == 0 ) { // No CCs used on this chain yet. - CCDISABLE; + CCDISABLEALL; } - if ( strcmp("MORTY",ASSETCHAINS_SYMBOL) == 0 ) + if ( strcmp("OUR",ASSETCHAINS_SYMBOL) == 0 ) { - CCDISABLE; - ASSETCHAINS_CCDISABLES[228] = CCENABLE;; // FAUCET + // No CCs used on this chain yet. + CCDISABLEALL; } - if ( strcmp("RICK",ASSETCHAINS_SYMBOL) == 0 ) + if ( strcmp("ZEXO",ASSETCHAINS_SYMBOL) == 0 ) { - CCDISABLE; - ASSETCHAINS_CCDISABLES[228] = CCENABLE;; // FAUCET + // No CCs used on this chain yet. + CCDISABLEALL; } if ( strcmp("SEC",ASSETCHAINS_SYMBOL) == 0 ) { - CCDISABLE; - ASSETCHAINS_CCDISABLES[227] = CCENABLE;; // ASSETS - ASSETCHAINS_CCDISABLES[242] = CCENABLE;; // TOKENS + CCDISABLEALL; + CCENABLE(EVAL_ASSETS); + CCENABLE(EVAL_TOKENS); + CCENABLE(EVAL_ORACLES); } if ( strcmp("KMDICE",ASSETCHAINS_SYMBOL) == 0 ) { - CCDISABLE; - ASSETCHAINS_CCDISABLES[228] = CCENABLE;; // FAUCET - ASSETCHAINS_CCDISABLES[230] = CCENABLE;; // DICE - ASSETCHAINS_CCDISABLES[236] = CCENABLE;; // ORACLES + CCDISABLEALL; + CCENABLE(EVAL_FAUCET); + CCENABLE(EVAL_DICE); + CCENABLE(EVAL_ORACLES); } } else BITCOIND_RPCPORT = GetArg("-rpcport", BaseParams().RPCPort()); KOMODO_DPOWCONFS = GetArg("-dpowconfs",dpowconfs); From 1403eb6cf7373b662b4e5a2ff8b151ddb2046fed Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 18:18:09 +0200 Subject: [PATCH 47/65] bump version bump version for the hardfork --- src/rpc/misc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index eca4abb36..95c2cc343 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -78,7 +78,7 @@ int8_t StakedNotaryID(std::string ¬aryname, char *Raddress); uint64_t komodo_notarypayamount(int32_t nHeight, int64_t notarycount); int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp); -#define KOMODO_VERSION "0.3.3b" +#define KOMODO_VERSION "0.4.0a" #define VERUS_VERSION "0.4.0g" extern uint16_t ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT; extern uint32_t ASSETCHAINS_CC; From a581ac5e1b6cbbc2c74eb253bb4861b5038e7c7e Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 28 Nov 2018 00:56:42 +0100 Subject: [PATCH 48/65] wallet: Skip transactions with no shielded data in CWallet::SetBestChain() Co-authored-by: Daira Hopwood Closes #3495. --- src/wallet/gtest/test_wallet.cpp | 57 ++++++++++++++++++++++++++++++++ src/wallet/wallet.h | 15 ++++++--- 2 files changed, 68 insertions(+), 4 deletions(-) diff --git a/src/wallet/gtest/test_wallet.cpp b/src/wallet/gtest/test_wallet.cpp index 1fe9db11a..676239d0b 100644 --- a/src/wallet/gtest/test_wallet.cpp +++ b/src/wallet/gtest/test_wallet.cpp @@ -1680,6 +1680,63 @@ TEST(WalletTests, WriteWitnessCache) { wallet.SetBestChain(walletdb, loc); } +TEST(WalletTests, SetBestChainIgnoresTxsWithoutShieldedData) { + SelectParams(CBaseChainParams::REGTEST); + + TestWallet wallet; + MockWalletDB walletdb; + CBlockLocator loc; + + // Set up transparent address + CKey tsk = DecodeSecret(tSecretRegtest); + wallet.AddKey(tsk); + auto scriptPubKey = GetScriptForDestination(tsk.GetPubKey().GetID()); + + // Set up a Sprout address + auto sk = libzcash::SproutSpendingKey::random(); + wallet.AddSproutSpendingKey(sk); + + // Generate a transparent transaction that is ours + CMutableTransaction t; + t.vout.resize(1); + t.vout[0].nValue = 90*CENT; + t.vout[0].scriptPubKey = scriptPubKey; + CWalletTx wtxTransparent {nullptr, t}; + wallet.AddToWallet(wtxTransparent, true, NULL); + + // Generate a Sprout transaction that is ours + auto wtxSprout = GetValidReceive(sk, 10, true); + auto noteMap = wallet.FindMySproutNotes(wtxSprout); + wtxSprout.SetSproutNoteData(noteMap); + wallet.AddToWallet(wtxSprout, true, NULL); + + // Generate a Sprout transaction that only involves our transparent address + auto sk2 = libzcash::SproutSpendingKey::random(); + auto wtxInput = GetValidReceive(sk2, 10, true); + auto note = GetNote(sk2, wtxInput, 0, 0); + auto wtxTmp = GetValidSpend(sk2, note, 5); + CMutableTransaction mtx {wtxTmp}; + mtx.vout[0].scriptPubKey = scriptPubKey; + CWalletTx wtxSproutTransparent {NULL, mtx}; + wallet.AddToWallet(wtxSproutTransparent, true, NULL); + + EXPECT_CALL(walletdb, TxnBegin()) + .WillOnce(Return(true)); + EXPECT_CALL(walletdb, WriteTx(wtxTransparent.GetHash(), wtxTransparent)) + .Times(0); + EXPECT_CALL(walletdb, WriteTx(wtxSprout.GetHash(), wtxSprout)) + .Times(1).WillOnce(Return(true)); + EXPECT_CALL(walletdb, WriteTx(wtxSproutTransparent.GetHash(), wtxSproutTransparent)) + .Times(0); + EXPECT_CALL(walletdb, WriteWitnessCacheSize(0)) + .WillOnce(Return(true)); + EXPECT_CALL(walletdb, WriteBestBlock(loc)) + .WillOnce(Return(true)); + EXPECT_CALL(walletdb, TxnCommit()) + .WillOnce(Return(true)); + wallet.SetBestChain(walletdb, loc); +} + TEST(WalletTests, UpdateSproutNullifierNoteMap) { TestWallet wallet; uint256 r {GetRandHash()}; diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index b00365a77..296e2fa57 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -807,10 +807,17 @@ protected: } try { for (std::pair& wtxItem : mapWallet) { - if (!walletdb.WriteTx(wtxItem.first, wtxItem.second)) { - LogPrintf("SetBestChain(): Failed to write CWalletTx, aborting atomic write\n"); - walletdb.TxnAbort(); - return; + auto wtx = wtxItem.second; + // We skip transactions for which mapSproutNoteData and mapSaplingNoteData + // are empty. This covers transactions that have no Sprout or Sapling data + // (i.e. are purely transparent), as well as shielding and unshielding + // transactions in which we only have transparent addresses involved. + if (!(wtx.mapSproutNoteData.empty() && wtx.mapSaplingNoteData.empty())) { + if (!walletdb.WriteTx(wtxItem.first, wtx)) { + LogPrintf("SetBestChain(): Failed to write CWalletTx, aborting atomic write\n"); + walletdb.TxnAbort(); + return; + } } } if (!walletdb.WriteWitnessCacheSize(nWitnessCacheSize)) { From 1fa094905015b1e23ef2bf8aea3a690040e3d8a3 Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 19:31:51 +0200 Subject: [PATCH 49/65] add customcc makefile --- src/cc/Makefile_custom | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/cc/Makefile_custom diff --git a/src/cc/Makefile_custom b/src/cc/Makefile_custom new file mode 100644 index 000000000..819ededc9 --- /dev/null +++ b/src/cc/Makefile_custom @@ -0,0 +1,38 @@ +SHELL = /bin/sh +CC = gcc +CC_DARWIN = g++-8 +CC_WIN = x86_64-w64-mingw32-gcc-posix +CFLAGS_DARWIN = -DBUILD_CUSTOMCC -std=c++11 -arch x86_64 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -Wl,-undefined -Wl,dynamic_lookup -Wno-write-strings -shared -dynamiclib +CFLAGS = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared +CFLAGS_WIN = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I./rogue/x86_64-w64-mingw32/include -I./rogue/x86_64-w64-mingw32/include/ncursesw -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared +DEBUGFLAGS = -O0 -D _DEBUG +RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program +$(info $(OS)) +OS := $(shell uname -s) +$(info $(OS)) +TARGET = customcc.so +TARGET_DARWIN = customcc.dylib +TARGET_WIN = customcc.dll +SOURCES = cclib.cpp +#HEADERS = $(shell echo ../cryptoconditions/include/*.h) -I/usr/local/Cellar/gcc\@8/8.3.0/include/c++/8.3.0/ + +all: $(TARGET) + +$(TARGET): $(SOURCES) + $(info Building cclib to src/) +ifeq ($(OS),Darwin) + $(CC_DARWIN) $(CFLAGS_DARWIN) $(DEBUGFLAGS) -o $(TARGET_DARWIN) -c $(SOURCES) + cp $(TARGET_DARWIN) ../libcc.dylib +else ifeq ($(HOST),x86_64-w64-mingw32) + $(info WINDOWS) + $(CC_WIN) $(CFLAGS_WIN) $(DEBUGFLAGS) -o $(TARGET_WIN) -c $(SOURCES) + cp $(TARGET_WIN) ../libcc.dll +#else ifeq ($(WIN_HOST),True) - todo: pass ENV var from build.sh if WIN host +else + $(info LINUX) + $(CC) $(CFLAGS) $(DEBUGFLAGS) -o $(TARGET) -c $(SOURCES) + cp $(TARGET) ../libcc.so +endif + +clean: + rm -rf $(TARGET) From e6a2ca7b6ca2154449d8fc6b1dfb29cb6d65dcff Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 19:33:20 +0200 Subject: [PATCH 50/65] fix WIN --- src/cc/Makefile_custom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/Makefile_custom b/src/cc/Makefile_custom index 819ededc9..f4b0cdb60 100644 --- a/src/cc/Makefile_custom +++ b/src/cc/Makefile_custom @@ -4,7 +4,7 @@ CC_DARWIN = g++-8 CC_WIN = x86_64-w64-mingw32-gcc-posix CFLAGS_DARWIN = -DBUILD_CUSTOMCC -std=c++11 -arch x86_64 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -Wl,-undefined -Wl,dynamic_lookup -Wno-write-strings -shared -dynamiclib CFLAGS = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -CFLAGS_WIN = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I./rogue/x86_64-w64-mingw32/include -I./rogue/x86_64-w64-mingw32/include/ncursesw -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared +CFLAGS_WIN = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared DEBUGFLAGS = -O0 -D _DEBUG RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program $(info $(OS)) From 8baa1690735364a48cf011a8ce623ab1cf421d4a Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 19:44:30 +0200 Subject: [PATCH 51/65] use makefilecustom for OSX --- zcutil/build-mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zcutil/build-mac.sh b/zcutil/build-mac.sh index 89847ddac..57ee78e1d 100755 --- a/zcutil/build-mac.sh +++ b/zcutil/build-mac.sh @@ -47,7 +47,7 @@ make "$@" -C ./depends/ V=1 NO_QT=1 NO_PROTON=1 WD=$PWD cd src/cc echo $PWD -./makerogue +./Makefile_custom cd $WD ./autogen.sh From 150fc744305a8c0ce64fa13b6e47a286165bd321 Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 20:25:08 +0200 Subject: [PATCH 52/65] chmod --- src/cc/Makefile_custom | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 src/cc/Makefile_custom diff --git a/src/cc/Makefile_custom b/src/cc/Makefile_custom old mode 100644 new mode 100755 From 962d885e31a85547cee59b63ed9818e4170f91eb Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 20:31:24 +0200 Subject: [PATCH 53/65] fix win --- src/cc/makecustom | 11 ++++++----- zcutil/build-mac.sh | 2 +- zcutil/build-win.sh | 2 +- zcutil/build.sh | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/cc/makecustom b/src/cc/makecustom index 154be4f31..7f1c789c9 100755 --- a/src/cc/makecustom +++ b/src/cc/makecustom @@ -1,6 +1,7 @@ #!/bin/sh -gcc -O3 -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c -o customcc.so cclib.cpp -cp customcc.so ../libcc.so -cd .. -make -cd cc +if make -f Makefile_custom "$@"; then + echo CUSTOMCC BUILD SUCCESSFUL +else + echo CUSTOMCC BUILD FAILED + exit 1 +fi diff --git a/zcutil/build-mac.sh b/zcutil/build-mac.sh index 57ee78e1d..3c0522a90 100755 --- a/zcutil/build-mac.sh +++ b/zcutil/build-mac.sh @@ -47,7 +47,7 @@ make "$@" -C ./depends/ V=1 NO_QT=1 NO_PROTON=1 WD=$PWD cd src/cc echo $PWD -./Makefile_custom +./makecustom cd $WD ./autogen.sh diff --git a/zcutil/build-win.sh b/zcutil/build-win.sh index 8cf1751af..e8c0465d9 100755 --- a/zcutil/build-win.sh +++ b/zcutil/build-win.sh @@ -14,7 +14,7 @@ cd ../ WD=$PWD cd src/cc echo $PWD -./makerogue +./makecustom cd $WD ./autogen.sh diff --git a/zcutil/build.sh b/zcutil/build.sh index df3dfa234..96e0b7c2c 100755 --- a/zcutil/build.sh +++ b/zcutil/build.sh @@ -106,7 +106,7 @@ CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$HARDENING_ARG" WD=$PWD cd src/cc echo $PWD -./makerogue +./makecustom cd $WD "$MAKE" "$@" V=1 From 87a849896180e3aeb2be258cd5a06161ea0889ba Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 20:52:44 +0200 Subject: [PATCH 54/65] fix WIN --- src/cc/Makefile_custom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/Makefile_custom b/src/cc/Makefile_custom index f4b0cdb60..79219ec96 100755 --- a/src/cc/Makefile_custom +++ b/src/cc/Makefile_custom @@ -4,7 +4,7 @@ CC_DARWIN = g++-8 CC_WIN = x86_64-w64-mingw32-gcc-posix CFLAGS_DARWIN = -DBUILD_CUSTOMCC -std=c++11 -arch x86_64 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -Wl,-undefined -Wl,dynamic_lookup -Wno-write-strings -shared -dynamiclib CFLAGS = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -CFLAGS_WIN = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared +CFLAGS_WIN = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/x86_64-w64-mingw32/include -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared DEBUGFLAGS = -O0 -D _DEBUG RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program $(info $(OS)) From 14421b7097c04887f315ec5ac970e0bf9f826c39 Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 21:24:17 +0200 Subject: [PATCH 55/65] update gitlab --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a7354b240..71ed197dc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,10 +71,8 @@ build:windows: - cp src/komodod.exe src/komodo-cli.exe src/komodo-tx.exe - src/cc/rogue/rogue.exe zcutil/fetch-params.bat - src/cc/rogue/x86_64-w64-mingw32/bin/libcurl-4.dll - src/cc/rogue/x86_64-w64-mingw32/bin/libncursesw6.dll + ${PACKAGE_DIR_WINDOWS} - zip -r ${PACKAGE_DIR_WINDOWS}.zip ${PACKAGE_DIR_WINDOWS} - md5sum ${AGAMA_ARTIFACTS_WINDOWS} > ${AGAMA_ARTIFACTS_WINDOWS_CHECKSUM} From adfea602f99bdfc01bef4d2e7e0c086ba2c0db6a Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 21:52:18 +0200 Subject: [PATCH 56/65] rm /n --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71ed197dc..945a7744a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,7 +72,6 @@ build:windows: src/komodo-cli.exe src/komodo-tx.exe zcutil/fetch-params.bat - ${PACKAGE_DIR_WINDOWS} - zip -r ${PACKAGE_DIR_WINDOWS}.zip ${PACKAGE_DIR_WINDOWS} - md5sum ${AGAMA_ARTIFACTS_WINDOWS} > ${AGAMA_ARTIFACTS_WINDOWS_CHECKSUM} From 086b9c717731aea1e6165c238949434da0880807 Mon Sep 17 00:00:00 2001 From: Mihail Fedorov Date: Mon, 10 Jun 2019 23:32:12 +0300 Subject: [PATCH 57/65] dev --- src/komodo_defs.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/komodo_defs.h b/src/komodo_defs.h index 778b8c101..f30b24481 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -201,20 +201,20 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"cryptoeconomy_EU", "0290ab4937e85246e048552df3e9a66cba2c1602db76e03763e16c671e750145d1" }, {"etszombi_EU", "0293ea48d8841af7a419a24d9da11c34b39127ef041f847651bae6ab14dcd1f6b4" }, // 20 {"karasugoi_NA", "02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982" }, - {"pirate_AR", "02a5e865af771eee0c6bd3bd238f01f5eb589907ba52efa9f37e5102375c8eb7a0" }, + {"pirate_AR", "03e29c90354815a750db8ea9cb3c1b9550911bb205f83d0355a061ac47c4cf2fde" }, {"metaphilibert_AR", "02adad675fae12b25fdd0f57250b0caf7f795c43f346153a31fe3e72e7db1d6ac6" }, {"zatjum_SH", "02d6b0c89cacd58a0af038139a9a90c9e02cd1e33803a1f15fceabea1f7e9c263a" }, {"madmax_AR", "03c5941fe49d673c094bc8e9bb1a95766b4670c88be76d576e915daf2c30a454d3" }, {"lukechilds_NA", "03f1051e62c2d280212481c62fe52aab0a5b23c95de5b8e9ad5f80d8af4277a64b" }, {"cipi_AR", "02c4f89a5b382750836cb787880d30e23502265054e1c327a5bfce67116d757ce8" }, {"tonyl_AR", "02cc8bc862f2b65ad4f99d5f68d3011c138bf517acdc8d4261166b0be8f64189e1" }, - {"infotech_DEV", "02d7d63ac441dbcd5535bcad741701519c190e89e17e4180aa0f61fdda0b6195ea" }, + {"infotech_DEV", "0345ad4ab5254782479f6322c369cec77a7535d2f2162d103d666917d5e4f30c4c" }, {"fullmoon_NA", "032c716701fe3a6a3f90a97b9d874a9d6eedb066419209eed7060b0cc6b710c60b" }, // 30 {"etszombi_AR", "02e55e104aa94f70cde68165d7df3e162d4410c76afd4643b161dea044aa6d06ce" }, - {"node-9_EU", "02e90f0528f8fd7d2b7f28d53ed7368cc4b1dfc5814c70c486c533862ee05e37dc" }, + {"node-9_EU", "0372e5b51e86e2392bb15039bac0c8f975b852b45028a5e43b324c294e9f12e411" }, {"phba2061_EU", "03f6bd15dba7e986f0c976ea19d8a9093cb7c989d499f1708a0386c5c5659e6c4e" }, {"indenodes_AR", "02ec0fa5a40f47fd4a38ea5c89e375ad0b6ddf4807c99733c9c3dc15fb978ee147" }, - {"and1-89_EU", "02f2af778c62888cfb106c0ef5c89cefe012ef3e6abed3ef28425092637d7ae3cc" }, + {"and1-89_EU", "02736cbf8d7b50835afd50a319f162dd4beffe65f2b1dc6b90e64b32c8e7849ddd" }, {"komodopioneers_SH", "032a238a5747777da7e819cfa3c859f3677a2daf14e4dce50916fc65d00ad9c52a" }, {"komodopioneers_EU", "036d02425916444fff8cc7203fcbfc155c956dda5ceb647505836bef59885b6866" }, {"d0ct0r_NA", "0303725d8525b6f969122faf04152653eb4bf34e10de92182263321769c334bf58" }, @@ -224,7 +224,7 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"webworker01_NA", "032735e9cad1bb00eaababfa6d27864fa4c1db0300c85e01e52176be2ca6a243ce" }, {"pbca26_NA", "03a97606153d52338bcffd1bf19bb69ef8ce5a7cbdc2dbc3ff4f89d91ea6bbb4dc" }, {"indenodes_SH", "0334e6e1ec8285c4b85bd6dae67e17d67d1f20e7328efad17ce6fd24ae97cdd65e" }, - {"pirate_NA", "033c8cef71f704f357c9ac1aeaafde3acd7bbfd0a09494e5e129ee0999fb2bc368" }, + {"pirate_NA", "0255e32d8a56671dee8aa7f717debb00efa7f0086ee802de0692f2d67ee3ee06ee" }, {"lukechilds_AR", "025c6a73ff6d750b9ddf6755b390948cffdd00f344a639472d398dd5c6b4735d23" }, {"dragonhound_NA", "0224a9d951d3a06d8e941cc7362b788bb1237bb0d56cc313e797eb027f37c2d375" }, {"fullmoon_AR", "03da64dd7cd0db4c123c2f79d548a96095a5a103e5b9d956e9832865818ffa7872" }, @@ -233,7 +233,7 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"jeezy_EU", "037f182facbad35684a6e960699f5da4ba89e99f0d0d62a87e8400dd086c8e5dd7" }, {"titomane_SH", "03850fdddf2413b51790daf51dd30823addb37313c8854b508ea6228205047ef9b" }, {"alien_AR", "03911a60395801082194b6834244fa78a3c30ff3e888667498e157b4aa80b0a65f" }, - {"pirate_EU", "03986339bebe3891e369a528356a220bc17a5bef3d337edfcf0114e66e6b1c120f" }, + {"pirate_EU", "03fff24efd5648870a23badf46e26510e96d9e79ce281b27cfe963993039dd1351" }, {"thegaltmines_NA", "02db1a16c7043f45d6033ccfbd0a51c2d789b32db428902f98b9e155cf0d7910ed" }, {"computergenie_NA", "03a78ae070a5e9e935112cf7ea8293f18950f1011694ea0260799e8762c8a6f0a4" }, {"nutellalicka_SH", "02f7d90d0510c598ce45915e6372a9cd0ba72664cb65ce231f25d526fc3c5479fc" }, From 19eba8e2ad6c2b326e59f0e2dd9b62d3a94a1def Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 10 Jun 2019 22:57:57 +0200 Subject: [PATCH 58/65] add wget and fetch-params --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 945a7744a..2a06081f3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,7 @@ build:ubuntu: - mkdir ${PACKAGE_DIR_LINUX} - cp src/komodod src/komodo-cli + zcutil/fetch-params.sh ${PACKAGE_DIR_LINUX} - chmod +x ${PACKAGE_DIR_LINUX}/komodod - chmod +x ${PACKAGE_DIR_LINUX}/komodo-cli @@ -71,6 +72,7 @@ build:windows: - cp src/komodod.exe src/komodo-cli.exe src/komodo-tx.exe + zcutil/wget64.exe zcutil/fetch-params.bat ${PACKAGE_DIR_WINDOWS} - zip -r ${PACKAGE_DIR_WINDOWS}.zip ${PACKAGE_DIR_WINDOWS} From 25d6cd8edd5a434a7ebc163cb1f9a1b004a9018a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 11 Jun 2019 00:27:51 -1100 Subject: [PATCH 59/65] Fix offset --- src/cc/dapps/zmigrate.c | 8 ++++---- src/komodo_gateway.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index aaad17a39..6f7960902 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -1086,11 +1086,11 @@ void scan_claims(int32_t issueflag,char *refcoin,int32_t batchid) else if ( batchid == 2 ) { batchmin = 1;//777 * SATOSHIDEN; - batchmax = 17777 * SATOSHIDEN; + batchmax = 47777 * SATOSHIDEN; } else if ( batchid == 3 ) { - batchmin = 17777 * SATOSHIDEN; + batchmin = 47777 * SATOSHIDEN; batchmax = 1000000 * SATOSHIDEN; } for (i=0; i Date: Tue, 11 Jun 2019 00:48:17 -1100 Subject: [PATCH 60/65] Support CHIPS in smartdust --- src/cc/dapps/zmigrate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 6f7960902..854ce9e64 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -1311,6 +1311,12 @@ int32_t main(int32_t argc,char **argv) coinstr = clonestr("KMD"); acstr = ""; } + else if ( strcmp(argv[1],"CHIPS") == 0 ) + { + REFCOIN_CLI = "./chips-cli"; + coinstr = clonestr("CHIPS"); + acstr = ""; + } else { sprintf(buf,"./komodo-cli -ac_name=%s",argv[1]); From 99dfd5b3c946c2f4e3156bf77d5c1b6434af714c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 11 Jun 2019 01:35:49 -1100 Subject: [PATCH 61/65] Support CHIPS --- src/cc/dapps/zmigrate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 854ce9e64..ea8085822 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -1086,11 +1086,11 @@ void scan_claims(int32_t issueflag,char *refcoin,int32_t batchid) else if ( batchid == 2 ) { batchmin = 1;//777 * SATOSHIDEN; - batchmax = 47777 * SATOSHIDEN; + batchmax = 77777 * SATOSHIDEN; } else if ( batchid == 3 ) { - batchmin = 47777 * SATOSHIDEN; + batchmin = 77777 * SATOSHIDEN; batchmax = 1000000 * SATOSHIDEN; } for (i=0; itotal > item->refundvalue*1.05 + 10*SATOSHIDEN ) + if ( item->total > item->refundvalue*1.1 + 10*SATOSHIDEN ) { - //if ( (item->total-item->refundvalue) > 777*SATOSHIDEN ) printf("possible.%d stolen %s %.8f vs refund %.8f -> %.8f\n",batchid,item->oldaddr,dstr(item->total),dstr(item->refundvalue),dstr(item->total)-dstr(item->refundvalue)); numstolen++; possiblestolen += (item->total - item->refundvalue); @@ -1324,7 +1323,7 @@ int32_t main(int32_t argc,char **argv) coinstr = clonestr(argv[1]); acstr = coinstr; } - if ( strcmp(coinstr,"KMD") == 0 ) + if ( 1 )//strcmp(coinstr,"KMD") == 0 ) { sprintf(buf,"%s-Claims.csv",coinstr); reconcile_claims(buf); From 1d4e09a5c4503e8bf06382d00d6d304d55be9bde Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Wed, 12 Jun 2019 12:16:13 +0800 Subject: [PATCH 62/65] change blackjok3r_SH pubkeys --- src/komodo_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_defs.h b/src/komodo_defs.h index 226600d6f..e91d831eb 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -186,7 +186,7 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"phm87_SH", "021773a38db1bc3ede7f28142f901a161c7b7737875edbb40082a201c55dcf0add" }, {"chainmakers_NA", "02285d813c30c0bf7eefdab1ff0a8ad08a07a0d26d8b95b3943ce814ac8e24d885" }, {"indenodes_EU", "0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c" }, - {"blackjok3r_SH", "0226293d7644e1380555ecc2d385ba038a66f4202b24b643ab31bcad0dc1474de2" }, + {"blackjok3r_SH", "021eac26dbad256cbb6f74d41b10763183ee07fb609dbd03480dd50634170547cc" }, // 03d23bb5aad3c20414078472220cc5c26bc5aeb41e43d72c99158d450f714d743a {"chainmakers_EU", "03fdf5a3fce8db7dee89724e706059c32e5aa3f233a6b6cc256fea337f05e3dbf7" }, {"titomane_AR", "023e3aa9834c46971ff3e7cb86a200ec9c8074a9566a3ea85d400d5739662ee989" }, {"fullmoon_SH", "023b7252968ea8a955cd63b9e57dee45a74f2d7ba23b4e0595572138ad1fb42d21" }, // 10 From 79e06a9d851733214ae9cae61b3d9132fafea33a Mon Sep 17 00:00:00 2001 From: pungotoken <45178410+pungotoken@users.noreply.github.com> Date: Wed, 12 Jun 2019 12:40:25 +0300 Subject: [PATCH 63/65] pungocloud: new pubkeys for AR&SH NNs --- src/komodo_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_defs.h b/src/komodo_defs.h index eb3039a18..dfc041874 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -195,7 +195,7 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"metaphilibert_SH", "0284af1a5ef01503e6316a2ca4abf8423a794e9fc17ac6846f042b6f4adedc3309" }, {"ca333_DEV", "02856843af2d9457b5b1c907068bef6077ea0904cc8bd4df1ced013f64bf267958" }, {"cipi_NA", "02858904a2a1a0b44df4c937b65ee1f5b66186ab87a751858cf270dee1d5031f18" }, - {"pungocloud_SH", "02863628f842a8aa424daf745cf43a1717cfcd571338ba87bfcec4d340703d01d6" }, + {"pungocloud_SH", "024dfc76fa1f19b892be9d06e985d0c411e60dbbeb36bd100af9892a39555018f6" }, {"voskcoin_EU", "0221365d89a6f6373b15daa4a50d56d34ad1b4b8a48a7fd090163b6b5a5ecd7a0a" }, {"decker_DEV", "028eea44a09674dda00d88ffd199a09c9b75ba9782382cc8f1e97c0fd565fe5707" }, {"cryptoeconomy_EU", "0290ab4937e85246e048552df3e9a66cba2c1602db76e03763e16c671e750145d1" }, @@ -219,7 +219,7 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"komodopioneers_EU", "036d02425916444fff8cc7203fcbfc155c956dda5ceb647505836bef59885b6866" }, {"d0ct0r_NA", "0303725d8525b6f969122faf04152653eb4bf34e10de92182263321769c334bf58" }, {"kolo_DEV", "02849e12199dcc27ba09c3902686d2ad0adcbfcee9d67520e9abbdda045ba83227" }, - {"peer2cloud_AR", "030fe3c77db0f91d79c26f951b674bba557b899f16570cd75332829a07031b0097" }, // 40 + {"pungocloud_AR", "02acc001fe1fe8fd68685ba26c0bc245924cb592e10cec71e9917df98b0e9d7c37" }, // 40 {"webworker01_SH", "031e50ba6de3c16f99d414bb89866e578d963a54bde7916c810608966fb5700776" }, {"webworker01_NA", "032735e9cad1bb00eaababfa6d27864fa4c1db0300c85e01e52176be2ca6a243ce" }, {"pbca26_NA", "03a97606153d52338bcffd1bf19bb69ef8ce5a7cbdc2dbc3ff4f89d91ea6bbb4dc" }, From 2984a80f2e468fb9da4f98dd9a70809f73ae3066 Mon Sep 17 00:00:00 2001 From: Mihail Fedorov Date: Wed, 12 Jun 2019 15:46:57 +0300 Subject: [PATCH 64/65] dev --- src/komodo_defs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/komodo_defs.h b/src/komodo_defs.h index eb3039a18..7be46f613 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -186,7 +186,7 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"phm87_SH", "021773a38db1bc3ede7f28142f901a161c7b7737875edbb40082a201c55dcf0add" }, {"chainmakers_NA", "02285d813c30c0bf7eefdab1ff0a8ad08a07a0d26d8b95b3943ce814ac8e24d885" }, {"indenodes_EU", "0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c" }, - {"blackjok3r_SH", "021eac26dbad256cbb6f74d41b10763183ee07fb609dbd03480dd50634170547cc" }, // 03d23bb5aad3c20414078472220cc5c26bc5aeb41e43d72c99158d450f714d743a + {"blackjok3r_SH", "021eac26dbad256cbb6f74d41b10763183ee07fb609dbd03480dd50634170547cc" }, {"chainmakers_EU", "03fdf5a3fce8db7dee89724e706059c32e5aa3f233a6b6cc256fea337f05e3dbf7" }, {"titomane_AR", "023e3aa9834c46971ff3e7cb86a200ec9c8074a9566a3ea85d400d5739662ee989" }, {"fullmoon_SH", "023b7252968ea8a955cd63b9e57dee45a74f2d7ba23b4e0595572138ad1fb42d21" }, // 10 @@ -195,8 +195,8 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"metaphilibert_SH", "0284af1a5ef01503e6316a2ca4abf8423a794e9fc17ac6846f042b6f4adedc3309" }, {"ca333_DEV", "02856843af2d9457b5b1c907068bef6077ea0904cc8bd4df1ced013f64bf267958" }, {"cipi_NA", "02858904a2a1a0b44df4c937b65ee1f5b66186ab87a751858cf270dee1d5031f18" }, - {"pungocloud_SH", "02863628f842a8aa424daf745cf43a1717cfcd571338ba87bfcec4d340703d01d6" }, - {"voskcoin_EU", "0221365d89a6f6373b15daa4a50d56d34ad1b4b8a48a7fd090163b6b5a5ecd7a0a" }, + {"pungocloud_SH", "024dfc76fa1f19b892be9d06e985d0c411e60dbbeb36bd100af9892a39555018f6" }, + {"voskcoin_EU", "034190b1c062a04124ad15b0fa56dfdf34aa06c164c7163b6aec0d654e5f118afb" }, {"decker_DEV", "028eea44a09674dda00d88ffd199a09c9b75ba9782382cc8f1e97c0fd565fe5707" }, {"cryptoeconomy_EU", "0290ab4937e85246e048552df3e9a66cba2c1602db76e03763e16c671e750145d1" }, {"etszombi_EU", "0293ea48d8841af7a419a24d9da11c34b39127ef041f847651bae6ab14dcd1f6b4" }, // 20 @@ -219,7 +219,7 @@ static const char *notaries_elected[NUM_KMD_SEASONS][NUM_KMD_NOTARIES][2] = {"komodopioneers_EU", "036d02425916444fff8cc7203fcbfc155c956dda5ceb647505836bef59885b6866" }, {"d0ct0r_NA", "0303725d8525b6f969122faf04152653eb4bf34e10de92182263321769c334bf58" }, {"kolo_DEV", "02849e12199dcc27ba09c3902686d2ad0adcbfcee9d67520e9abbdda045ba83227" }, - {"peer2cloud_AR", "030fe3c77db0f91d79c26f951b674bba557b899f16570cd75332829a07031b0097" }, // 40 + {"peer2cloud_AR", "02acc001fe1fe8fd68685ba26c0bc245924cb592e10cec71e9917df98b0e9d7c37" }, // 40 {"webworker01_SH", "031e50ba6de3c16f99d414bb89866e578d963a54bde7916c810608966fb5700776" }, {"webworker01_NA", "032735e9cad1bb00eaababfa6d27864fa4c1db0300c85e01e52176be2ca6a243ce" }, {"pbca26_NA", "03a97606153d52338bcffd1bf19bb69ef8ce5a7cbdc2dbc3ff4f89d91ea6bbb4dc" }, From d2015647d0fb7b5d40fe1f7295f577d072178b6a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 12 Jun 2019 14:52:45 -1100 Subject: [PATCH 65/65] undo constraint --- src/komodo_gateway.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 2a54ce064..9a80e5e24 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -645,13 +645,13 @@ const char *banned_txids[] = // all vouts banned "c4ea1462c207547cd6fb6a4155ca6d042b22170d29801a465db5c09fec55b19d", //246748 "305dc96d8bc23a69d3db955e03a6a87c1832673470c32fe25473a46cc473c7d1", //247204 - "43416a0c4da6b1a5c1d375bdbe8f7dc8d44d8f60df593d3376aa8221ec66357e", // vout0 only - "1eb295ed54c47f35cbccd7e7e40d03041f1853581da6d41102a9d8813782b6cb", - "db121e4012222adfc841824984a2a90b7e5b018dd71307822537d58160195e43", - "28f95b8148ac4ae6e09c7380e34422fab41d568a411e53dc94823e36a3d6f386", - "01d8c839463bda2f2f6400ede4611357913684927a767422a8560ead1b22557c", - "6e4980a9e1bd669f4df04732dc6f11b7773b6de88d1abcf89a6b9007d72ef9ac", - "6cc1d0495170bc0e11fd3925297623562e529ea1336b66ea61f8a1159041aed2", + //"43416a0c4da6b1a5c1d375bdbe8f7dc8d44d8f60df593d3376aa8221ec66357e", // vout0 only + //"1eb295ed54c47f35cbccd7e7e40d03041f1853581da6d41102a9d8813782b6cb", + //"db121e4012222adfc841824984a2a90b7e5b018dd71307822537d58160195e43", + //"28f95b8148ac4ae6e09c7380e34422fab41d568a411e53dc94823e36a3d6f386", + //"01d8c839463bda2f2f6400ede4611357913684927a767422a8560ead1b22557c", + //"6e4980a9e1bd669f4df04732dc6f11b7773b6de88d1abcf89a6b9007d72ef9ac", + //"6cc1d0495170bc0e11fd3925297623562e529ea1336b66ea61f8a1159041aed2", }; int32_t komodo_checkvout(int32_t vout,int32_t k,int32_t indallvouts) @@ -673,7 +673,7 @@ int32_t komodo_bannedset(int32_t *indallvoutsp,uint256 *array,int32_t max) } for (i=0; i