From 3c41ff9a17ffec36f88fe407ac4a840c820dee6b Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Fri, 14 Jun 2019 01:08:07 +0800 Subject: [PATCH 01/12] fix oracles crash? --- src/cc/oracles.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 193f66a1a..2a89fe536 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -638,11 +638,7 @@ bool OraclesDataValidate(struct CCcontract_info *cp,Eval* eval,const CTransactio int32_t GetLatestTimestamp(int32_t height) { - uint256 blockHash; CBlock block; CBlockIndex* pindex; - - blockHash = chainActive[height]->GetBlockHash(); - pindex = mapBlockIndex[blockHash]; - return(pindex->nTime); + return(komodo_heightstamp(height)); } bool OraclesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn) From 0d7c2f33fc80edf3419bf89b445483e23416c332 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Fri, 14 Jun 2019 01:16:59 +0800 Subject: [PATCH 02/12] try fix for chickenpool --- src/miner.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/miner.cpp b/src/miner.cpp index 9976909fa..312ee0a52 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -225,6 +225,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 CBlockIndex* pindexPrev = 0; { + boost::this_thread::interruption_point(); // exit thread before entering locks. ENTER_CRITICAL_SECTION(cs_main); ENTER_CRITICAL_SECTION(mempool.cs); pindexPrev = chainActive.LastTip(); From f2645aed1ba5f92a121bced412ea5cb22b1260ed Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Fri, 14 Jun 2019 01:53:17 +0800 Subject: [PATCH 03/12] better fix --- src/miner.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 312ee0a52..8ff4e2023 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -222,10 +222,13 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 boost::optional cheatSpend; uint256 cbHash; - + + boost::this_thread::interruption_point(); // exit thread before entering locks. + CBlockIndex* pindexPrev = 0; { - boost::this_thread::interruption_point(); // exit thread before entering locks. + // this should stop create block ever exiting until it has returned something. + boost::this_thread::disable_interruption(); ENTER_CRITICAL_SECTION(cs_main); ENTER_CRITICAL_SECTION(mempool.cs); pindexPrev = chainActive.LastTip(); From 288074439ae078a991753f966915be0851636c35 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Fri, 14 Jun 2019 02:54:14 +0800 Subject: [PATCH 04/12] fix settting IS_KOMODO_NOTARY --- src/komodo_utils.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 94ac60515..6f8b1c59a 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1717,15 +1717,17 @@ void komodo_args(char *argv0) // I think on season change should reccomend notaries to use -notary to avoid needing this. int32_t kmd_season = getacseason(time(NULL)); for (i=0; i<64; i++) - if ( strcmp(NOTARY_PUBKEY.c_str(),notaries_elected[kmd_season][NUM_KMD_NOTARIES][1]) == 0 ) + { + if ( strcmp(NOTARY_PUBKEY.c_str(),notaries_elected[kmd_season-1][i][1]) == 0 ) { IS_KOMODO_NOTARY = 1; KOMODO_MININGTHREADS = 1; mapArgs ["-genproclimit"] = itostr(KOMODO_MININGTHREADS); IS_STAKED_NOTARY = -1; - fprintf(stderr,"running as notary.%d %s\n",i,notaries_elected[kmd_season][NUM_KMD_NOTARIES][0]); + fprintf(stderr,"running as notary.%d %s\n",i,notaries_elected[kmd_season-1][i][0]); break; } + } } } if ( IS_STAKED_NOTARY != -1 && IS_KOMODO_NOTARY == true ) { From 40ec8b3bacf19367ae67a4d00ba5ca6d1648b9a6 Mon Sep 17 00:00:00 2001 From: Mihailo Milenkovic Date: Sat, 15 Jun 2019 15:36:04 +0200 Subject: [PATCH 05/12] Add oraclessample rpc to get data for txid. --- src/cc/CCOracles.h | 1 + src/cc/oracles.cpp | 32 ++++++++++++++++++++++++++++++++ src/rpc/server.cpp | 1 + src/rpc/server.h | 1 + src/wallet/rpcwallet.cpp | 14 ++++++++++++++ 5 files changed, 49 insertions(+) diff --git a/src/cc/CCOracles.h b/src/cc/CCOracles.h index 9f6a35966..2f2b702f4 100644 --- a/src/cc/CCOracles.h +++ b/src/cc/CCOracles.h @@ -26,6 +26,7 @@ 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 OracleDataSample(uint256 reforacletxid,uint256 txid); 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 193f66a1a..6e58111fd 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -1059,6 +1059,38 @@ UniValue OracleFormat(uint8_t *data,int32_t datalen,char *format,int32_t formatl return(obj); } +UniValue OracleDataSample(uint256 reforacletxid,uint256 txid) +{ + UniValue result(UniValue::VOBJ); CTransaction tx,oracletx; uint256 hashBlock,btxid,oracletxid; std::string error; + CPubKey pk; std::string name,description,format; int32_t numvouts; std::vector data; char str[67], *formatstr = 0; + + 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' ) + { + if ( 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 *)""; + result.push_back(Pair("txid",uint256_str(str,txid))); + result.push_back(Pair("data",OracleFormat((uint8_t *)data.data(),(int32_t)data.size(),formatstr,(int32_t)format.size()))); + return(result); + } + else error="invalid data tx"; + } + else error="cannot find data txid"; + } + else error="invalid oracles txid"; + } + else error="cannot find oracles txid"; + result.push_back(Pair("result","error")); + result.push_back(Pair("error",error)); + return(result); +} + UniValue OracleDataSamples(uint256 reforacletxid,char* batonaddr,int32_t num) { UniValue result(UniValue::VOBJ),b(UniValue::VARR); CTransaction tx,oracletx; uint256 txid,hashBlock,btxid,oracletxid; diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 5d7fd6d74..75360fd35 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -460,6 +460,7 @@ static const CRPCCommand vRPCCommands[] = { "oracles", "oraclesregister", &oraclesregister, true }, { "oracles", "oraclessubscribe", &oraclessubscribe, true }, { "oracles", "oraclesdata", &oraclesdata, true }, + { "oracles", "oraclessample", &oraclessample, true }, { "oracles", "oraclessamples", &oraclessamples, true }, // Prices diff --git a/src/rpc/server.h b/src/rpc/server.h index 27e7288cd..d447d2472 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -271,6 +271,7 @@ 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); +extern UniValue oraclessample(const UniValue& params, bool fHelp); extern UniValue oraclessamples(const UniValue& params, bool fHelp); extern UniValue pricesaddress(const UniValue& params, bool fHelp); extern UniValue priceslist(const UniValue& params, bool fHelp); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index bf861662f..949160a9e 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -6830,6 +6830,20 @@ UniValue oraclessubscribe(const UniValue& params, bool fHelp) return(result); } +UniValue oraclessample(const UniValue& params, bool fHelp) +{ + UniValue result(UniValue::VOBJ); uint256 oracletxid,txid; int32_t num; char *batonaddr; + if ( fHelp || params.size() != 2 ) + throw runtime_error("oraclessample oracletxid txid\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); + oracletxid = Parseuint256((char *)params[0].get_str().c_str()); + txid = Parseuint256((char *)params[1].get_str().c_str()); + return(OracleDataSample(oracletxid,txid)); +} + UniValue oraclessamples(const UniValue& params, bool fHelp) { UniValue result(UniValue::VOBJ); uint256 txid; int32_t num; char *batonaddr; From 103bca1ba7cae631d90c803be396dcfbe9d587f8 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Sun, 16 Jun 2019 12:07:35 +0300 Subject: [PATCH 06/12] LoadBlockIndexDB speed-up for non-LWMAPOS chains (x5 perfomance boost) seems we had CChainPower classes compare here from Verus, it's slow, bcz of hard arith_uint256 math in bool operator<(const CChainPower &p1, const CChainPower &p2), this slows down setBlockIndexCandidates.insert operations in LoadBlockIndexDB(), so, for faster block index db loading we will use check from Verus only for LWMAPOS enabled chains. perfomance test (daemon load time from start): without fix - 3m42sec with fix - 39sec --- src/main.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 30783e2ab..e01cba61f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -147,10 +147,28 @@ namespace { struct CBlockIndexWorkComparator { - bool operator()(CBlockIndex *pa, CBlockIndex *pb) const { + bool operator()(const CBlockIndex *pa, const CBlockIndex *pb) const { // First sort by most total work, ... - if (pa->chainPower > pb->chainPower) return false; - if (pa->chainPower < pb->chainPower) return true; + + if (ASSETCHAINS_LWMAPOS) { + + /* Decker: + + seems we had CChainPower classes compare here from Verus, it's slow, bcz of hard + arith_uint256 math in bool operator<(const CChainPower &p1, const CChainPower &p2), + this slows down setBlockIndexCandidates.insert operations in LoadBlockIndexDB(), + so, for faster block index db loading we will use check from Verus only for LWMAPOS + enabled chains. + */ + + if (pa->chainPower > pb->chainPower) return false; + if (pa->chainPower < pb->chainPower) return true; + } + else + { + if (pa->chainPower.chainWork > pb->chainPower.chainWork) return false; + if (pa->chainPower.chainWork < pb->chainPower.chainWork) return true; + } // ... then by earliest time received, ... if (pa->nSequenceId < pb->nSequenceId) return false; @@ -173,8 +191,10 @@ namespace { * as good as our current tip or better. Entries may be failed, though, and pruning nodes may be * missing the data for the block. */ + + //set> setBlockIndexCandidates; set setBlockIndexCandidates; - + /** Number of nodes with fSyncStarted. */ int nSyncStarted = 0; From 958376b579dcb969c02e07ab3c01c99e5f874449 Mon Sep 17 00:00:00 2001 From: dimxy Date: Mon, 17 Jun 2019 11:28:01 +0500 Subject: [PATCH 07/12] convert vobj to string in cclib rpc to allow passing json param as vobj --- src/wallet/rpcwallet.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 949160a9e..6a47e71a0 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5564,6 +5564,8 @@ UniValue cclibinfo(const UniValue& params, bool fHelp) UniValue cclib(const UniValue& params, bool fHelp) { struct CCcontract_info *cp,C; char *method,*jsonstr=0; uint8_t evalcode = EVAL_FIRSTUSER; + std::string vobjJsonSerialized; + if ( fHelp || params.size() > 3 ) throw runtime_error("cclib method [evalcode] [JSON params]\n"); if ( ASSETCHAINS_CCLIB.size() == 0 ) @@ -5583,7 +5585,12 @@ UniValue cclib(const UniValue& params, bool fHelp) } if ( params.size() == 3 ) { - jsonstr = (char *)params[2].get_str().c_str(); + if (params[2].getType() == UniValue::VOBJ) { + vobjJsonSerialized = params[2].write(0, 0); + jsonstr = (char *)vobjJsonSerialized.c_str(); + } + else // VSTR assumed + jsonstr = (char *)params[2].get_str().c_str(); //fprintf(stderr,"params.(%s %s %s)\n",params[0].get_str().c_str(),params[1].get_str().c_str(),jsonstr); } } From ba20fdc252795aa5866de4a694a68876e42884cb Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 18 Jun 2019 21:15:23 +0800 Subject: [PATCH 08/12] fix non determinate acccactivateht bug --- src/komodo_utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 6f8b1c59a..09f7fb6a0 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], ccEnablesHeight[512]; + 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] = {0}; IS_KOMODO_NOTARY = GetBoolArg("-notary", false); IS_STAKED_NOTARY = GetArg("-stakednotary", -1); memset(ccenables,0,sizeof(ccenables)); @@ -1769,7 +1769,7 @@ void komodo_args(char *argv0) { int32_t ecode = ccEnablesHeight[i]; int32_t ht = ccEnablesHeight[i+1]; - if ( ecode > 256 ) + if ( ecode > 256 || ecode < 0 ) fprintf(stderr, "ac_ccactivateht: invalid evalcode.%i must be between 0 and 256.\n", ecode); else if ( ht > 0 ) { From eca62bb4f39fd697db8d35487e95035a503f1fcd Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 18 Jun 2019 21:49:56 +0800 Subject: [PATCH 09/12] fix crash/lockup on KMD with mining pools when an old utxo makes IsFinalTx fail in TestBlockValidity. --- src/miner.cpp | 3 ++- src/rpc/mining.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 8ff4e2023..e4e907447 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -819,7 +819,8 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 LEAVE_CRITICAL_SECTION(cs_main); LEAVE_CRITICAL_SECTION(mempool.cs); } - throw std::runtime_error("CreateNewBlock(): TestBlockValidity failed"); + //throw std::runtime_error("CreateNewBlock(): TestBlockValidity failed"); // crashes the node, moved to GetBlockTemplate and issue return. + return(0); } //fprintf(stderr,"valid\n"); } diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 53a744497..4814d34dd 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -745,7 +745,8 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) #endif ENTER_CRITICAL_SECTION(cs_main); if (!pblocktemplate) - throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory or no available utxo for staking"); + throw std::runtime_error("CreateNewBlock(): create block failed"); + //throw JSONRPCError(RPC_OUT_OF_MEMORY, "Out of memory or no available utxo for staking"); // Need to update only after we know CreateNewBlockWithKey succeeded pindexPrev = pindexPrevNew; From 42c0630807e34b015e53d806d6cdba2be57e0b4b Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 18 Jun 2019 22:28:45 +0800 Subject: [PATCH 10/12] fix eval code --- src/komodo_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 09f7fb6a0..d1a84d53c 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1769,7 +1769,7 @@ void komodo_args(char *argv0) { int32_t ecode = ccEnablesHeight[i]; int32_t ht = ccEnablesHeight[i+1]; - if ( ecode > 256 || ecode < 0 ) + if ( ecode > 255 || ecode < 0 ) fprintf(stderr, "ac_ccactivateht: invalid evalcode.%i must be between 0 and 256.\n", ecode); else if ( ht > 0 ) { From f357d9eb1c0e4a3e72328ddc8cc538267f636b94 Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Mon, 24 Jun 2019 16:00:34 +0300 Subject: [PATCH 11/12] add convertpassphrase RPC method (convert Agama passphrases to WIF) --- src/wallet/rpcdump.cpp | 59 ++++++++++++++++++++++++++++++++++++++++ src/wallet/rpcwallet.cpp | 2 ++ 2 files changed, 61 insertions(+) diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 05552b50b..81ee82473 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -89,6 +89,65 @@ std::string DecodeDumpString(const std::string &str) { return ret.str(); } +UniValue convertpassphrase(const UniValue& params, bool fHelp) +{ + if (fHelp || params.size() < 1 || params.size() > 1) + throw runtime_error( + "convertpassphrase \"agamapassphrase\"\n" + "\nConverts Agama passphrase to a private key and WIF (for import with importprivkey).\n" + "\nArguments:\n" + "1. \"agamapassphrase\" (string, required) Agama passphrase\n" + "\nResult:\n" + "\"agamapassphrase\": \"agamapassphrase\", (string) Agama passphrase you entered\n" + "\"address\": \"komodoaddress\", (string) Address corresponding to your passphrase\n" + "\"pubkey\": \"publickeyhex\", (string) The hex value of the raw public key\n" + "\"privkey\": \"privatekeyhex\", (string) The hex value of the raw private key\n" + "\"wif\": \"wif\" (string) The private key in WIF format to use with 'importprivkey'\n" + "\nExamples:\n" + + HelpExampleCli("convertpassphrase", "\"agamapassphrase\"") + + HelpExampleRpc("convertpassphrase", "\"agamapassphrase\"") + ); + + bool fCompressed = true; + string strAgamaPassphrase = params[0].get_str(); + + UniValue ret(UniValue::VOBJ); + ret.push_back(Pair("agamapassphrase", strAgamaPassphrase)); + + CKey tempkey = DecodeSecret(strAgamaPassphrase); + /* first we should check if user pass wif to method, instead of passphrase */ + if (!tempkey.IsValid()) { + /* it's a passphrase, not wif */ + uint256 sha256; + CSHA256().Write((const unsigned char *)strAgamaPassphrase.c_str(), strAgamaPassphrase.length()).Finalize(sha256.begin()); + std::vector privkey(sha256.begin(), sha256.begin() + sha256.size()); + privkey.front() &= 0xf8; + privkey.back() &= 0x7f; + privkey.back() |= 0x40; + CKey key; + key.Set(privkey.begin(),privkey.end(), fCompressed); + CPubKey pubkey = key.GetPubKey(); + assert(key.VerifyPubKey(pubkey)); + CKeyID vchAddress = pubkey.GetID(); + + ret.push_back(Pair("address", EncodeDestination(vchAddress))); + ret.push_back(Pair("pubkey", HexStr(pubkey))); + ret.push_back(Pair("privkey", HexStr(privkey))); + ret.push_back(Pair("wif", EncodeSecret(key))); + } else { + /* seems it's a wif */ + CPubKey pubkey = tempkey.GetPubKey(); + assert(tempkey.VerifyPubKey(pubkey)); + CKeyID vchAddress = pubkey.GetID(); + ret.push_back(Pair("address", EncodeDestination(vchAddress))); + ret.push_back(Pair("pubkey", HexStr(pubkey))); + ret.push_back(Pair("privkey", HexStr(tempkey))); + ret.push_back(Pair("wif", strAgamaPassphrase)); + } + + return ret; +} + UniValue importprivkey(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 6a47e71a0..ce377d094 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -7977,6 +7977,7 @@ UniValue heirlist(const UniValue& params, bool fHelp) extern UniValue dumpprivkey(const UniValue& params, bool fHelp); // in rpcdump.cpp +extern UniValue convertpassphrase(const UniValue& params, bool fHelp); extern UniValue importprivkey(const UniValue& params, bool fHelp); extern UniValue importaddress(const UniValue& params, bool fHelp); extern UniValue dumpwallet(const UniValue& params, bool fHelp); @@ -8012,6 +8013,7 @@ static const CRPCCommand commands[] = { "wallet", "gettransaction", &gettransaction, false }, { "wallet", "getunconfirmedbalance", &getunconfirmedbalance, false }, { "wallet", "getwalletinfo", &getwalletinfo, false }, + { "wallet", "convertpassphrase", &convertpassphrase, true }, { "wallet", "importprivkey", &importprivkey, true }, { "wallet", "importwallet", &importwallet, true }, { "wallet", "importaddress", &importaddress, true }, From 9372a95d4955f454760672498493049bf115113e Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 25 Jun 2019 11:02:06 -0700 Subject: [PATCH 12/12] Update versions, copyrights and man pages --- configure.ac | 8 +- doc/man/komodo-cli.1 | 31 +++--- doc/man/komodo-tx.1 | 26 ++--- doc/man/komodod.1 | 219 +++++++++++++++++++++++++++++++++++++------ src/clientversion.h | 10 +- src/util.cpp | 5 +- 6 files changed, 238 insertions(+), 61 deletions(-) diff --git a/configure.ac b/configure.ac index 12256c0cc..3bf9abf8c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,13 +1,13 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) -define(_CLIENT_VERSION_MAJOR, 2) +define(_CLIENT_VERSION_MAJOR, 3) define(_CLIENT_VERSION_MINOR, 0) -define(_CLIENT_VERSION_REVISION, 15) -define(_CLIENT_VERSION_BUILD, 26) +define(_CLIENT_VERSION_REVISION, 0) +define(_CLIENT_VERSION_BUILD, 1) define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50))) define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1))) define(_CLIENT_VERSION_IS_RELEASE, true) -define(_COPYRIGHT_YEAR, 2018) +define(_COPYRIGHT_YEAR, 2019) AC_INIT([Verus-CLI],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_SUFFIX(_ZC_BUILD_VAL)],[https://github.com/VerusCoin/VerusCoin/issues],[verus-cli]) AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) diff --git a/doc/man/komodo-cli.1 b/doc/man/komodo-cli.1 index b7fdd19d6..4c20f0fde 100644 --- a/doc/man/komodo-cli.1 +++ b/doc/man/komodo-cli.1 @@ -1,12 +1,12 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH KOMODO-CLI "1" "March 2018" "komodo-cli v1.0.8" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH KOMODO-CLI "1" "June 2019" "komodo-cli v3.0.0" "User Commands" .SH NAME -komodo-cli \- manual page for komodo-cli v1.0.8 +komodo-cli \- manual page for komodo-cli v3.0.0 .SH DESCRIPTION -Komodo RPC client version v1.0.8 +Komodo RPC client version v3.0.0\-beta2\-ab9d87166\-dirty .PP -In order to ensure you are adequately protecting your privacy when using Zcash, -please see . +In order to ensure you are adequately protecting your privacy when using Hush, +please see . .SS "Usage:" .TP komodo\-cli [options] [params] @@ -65,14 +65,21 @@ Password for JSON\-RPC connections .IP Timeout in seconds during HTTP requests, or 0 for no timeout. (default: 900) +.HP +\fB\-stdin\fR +.IP +Read extra arguments from standard input, one per line until EOF/Ctrl\-D +(recommended for sensitive information such as passphrases) .SH COPYRIGHT -In order to ensure you are adequately protecting your privacy when using Zcash, -please see . +In order to ensure you are adequately protecting your privacy when using Hush, +please see . -Copyright (C) 2009-2017 The Bitcoin Core Developers -Copyright (C) 2015-2017 The Zcash Developers -Copyright (C) 2015-2017 jl777 and SuperNET developers +Copyright (C) 2009-2019 The Bitcoin Core Developers +Copyright (C) 2015-2019 The Zcash Developers +Copyright (C) 2015-2019 jl777 and SuperNET developers +Copyright (C) 2018-2019 The Hush developers +Copyright (C) 2018-2019 The Verus developers This is experimental software. @@ -81,4 +88,4 @@ or . This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit and cryptographic software written -by Eric Young and UPnP software written by Thomas Bernard. +by Eric Young. diff --git a/doc/man/komodo-tx.1 b/doc/man/komodo-tx.1 index 16f4e9a8d..899b0ce93 100644 --- a/doc/man/komodo-tx.1 +++ b/doc/man/komodo-tx.1 @@ -1,9 +1,9 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH KOMODO-TX "1" "March 2018" "komodo-tx v1.0.8" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH KOMODO-TX "1" "June 2019" "komodo-tx v3.0.0" "User Commands" .SH NAME -komodo-tx \- manual page for komodo-tx v1.0.8 +komodo-tx \- manual page for komodo-tx v3.0.0 .SH DESCRIPTION -Zcash zcash\-tx utility version v1.0.8 +Zcash zcash\-tx utility version v3.0.0\-beta2\-ab9d87166\-dirty .SS "Usage:" .TP zcash\-tx [options] [commands] @@ -48,7 +48,7 @@ delout=N .IP Delete output N from TX .IP -in=TXID:VOUT +in=TXID:VOUT(:SEQUENCE_NUMBER) .IP Add input to TX .IP @@ -68,7 +68,7 @@ outscript=VALUE:SCRIPT .IP Add raw script output to TX .IP -sign=SIGHASH\-FLAGS +sign=HEIGHT:SIGHASH\-FLAGS .IP Add zero or more signatures to transaction. This command requires JSON registers:prevtxs=JSON object, privatekeys=JSON object. See @@ -85,12 +85,14 @@ set=NAME:JSON\-STRING Set register NAME to given JSON\-STRING .SH COPYRIGHT -In order to ensure you are adequately protecting your privacy when using Zcash, -please see . +In order to ensure you are adequately protecting your privacy when using Hush, +please see . -Copyright (C) 2009-2017 The Bitcoin Core Developers -Copyright (C) 2015-2017 The Zcash Developers -Copyright (C) 2015-2017 jl777 and SuperNET developers +Copyright (C) 2009-2019 The Bitcoin Core Developers +Copyright (C) 2015-2019 The Zcash Developers +Copyright (C) 2015-2019 jl777 and SuperNET developers +Copyright (C) 2018-2019 The Hush developers +Copyright (C) 2018-2019 The Verus developers This is experimental software. @@ -99,4 +101,4 @@ or . This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit and cryptographic software written -by Eric Young and UPnP software written by Thomas Bernard. +by Eric Young. diff --git a/doc/man/komodod.1 b/doc/man/komodod.1 index 4c728657d..9a8dd439a 100644 --- a/doc/man/komodod.1 +++ b/doc/man/komodod.1 @@ -1,12 +1,12 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH KOMODOD "1" "March 2018" "komodod v1.0.8" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH KOMODOD "1" "June 2019" "komodod v3.0.0" "User Commands" .SH NAME -komodod \- manual page for komodod v1.0.8 +komodod \- manual page for komodod v3.0.0 .SH DESCRIPTION -Komodo Daemon version v1.0.8 +Komodo Daemon version v3.0.0\-beta2\-ab9d87166\-dirty .PP -In order to ensure you are adequately protecting your privacy when using Zcash, -please see . +In order to ensure you are adequately protecting your privacy when using Hush, +please see . .SS "Usage:" .TP komodod [options] @@ -39,6 +39,10 @@ How many blocks to check at startup (default: 288, 0 = all) .IP How thorough the block verification of \fB\-checkblocks\fR is (0\-4, default: 3) .HP +\fB\-clientname=\fR +.IP +Full node client name, default 'MagicBean' +.HP \fB\-conf=\fR .IP Specify configuration file (default: komodo.conf) @@ -57,7 +61,7 @@ Specify directory to be used when exporting data .HP \fB\-dbcache=\fR .IP -Set database cache size in megabytes (4 to 16384, default: 100) +Set database cache size in megabytes (4 to 16384, default: 450) .HP \fB\-loadblock=\fR .IP @@ -67,9 +71,15 @@ Imports blocks from external blk000??.dat file on startup .IP Keep at most unconnectable transactions in memory (default: 100) .HP +\fB\-mempooltxinputlimit=\fR +.IP +[DEPRECATED FROM OVERWINTER] Set the maximum number of transparent +inputs in a transaction that the mempool will accept (default: 0 = no +limit applied) +.HP \fB\-par=\fR .IP -Set the number of script verification threads (\fB\-2\fR to 16, 0 = auto, <0 = +Set the number of script verification threads (\fB\-8\fR to 16, 0 = auto, <0 = leave that many cores free, default: 0) .HP \fB\-pid=\fR @@ -97,6 +107,21 @@ Create new files with system default permissions, instead of umask 077 .IP Maintain a full transaction index, used by the getrawtransaction rpc call (default: 0) +.HP +\fB\-addressindex\fR +.IP +Maintain a full address index, used to query for the balance, txids and +unspent outputs for addresses (default: 0) +.HP +\fB\-timestampindex\fR +.IP +Maintain a timestamp index for block hashes, used to query blocks hashes +by a range of timestamps (default: 0) +.HP +\fB\-spentindex\fR +.IP +Maintain a full spent index, used to query the spending txid and input +index for an outpoint (default: 0) .PP Connection options: .HP @@ -154,7 +179,7 @@ Automatically create Tor hidden service (default: 1) .HP \fB\-maxconnections=\fR .IP -Maintain at most connections to peers (default: 125) +Maintain at most connections to peers (default: 384) .HP \fB\-maxreceivebuffer=\fR .IP @@ -177,6 +202,11 @@ Only connect to nodes in network (ipv4, ipv6 or onion) .IP Relay non\-P2SH multisig (default: 1) .HP +\fB\-peerbloomfilters\fR +.IP +Support filtering of blocks and transaction with Bloom filters (default: +1) +.HP \fB\-port=\fR .IP Listen for connections on (default: 7770 or testnet: 17770) @@ -207,10 +237,6 @@ Tor control port to use if onion listening enabled (default: .IP Tor control port password (default: empty) .HP -\fB\-upnp\fR -.IP -Use UPnP to map the listening port (default: 0) -.HP \fB\-whitebind=\fR .IP Bind to given address and whitelist peers connecting to it. Use @@ -235,11 +261,11 @@ Set key pool size to (default: 100) .HP \fB\-paytxfee=\fR .IP -Fee (in BTC/kB) to add to transactions you send (default: 0.00) +Fee (in KMD/kB) to add to transactions you send (default: 0.00) .HP \fB\-rescan\fR .IP -Rescan the blockchain for missing wallet transactions on startup +Rescan the block chain for missing wallet transactions on startup .HP \fB\-salvagewallet\fR .IP @@ -258,10 +284,15 @@ Spend unconfirmed change when sending transactions (default: 1) If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: 2) .HP +\fB\-txexpirydelta\fR +.IP +Set the number of blocks after which a transaction that has not been +mined will become invalid (default: 200) +.HP \fB\-maxtxfee=\fR .IP -Maximum total fees to use in a single wallet transaction; setting this -too low may abort large transactions (default: 0.10) +Maximum total fees (in KMD) to use in a single wallet transaction; +setting this too low may abort large transactions (default: 0.10) .HP \fB\-upgradewallet\fR .IP @@ -280,6 +311,16 @@ Make the wallet broadcast transactions (default: 1) Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) .HP +\fB\-whitelistaddress=\fR +.IP +Enable the wallet filter for notary nodes and add one Raddress to the +whitelist of the wallet filter. If \fB\-whitelistaddress=\fR is used, then the +wallet filter is automatically activated. Several Raddresses can be +defined using several \fB\-whitelistaddress=\fR (similar to \fB\-addnode\fR). The +wallet filter will filter the utxo to only ones coming from my own +Raddress (derived from pubkey) and each Raddress defined using +\fB\-whitelistaddress=\fR this option is mostly for Notary Nodes). +.HP \fB\-zapwallettxes=\fR .IP Delete all wallet transactions and only recover those parts of the @@ -333,7 +374,7 @@ Prepend debug output with timestamp (default: 1) .HP \fB\-minrelaytxfee=\fR .IP -Fees (in BTC/Kb) smaller than this are considered zero fee for relaying +Fees (in KMD/kB) smaller than this are considered zero fee for relaying (default: 0.000001) .HP \fB\-printtoconsole\fR @@ -376,14 +417,18 @@ Set maximum size of high\-priority/low\-fee transactions in bytes .PP Mining options: .HP +\fB\-mint\fR +.IP +Mint/stake coins automatically (default: 0) +.HP \fB\-gen\fR .IP -Generate coins (default: 0) +Mine/generate coins (default: 0) .HP \fB\-genproclimit=\fR .IP -Set the number of threads for coin generation if enabled (\fB\-1\fR = all -cores, default: 1) +Set the number of threads for coin mining if enabled (\fB\-1\fR = all cores, +default: 0) .HP \fB\-equihashsolver=\fR .IP @@ -453,14 +498,134 @@ output (default: 1 if running in a console, 0 otherwise) .IP Number of seconds between metrics refreshes (default: 1 if running in a console, 600 otherwise) +.PP +Komodo Asset Chain options: +.HP +\fB\-ac_algo\fR +.IP +Choose PoW mining algorithm, default is Equihash +.HP +\fB\-ac_blocktime\fR +.IP +Block time in seconds, default is 60 +.HP +\fB\-ac_cc\fR +.IP +Cryptoconditions, default 0 +.HP +\fB\-ac_beam\fR +.IP +BEAM integration +.HP +\fB\-ac_coda\fR +.IP +CODA integration +.HP +\fB\-ac_cclib\fR +.IP +Cryptoconditions dynamicly loadable library +.HP +\fB\-ac_ccenable\fR +.IP +Cryptoconditions to enable +.HP +\fB\-ac_ccactivate\fR +.IP +Block height to enable Cryptoconditions +.HP +\fB\-ac_decay\fR +.IP +Percentage of block reward decrease at each halving +.HP +\fB\-ac_end\fR +.IP +Block height at which block rewards will end +.HP +\fB\-ac_eras\fR +.IP +Block reward eras +.HP +\fB\-ac_founders\fR +.IP +Number of blocks between founders reward payouts +.HP +\fB\-ac_halving\fR +.IP +Number of blocks between each block reward halving +.HP +\fB\-ac_name\fR +.IP +Name of asset chain +.HP +\fB\-ac_notarypay\fR +.IP +Pay notaries, default 0 +.HP +\fB\-ac_perc\fR +.IP +Percentage of block rewards paid to the founder +.HP +\fB\-ac_private\fR +.IP +Shielded transactions only (except coinbase + notaries), default is 0 +.HP +\fB\-ac_pubkey\fR +.IP +Public key for receiving payments on the network +.HP +\fB\-ac_public\fR +.IP +Transparent transactions only, default 0 +.HP +\fB\-ac_reward\fR +.IP +Block reward in satoshis, default is 0 +.HP +\fB\-ac_sapling\fR +.IP +Sapling activation block height +.HP +\fB\-ac_script\fR +.IP +P2SH/multisig address to receive founders rewards +.HP +\fB\-ac_staked\fR +.IP +Percentage of blocks that are Proof\-Of\-Stake, default 0 +.HP +\fB\-ac_supply\fR +.IP +Starting supply, default is 0 +.HP +\fB\-ac_timelockfrom\fR +.IP +Timelocked coinbase start height +.HP +\fB\-ac_timelockgte\fR +.IP +Timelocked coinbase minimum amount to be locked +.HP +\fB\-ac_timelockto\fR +.IP +Timelocked coinbase stop height +.HP +\fB\-ac_txpow\fR +.IP +Enforce transaction\-rate limit, default 0 +.HP +\fB\-ac_veruspos\fR +.IP +Use Verus Proof\-Of\-Stake (\fB\-ac_veruspos\fR=\fI\,50\/\fR) default 0 .SH COPYRIGHT -In order to ensure you are adequately protecting your privacy when using Zcash, -please see . +In order to ensure you are adequately protecting your privacy when using Hush, +please see . -Copyright (C) 2009-2017 The Bitcoin Core Developers -Copyright (C) 2015-2017 The Zcash Developers -Copyright (C) 2015-2017 jl777 and SuperNET developers +Copyright (C) 2009-2019 The Bitcoin Core Developers +Copyright (C) 2015-2019 The Zcash Developers +Copyright (C) 2015-2019 jl777 and SuperNET developers +Copyright (C) 2018-2019 The Hush developers +Copyright (C) 2018-2019 The Verus developers This is experimental software. @@ -469,4 +634,4 @@ or . This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit and cryptographic software written -by Eric Young and UPnP software written by Thomas Bernard. +by Eric Young. diff --git a/src/clientversion.h b/src/clientversion.h index 36f37f2e2..a02acc8bb 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -1,5 +1,6 @@ // Copyright (c) 2009-2014 The Bitcoin Core developers // Copyright (c) 2016-2017 The Zcash 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. @@ -30,10 +31,11 @@ */ //! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it -#define CLIENT_VERSION_MAJOR 2 +// Must be kept in sync with configure.ac ! +#define CLIENT_VERSION_MAJOR 3 #define CLIENT_VERSION_MINOR 0 -#define CLIENT_VERSION_REVISION 15 -#define CLIENT_VERSION_BUILD 26 +#define CLIENT_VERSION_REVISION 0 +#define CLIENT_VERSION_BUILD 50 //! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true @@ -42,7 +44,7 @@ * Copyright year (2009-this) * Todo: update this when changing our copyright comments in the source */ -#define COPYRIGHT_YEAR 2018 +#define COPYRIGHT_YEAR 2019 #endif //HAVE_CONFIG_H diff --git a/src/util.cpp b/src/util.cpp index efe52591d..c1fb7f72b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1014,8 +1014,8 @@ void SetThreadPriority(int nPriority) std::string PrivacyInfo() { return "\n" + - FormatParagraph(strprintf(_("In order to ensure you are adequately protecting your privacy when using Zcash, please see <%s>."), - "https://z.cash/support/security/")) + "\n"; + FormatParagraph(strprintf(_("In order to ensure you are adequately protecting your privacy when using Hush, please see <%s>."), + "https://myhush.org/security/")) + "\n"; } std::string LicenseInfo() @@ -1024,6 +1024,7 @@ std::string LicenseInfo() FormatParagraph(strprintf(_("Copyright (C) 2009-%i The Bitcoin Core Developers"), COPYRIGHT_YEAR)) + "\n" + FormatParagraph(strprintf(_("Copyright (C) 2015-%i The Zcash Developers"), COPYRIGHT_YEAR)) + "\n" + FormatParagraph(strprintf(_("Copyright (C) 2015-%i jl777 and SuperNET developers"), COPYRIGHT_YEAR)) + "\n" + + FormatParagraph(strprintf(_("Copyright (C) 2018-%i The Hush developers"), COPYRIGHT_YEAR)) + "\n" + FormatParagraph(strprintf(_("Copyright (C) 2018-%i The Verus developers"), COPYRIGHT_YEAR)) + "\n" + "\n" + FormatParagraph(_("This is experimental software.")) + "\n" +