remove pointless things

This commit is contained in:
blackjok3r
2019-02-26 12:17:53 +08:00
parent f76ceced5b
commit e3495bf3e9
10 changed files with 70 additions and 97 deletions

View File

@@ -123,9 +123,8 @@ TESTS =
bin_PROGRAMS += komodod bin_PROGRAMS += komodod
#endif #endif
# komodo-tx
if BUILD_BITCOIN_UTILS if BUILD_BITCOIN_UTILS
bin_PROGRAMS += komodo-cli bin_PROGRAMS += komodo-cli komodo-tx
endif endif
if ENABLE_WALLET if ENABLE_WALLET
bin_PROGRAMS += wallet-utility bin_PROGRAMS += wallet-utility
@@ -205,7 +204,7 @@ BITCOIN_CORE_H = \
mruset.h \ mruset.h \
net.h \ net.h \
netbase.h \ netbase.h \
notaries_staked.h \ notaries_staked.h \
noui.h \ noui.h \
paymentdisclosure.h \ paymentdisclosure.h \
paymentdisclosuredb.h \ paymentdisclosuredb.h \
@@ -313,7 +312,7 @@ libbitcoin_server_a_SOURCES = \
chain.cpp \ chain.cpp \
checkpoints.cpp \ checkpoints.cpp \
crosschain.cpp \ crosschain.cpp \
crosschain_authority.cpp \ crosschain_authority.cpp \
crypto/haraka.h \ crypto/haraka.h \
crypto/haraka_portable.h \ crypto/haraka_portable.h \
crypto/verus_hash.h \ crypto/verus_hash.h \
@@ -328,7 +327,7 @@ libbitcoin_server_a_SOURCES = \
metrics.h \ metrics.h \
miner.cpp \ miner.cpp \
net.cpp \ net.cpp \
notaries_staked.cpp \ notaries_staked.cpp \
noui.cpp \ noui.cpp \
notarisationdb.cpp \ notarisationdb.cpp \
paymentdisclosure.cpp \ paymentdisclosure.cpp \
@@ -620,8 +619,8 @@ komodo_cli_LDADD = \
$(EVENT_LIBS) \ $(EVENT_LIBS) \
$(LIBZCASH) \ $(LIBZCASH) \
$(LIBBITCOIN_CRYPTO) \ $(LIBBITCOIN_CRYPTO) \
$(LIBVERUS_CRYPTO) \ $(LIBVERUS_CRYPTO) \
$(LIBVERUS_PORTABLE_CRYPTO) \ $(LIBVERUS_PORTABLE_CRYPTO) \
$(LIBZCASH_LIBS) $(LIBZCASH_LIBS)
if ENABLE_WALLET if ENABLE_WALLET
@@ -629,8 +628,8 @@ wallet_utility_LDADD = \
libbitcoin_wallet.a \ libbitcoin_wallet.a \
$(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_CRYPTO) \ $(LIBBITCOIN_CRYPTO) \
$(LIBVERUS_CRYPTO) \ $(LIBVERUS_CRYPTO) \
$(LIBVERUS_PORTABLE_CRYPTO) \ $(LIBVERUS_PORTABLE_CRYPTO) \
$(LIBSECP256K1) \ $(LIBSECP256K1) \
$(LIBBITCOIN_UTIL) \ $(LIBBITCOIN_UTIL) \
$(BOOST_LIBS) \ $(BOOST_LIBS) \
@@ -639,7 +638,7 @@ wallet_utility_LDADD = \
$(LIBZCASH) \ $(LIBZCASH) \
$(LIBSNARK) \ $(LIBSNARK) \
$(LIBZCASH_LIBS)\ $(LIBZCASH_LIBS)\
$(LIBCRYPTOCONDITIONS) $(LIBCRYPTOCONDITIONS)
endif endif
# zcash-tx binary # # zcash-tx binary #
@@ -679,7 +678,7 @@ libzcash_a_SOURCES = \
zcash/Note.cpp \ zcash/Note.cpp \
zcash/prf.cpp \ zcash/prf.cpp \
zcash/util.cpp \ zcash/util.cpp \
zcash/zip32.cpp \ zcash/zip32.cpp \
zcash/circuit/commitment.tcc \ zcash/circuit/commitment.tcc \
zcash/circuit/gadget.tcc \ zcash/circuit/gadget.tcc \
zcash/circuit/merkle.tcc \ zcash/circuit/merkle.tcc \

View File

@@ -136,51 +136,42 @@
"ac_reward": "100000000" "ac_reward": "100000000"
}, },
{ {
"ac_name": "CFEKED", "ac_name": "SEC",
"ac_supply": "1000", "ac_supply": "1000000000",
"ac_cc": "333"
},
{
"ac_name": "CCL",
"ac_supply": "200000000",
"ac_end": "1", "ac_end": "1",
"ac_reward": "1", "ac_cc": "2",
"ac_staked": "1", "addressindex": "1",
"ac_cc": "102", "spentindex": "1",
"addnode": [ "addnode": [
"195.201.137.5", "142.93.136.89",
"195.201.20.230" "195.201.22.89"
] ]
}, },
{ {
"ac_name": "CFEKING", "ac_name": "PIRATE",
"ac_supply": "1000", "ac_supply": "0",
"ac_end": "1", "ac_reward": "25600000000",
"ac_reward": "1", "ac_halving": "77777",
"ac_staked": "1", "ac_private": "1",
"ac_cc": "102",
"addnode": [ "addnode": [
"195.201.137.5", "136.243.102.225"
"195.201.20.230"
] ]
}, },
{ {
"ac_name": "CFEKLF", "ac_name": "MGNX",
"ac_supply": "1000", "ac_supply": "12465003",
"ac_end": "1", "ac_staked": "90",
"ac_reward": "1", "ac_reward": "2000000000",
"ac_staked": "1", "ac_halving": "525960",
"ac_cc": "102", "ac_cc": "2",
"ac_end": "2629800",
"addnode": [ "addnode": [
"195.201.137.5", "142.93.27.180"
"195.201.20.230"
]
},
{
"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"
] ]
}, },
{ {

View File

@@ -25,7 +25,6 @@
#include "util.h" #include "util.h"
#include "utilstrencodings.h" #include "utilstrencodings.h"
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
#include <stdio.h> #include <stdio.h>

View File

@@ -1213,9 +1213,6 @@ int64_t DicePlanFunds(uint64_t &entropyval,uint256 &entropytxid,uint64_t refsbit
} else { } else {
return(0); return(0);
} }
fprintf(stderr,"numentropy tx %d: %.8f\n",n,(double)totalinputs/COIN);
entropytxs = n;
return(totalinputs);
} }
bool DicePlanExists(CScript &fundingPubKey,uint256 &fundingtxid,struct CCcontract_info *cp,uint64_t refsbits,CPubKey dicepk,int64_t &minbet,int64_t &maxbet,int64_t &maxodds,int64_t &timeoutblocks) bool DicePlanExists(CScript &fundingPubKey,uint256 &fundingtxid,struct CCcontract_info *cp,uint64_t refsbits,CPubKey dicepk,int64_t &minbet,int64_t &maxbet,int64_t &maxodds,int64_t &timeoutblocks)
@@ -1419,7 +1416,7 @@ std::string DiceBet(uint64_t txfee,char *planstr,uint256 fundingtxid,int64_t bet
CScript fundingPubKey; CPubKey mypk,dicepk; uint64_t sbits,entropyval,entropyval2; int64_t funding,minbet,maxbet,maxodds,timeoutblocks; uint256 entropytxid,entropytxid2,entropy,hentropy; struct CCcontract_info *cp,C; CScript fundingPubKey; CPubKey mypk,dicepk; uint64_t sbits,entropyval,entropyval2; int64_t funding,minbet,maxbet,maxodds,timeoutblocks; uint256 entropytxid,entropytxid2,entropy,hentropy; struct CCcontract_info *cp,C;
if ( bet < 0 ) if ( bet < 0 )
{ {
CCerror = "bet must be positive"; CCerror = "Diceinit error in bet, is your transaction confirmed?";
return(""); return("");
} }
if ( odds < 2 || odds > 9999 ) if ( odds < 2 || odds > 9999 )
@@ -1756,7 +1753,8 @@ double DiceStatus(uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettx
CScript fundingPubKey,scriptPubKey; CTransaction spenttx,betTx,entropyTx; uint256 hentropyproof,entropyused,hash,proof,txid,hashBlock,spenttxid,bettorentropy; CPubKey mypk,dicepk,fundingpk; struct CCcontract_info *cp,C; int32_t i,entropyvout,flag,win,num,loss,duplicate=0,result,iswin,vout,n=0; int64_t minbet,maxbet,maxodds,timeoutblocks,sum=0; uint64_t sbits,refsbits; char coinaddr[64]; std::string res; uint8_t funcid; CScript fundingPubKey,scriptPubKey; CTransaction spenttx,betTx,entropyTx; uint256 hentropyproof,entropyused,hash,proof,txid,hashBlock,spenttxid,bettorentropy; CPubKey mypk,dicepk,fundingpk; struct CCcontract_info *cp,C; int32_t i,entropyvout,flag,win,num,loss,duplicate=0,result,iswin,vout,n=0; int64_t minbet,maxbet,maxodds,timeoutblocks,sum=0; uint64_t sbits,refsbits; char coinaddr[64]; std::string res; uint8_t funcid;
if ( (cp= Diceinit(fundingPubKey,fundingtxid,&C,planstr,txfee,mypk,dicepk,refsbits,minbet,maxbet,maxodds,timeoutblocks)) == 0 ) if ( (cp= Diceinit(fundingPubKey,fundingtxid,&C,planstr,txfee,mypk,dicepk,refsbits,minbet,maxbet,maxodds,timeoutblocks)) == 0 )
{ {
CCerror = "Diceinit error in status"; CCerror = "Diceinit error in status, is your transaction confirmed?";
fprintf(stderr,"%s\n", CCerror.c_str() );
return(0.); return(0.);
} }
win = loss = 0; win = loss = 0;

View File

@@ -20,7 +20,6 @@
#include "version.h" #include "version.h"
/* /*
* Serialisation boilerplate * Serialisation boilerplate
*/ */

View File

@@ -41,7 +41,7 @@
#include "zcash/IncrementalMerkleTree.hpp" #include "zcash/IncrementalMerkleTree.hpp"
//#include "veruslaunch.h" //#include "veruslaunch.h"
/** /**
* Pruned version of CTransaction: only retains metadata and unspent transaction outputs * Pruned version of CTransaction: only retains metadata and unspent transaction outputs
* *
* Serialized format: * Serialized format:
@@ -443,7 +443,7 @@ public:
class CCoinsViewCache; class CCoinsViewCache;
/** /**
* A reference to a mutable cache entry. Encapsulating it allows us to run * A reference to a mutable cache entry. Encapsulating it allows us to run
* cleanup code after the modification is finished, and keeping track of * cleanup code after the modification is finished, and keeping track of
* concurrent modifications. * concurrent modifications.
@@ -503,7 +503,7 @@ protected:
/** /**
* Make mutable so that we can "fill the cache" even from Get-methods * Make mutable so that we can "fill the cache" even from Get-methods
* declared as "const". * declared as "const".
*/ */
mutable uint256 hashBlock; mutable uint256 hashBlock;
mutable CCoinsMap cacheCoins; mutable CCoinsMap cacheCoins;
@@ -579,7 +579,7 @@ public:
//! Calculate the size of the cache (in bytes) //! Calculate the size of the cache (in bytes)
size_t DynamicMemoryUsage() const; size_t DynamicMemoryUsage() const;
/** /**
* Amount of bitcoins coming in to a transaction * Amount of bitcoins coming in to a transaction
* Note that lightweight clients may not know anything besides the hash of previous transactions, * Note that lightweight clients may not know anything besides the hash of previous transactions,
* so may not be able to calculate this. * so may not be able to calculate this.

View File

@@ -1536,7 +1536,7 @@ uint32_t komodo_stake(int32_t validateflag,arith_uint256 bnTarget,int32_t nHeigh
int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_uint256 bnTarget,arith_uint256 bhash) int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_uint256 bnTarget,arith_uint256 bhash)
{ {
CBlockIndex *previndex,*pindex; char voutaddr[64],destaddr[64]; uint256 txid; uint32_t txtime,prevtime=0; int32_t vout,PoSperc,txn_count,eligible=0,isPoS = 0,segid; uint64_t value; CTxDestination voutaddress; arith_uint256 POWTarget; CBlockIndex *previndex,*pindex; char voutaddr[64],destaddr[64]; uint256 txid; uint32_t txtime,prevtime=0; int32_t vout,PoSperc,txn_count,eligible=0,isPoS = 0,segid; uint64_t value; CTxDestination voutaddress; arith_uint256 POWTarget;
if ( ASSETCHAINS_STAKED == 100 && height <= 100 ) if ( ASSETCHAINS_STAKED == 100 && height <= 10 )
return(1); return(1);
BlockMap::const_iterator it = mapBlockIndex.find(pblock->GetHash()); BlockMap::const_iterator it = mapBlockIndex.find(pblock->GetHash());
pindex = it != mapBlockIndex.end() ? it->second : NULL; pindex = it != mapBlockIndex.end() ? it->second : NULL;
@@ -2194,10 +2194,10 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height)
} }
// Check min sigs. // Check min sigs.
int8_t numSN = 0; uint8_t notarypubkeys[64][33] = {0}; int8_t numSN = 0; uint8_t notarypubkeys[64][33] = {0};
numSN = komodo_notaries(notarypubkeys, height, pblock->nTime) numSN = komodo_notaries(notarypubkeys, height, pblock->nTime);
if ( pblock->vtx[1].vin.size() < numSN/5) ) if ( pblock->vtx[1].vin.size() < numSN/5 )
{ {
fprintf(stderr, "ht.%i does not meet minsigs.%i sigs.%li\n",height,numSN/5),pblock->vtx[1].vin.size()); fprintf(stderr, "ht.%i does not meet minsigs.%i sigs.%li\n",height,numSN/5,pblock->vtx[1].vin.size());
return(-1); return(-1);
} }
} }

View File

@@ -1690,7 +1690,7 @@ void komodo_args(char *argv0)
IS_KOMODO_NOTARY = 1; IS_KOMODO_NOTARY = 1;
KOMODO_MININGTHREADS = 1; KOMODO_MININGTHREADS = 1;
mapArgs ["-genproclimit"] = itostr(KOMODO_MININGTHREADS); mapArgs ["-genproclimit"] = itostr(KOMODO_MININGTHREADS);
IS_STAKED_NOTARY = -1; IS_STAKED_NOTARY = -1;
fprintf(stderr,"running as notary.%d %s\n",i,Notaries_elected1[i][0]); fprintf(stderr,"running as notary.%d %s\n",i,Notaries_elected1[i][0]);
break; break;
} }
@@ -1723,7 +1723,7 @@ void komodo_args(char *argv0)
{ {
printf("KOMODO_REWIND %d\n",KOMODO_REWIND); printf("KOMODO_REWIND %d\n",KOMODO_REWIND);
} }
if ( name.c_str()[0] != 0 ) if ( name.c_str()[0] != 0 )
{ {
std::string selectedAlgo = GetArg("-ac_algo", std::string(ASSETCHAINS_ALGORITHMS[0])); std::string selectedAlgo = GetArg("-ac_algo", std::string(ASSETCHAINS_ALGORITHMS[0]));
@@ -1897,10 +1897,10 @@ void komodo_args(char *argv0)
ASSETCHAINS_COMMISSION = 53846154; // maps to 35% ASSETCHAINS_COMMISSION = 53846154; // maps to 35%
printf("ASSETCHAINS_COMMISSION defaulted to 35%% when founders reward active\n"); printf("ASSETCHAINS_COMMISSION defaulted to 35%% when founders reward active\n");
} }
else else
{ {
printf("ASSETCHAINS_FOUNDERS_REWARD set to %ld\n", ASSETCHAINS_FOUNDERS_REWARD); printf("ASSETCHAINS_FOUNDERS_REWARD set to %ld\n", ASSETCHAINS_FOUNDERS_REWARD);
} }
/*else if ( ASSETCHAINS_SELFIMPORT.size() == 0 ) /*else if ( ASSETCHAINS_SELFIMPORT.size() == 0 )
{ {
//ASSETCHAINS_OVERRIDE_PUBKEY.clear(); //ASSETCHAINS_OVERRIDE_PUBKEY.clear();

View File

@@ -19,7 +19,6 @@
******************************************************************************/ ******************************************************************************/
#include "main.h" #include "main.h"
#include "notaries_staked.h"
#include "sodium.h" #include "sodium.h"
#include "addrman.h" #include "addrman.h"
@@ -1267,35 +1266,23 @@ extern uint8_t NUM_NOTARIES;
int32_t komodo_isnotaryvout(char *coinaddr) // from ac_private chains only int32_t komodo_isnotaryvout(char *coinaddr) // from ac_private chains only
{ {
if ( is_STAKED(ASSETCHAINS_SYMBOL) != 0 ) static int32_t didinit; static char notaryaddrs[sizeof(Notaries_elected1)/sizeof(*Notaries_elected1) + 1][64];
{ int32_t i;
if ( NOTARYADDRS[0][0] != 0 && NUM_NOTARIES != 0 ) if ( didinit == 0 )
{ {
for (int32_t i=0; i<=NUM_NOTARIES; i++) uint8_t pubkey33[33];
if ( strcmp(coinaddr,NOTARYADDRS[i]) == 0 ) for (i=0; i<=sizeof(Notaries_elected1)/sizeof(*Notaries_elected1); i++)
return(1); {
} if ( i < sizeof(Notaries_elected1)/sizeof(*Notaries_elected1) )
} decode_hex(pubkey33,33,(char *)Notaries_elected1[i][1]);
else else decode_hex(pubkey33,33,(char *)CRYPTO777_PUBSECPSTR);
{ pubkey2addr((char *)notaryaddrs[i],(uint8_t *)pubkey33);
static int32_t didinit; static char notaryaddrs[sizeof(Notaries_elected1)/sizeof(*Notaries_elected1) + 1][64]; }
int32_t i; didinit = 1;
if ( didinit == 0 )
{
uint8_t pubkey33[33];
for (i=0; i<=sizeof(Notaries_elected1)/sizeof(*Notaries_elected1); i++)
{
if ( i < sizeof(Notaries_elected1)/sizeof(*Notaries_elected1) )
decode_hex(pubkey33,33,(char *)Notaries_elected1[i][1]);
else decode_hex(pubkey33,33,(char *)CRYPTO777_PUBSECPSTR);
pubkey2addr((char *)notaryaddrs[i],(uint8_t *)pubkey33);
}
didinit = 1;
}
for (i=0; i<=sizeof(Notaries_elected1)/sizeof(*Notaries_elected1); i++)
if ( strcmp(coinaddr,notaryaddrs[i]) == 0 )
return(1);
} }
for (i=0; i<=sizeof(Notaries_elected1)/sizeof(*Notaries_elected1); i++)
if ( strcmp(coinaddr,notaryaddrs[i]) == 0 )
return(1);
return(0); return(0);
} }

View File

@@ -253,7 +253,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
if ( ASSETCHAINS_NOTARY_PAY[0] != 0 ) if ( ASSETCHAINS_NOTARY_PAY[0] != 0 )
{ {
// Only use speical miner for notary pay chains. // Only use speical miner for notary pay chains.
numSN = komodo_notaries(notarypubkeys, nHeight, pblock->nTime) numSN = komodo_notaries(notarypubkeys, nHeight, pblock->nTime);
} }
CCoinsViewCache view(pcoinsTip); CCoinsViewCache view(pcoinsTip);