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

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

@@ -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

@@ -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,17 +1266,6 @@ 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 )
{
if ( NOTARYADDRS[0][0] != 0 && NUM_NOTARIES != 0 )
{
for (int32_t i=0; i<=NUM_NOTARIES; i++)
if ( strcmp(coinaddr,NOTARYADDRS[i]) == 0 )
return(1);
}
}
else
{
static int32_t didinit; static char notaryaddrs[sizeof(Notaries_elected1)/sizeof(*Notaries_elected1) + 1][64]; static int32_t didinit; static char notaryaddrs[sizeof(Notaries_elected1)/sizeof(*Notaries_elected1) + 1][64];
int32_t i; int32_t i;
if ( didinit == 0 ) if ( didinit == 0 )
@@ -1295,7 +1283,6 @@ int32_t komodo_isnotaryvout(char *coinaddr) // from ac_private chains only
for (i=0; i<=sizeof(Notaries_elected1)/sizeof(*Notaries_elected1); i++) for (i=0; i<=sizeof(Notaries_elected1)/sizeof(*Notaries_elected1); i++)
if ( strcmp(coinaddr,notaryaddrs[i]) == 0 ) if ( strcmp(coinaddr,notaryaddrs[i]) == 0 )
return(1); 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);