From 3eb3f1c5ee181381fb6d7e82ecca5a5bf3805948 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Fri, 2 Nov 2018 23:40:20 +0800 Subject: [PATCH 1/2] fix not compile --- src/wallet/rpcwallet.cpp | 69 ++-------------------------------------- 1 file changed, 3 insertions(+), 66 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 153a87dc7..f2cfae5a6 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4565,7 +4565,7 @@ int32_t komodo_notaryvin(CMutableTransaction &txNew,uint8_t *notarypub33) auto consensusBranchId = CurrentEpochBranchId(chainActive.Height() + 1, Params().GetConsensus()); if (!EnsureWalletIsAvailable(0)) return 0; - + const CKeyStore& keystore = *pwalletMain; assert(pwalletMain != NULL); LOCK2(cs_main, pwalletMain->cs_wallet); @@ -4728,7 +4728,7 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt set setAddress; struct komodo_staking *kp; int32_t winners,segid,minage,nHeight,counter=0,i,m,siglen=0,nMinDepth = 1,nMaxDepth = 99999999; vector vecOutputs; uint32_t block_from_future_rejecttime,besttime,eligible,eligible2,earliest = 0; CScript best_scriptPubKey; arith_uint256 mindiff,ratio,bnTarget; CBlockIndex *tipindex,*pindex; CTxDestination address; bool fNegative,fOverflow; uint8_t hashbuf[256]; CTransaction tx; uint256 hashBlock; if (!EnsureWalletIsAvailable(0)) return 0; - + bnTarget.SetCompact(nBits, &fNegative, &fOverflow); mindiff.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow); ratio = (mindiff / bnTarget); @@ -5029,69 +5029,6 @@ UniValue channelsaddress(const UniValue& params, bool fHelp) return(result); } -bool pubkey2addr(char *destaddr,uint8_t *pubkey33); - -UniValue setpubkey(const UniValue& params, bool fHelp) -{ - UniValue result(UniValue::VOBJ); - if ( fHelp || params.size() != 1 ) - throw runtime_error( - "setpubkey\n" - "\nSets the -pubkey if the daemon was not started with it, if it was already set, it returns the pubkey.\n" - "\nArguments:\n" - "1. \"pubkey\" (string) pubkey to set.\n" - "\nResult:\n" - " {\n" - " \"pubkey\" : \"pubkey\", (string) The pubkey\n" - " \"ismine\" : \"true/false\", (bool)\n" - " \"R-address\" : \"R address\", (string) The pubkey\n" - " }\n" - "\nExamples:\n" - + HelpExampleCli("setpubkey", "02f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193e") - + HelpExampleRpc("setpubkey", "02f7597468703c1c5c8465dd6d43acaae697df9df30bed21494d193412a1ea193e") - ); - -#ifdef ENABLE_WALLET - LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL); -#else - LOCK(cs_main); -#endif - - char Raddress[18]; - uint8_t pubkey33[33]; - extern uint8_t NOTARY_PUBKEY33[]; - extern std::string NOTARY_PUBKEY; - if ( NOTARY_PUBKEY33[0] == 0 ) { - if (strlen(params[0].get_str().c_str()) == 66) { - decode_hex(pubkey33,33,(char *)params[0].get_str().c_str()); - pubkey2addr((char *)Raddress,(uint8_t *)pubkey33); - if (strcmp("RRmWExvapDM9YbLT9X9xAyzDgxomYf63ng",Raddress) == 0) { - result.push_back(Pair("error", "pubkey entered is invalid.")); - } else { - CBitcoinAddress address(Raddress); - bool isValid = address.IsValid(); - if (isValid) - { - CTxDestination dest = address.Get(); - string currentAddress = address.ToString(); - result.push_back(Pair("address", currentAddress)); -#ifdef ENABLE_WALLET - isminetype mine = pwalletMain ? IsMine(*pwalletMain, dest) : ISMINE_NO; - result.push_back(Pair("ismine", (mine & ISMINE_SPENDABLE) ? true : false)); -#endif - } - NOTARY_PUBKEY = params[0].get_str(); - decode_hex(NOTARY_PUBKEY33,33,(char *)NOTARY_PUBKEY.c_str()); - } - } else { - result.push_back(Pair("error", "pubkey is wrong length, must be 66 char hex string.")); - } - } else { - result.push_back(Pair("error", "Can only set pubkey once, to change it you need to restart your daemon.")); - } - result.push_back(Pair("pubkey", NOTARY_PUBKEY)); - return result; -} UniValue oraclesaddress(const UniValue& params, bool fHelp) { @@ -6769,7 +6706,7 @@ UniValue getbalance64(const UniValue& params, bool fHelp) UniValue ret(UniValue::VOBJ); UniValue a(UniValue::VARR),b(UniValue::VARR); CTxDestination address; if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + const CKeyStore& keystore = *pwalletMain; CAmount nValues[64],nValues2[64],nValue,total,total2; int32_t i,segid; assert(pwalletMain != NULL); From fd31d05ab581218c86469786db1c36716f282d8b Mon Sep 17 00:00:00 2001 From: Alrighttt <36680730+Alrighttt@users.noreply.github.com> Date: Sat, 3 Nov 2018 09:31:22 -0400 Subject: [PATCH 2/2] Update assetchains.json --- src/assetchains.json | 82 +++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 54 deletions(-) diff --git a/src/assetchains.json b/src/assetchains.json index aa7c8bfb4..454852efe 100644 --- a/src/assetchains.json +++ b/src/assetchains.json @@ -1,84 +1,58 @@ [ { - "ac_name": "STAKEDB1", + "ac_name": "CFEK", "ac_supply": "100000", - "ac_reward" : "1000000000", - "ac_cc": "667", + "ac_reward": "10000000000000", + "ac_staked": "51", + "ac_cc": "102", "addnode": [ "195.201.137.5", "195.201.20.230" ] }, { - "ac_name": "STAKEDW1", - "ac_supply": "100000", - "ac_reward" : "1000000000", - "ac_cc": "667", + "ac_name": "CFEKED", + "ac_supply": "1000", + "ac_end": "1", + "ac_reward": "1", + "ac_staked": "1", + "ac_cc": "102", "addnode": [ "195.201.137.5", "195.201.20.230" ] }, { - "ac_name": "STAKEDPERC", - "ac_supply": "1000000", - "ac_reward" : "1000000000", - "ac_cc": "667", - "ac_perc": "10000000", - "ac_pubkey": "03bd221868abc063b54a3fceafb9898b1931ed767298a17ac0c9923500a7c60e4b", + "ac_name": "CFEKING", + "ac_supply": "1000", + "ac_end": "1", + "ac_reward": "1", + "ac_staked": "1", + "ac_cc": "102", "addnode": [ "195.201.137.5", "195.201.20.230" ] }, { - "ac_name": "STAKEDS1", - "ac_supply": "1000000", - "ac_reward" : "1000000000", - "ac_cc": "667", - "ac_staked": "10", + "ac_name": "CFEKLF", + "ac_supply": "1000", + "ac_end": "1", + "ac_reward": "1", + "ac_staked": "1", + "ac_cc": "102", "addnode": [ "195.201.137.5", "195.201.20.230" ] }, { - "ac_name": "STAKEDS9", - "ac_supply": "1000000", - "ac_reward" : "1000000000", - "ac_cc": "667", - "ac_staked": "90", - "addnode": [ - "195.201.137.5", - "195.201.20.230" - ] - }, - { - "ac_name": "STAKEDED", - "ac_supply": "1072452", - "ac_reward" : "1000000000", - "ac_cc": "667", - "addnode": [ - "195.201.137.5", - "195.201.20.230" - ] - }, - { - "ac_name": "STAKEDPRIV", - "ac_supply": "1000000", - "ac_reward" : "10000000000", - "ac_private": "1", - "addnode": [ - "195.201.137.5", - "195.201.20.230" - ] - }, - { - "ac_name": "STAKEDCCP", - "ac_supply": "1000000", - "ac_reward" : "10000000000", - "ac_private": "1", - "ac_cc": "667", + "ac_name": "CFEKMLT", + "ac_supply": "1000", + "ac_end": "1", + "ac_reward": "1", + "ac_staked": "1", + "ac_cc": "102", "addnode": [ "195.201.137.5", "195.201.20.230"