Compile fixes
This commit is contained in:
12
src/komodo.h
12
src/komodo.h
@@ -835,18 +835,6 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
||||
}
|
||||
//fprintf(stderr,"%s connect.%d\n",ASSETCHAINS_SYMBOL,pindex->nHeight);
|
||||
// Wallet Filter. Disabled here. Cant be activated by notaries or pools with some changes.
|
||||
if ( is_STAKED(ASSETCHAINS_SYMBOL) != 0 || IS_STAKED_NOTARY > -1 )
|
||||
{
|
||||
staked_era = STAKED_era(pindex->GetBlockTime());
|
||||
if ( !fJustCheck && staked_era != lastStakedEra )
|
||||
{
|
||||
uint8_t tmp_pubkeys[64][33];
|
||||
int8_t numSN = numStakedNotaries(tmp_pubkeys,staked_era);
|
||||
UpdateNotaryAddrs(tmp_pubkeys,numSN);
|
||||
STAKED_ERA = staked_era;
|
||||
lastStakedEra = staked_era;
|
||||
}
|
||||
}
|
||||
numnotaries = komodo_notaries(pubkeys,pindex->GetHeight(),pindex->GetBlockTime());
|
||||
calc_rmd160_sha256(rmd160,pubkeys[0],33);
|
||||
if ( pindex->GetHeight() > hwmheight )
|
||||
|
||||
@@ -130,16 +130,6 @@ int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestam
|
||||
return(NUM_KMD_NOTARIES);
|
||||
}
|
||||
}
|
||||
else if ( timestamp != 0 )
|
||||
{
|
||||
// here we can activate our pubkeys for LABS chains everythig is in notaries_staked.cpp
|
||||
int32_t staked_era; int8_t numSN;
|
||||
uint8_t staked_pubkeys[64][33];
|
||||
staked_era = STAKED_era(timestamp);
|
||||
numSN = numStakedNotaries(staked_pubkeys,staked_era);
|
||||
memcpy(pubkeys,staked_pubkeys,numSN * 33);
|
||||
return(numSN);
|
||||
}
|
||||
|
||||
htind = height / KOMODO_ELECTION_GAP;
|
||||
if ( htind >= KOMODO_MAXBLOCKS / KOMODO_ELECTION_GAP )
|
||||
|
||||
@@ -1965,9 +1965,6 @@ void komodo_args(char *argv0)
|
||||
}
|
||||
|
||||
|
||||
if ( (ASSETCHAINS_STAKED= GetArg("-ac_staked",0)) > 100 )
|
||||
ASSETCHAINS_STAKED = 100;
|
||||
|
||||
ASSETCHAINS_SAPLING = GetArg("-ac_sapling", -1);
|
||||
if (ASSETCHAINS_SAPLING == -1)
|
||||
{
|
||||
|
||||
17
src/main.cpp
17
src/main.cpp
@@ -116,6 +116,13 @@ bool fAlerts = DEFAULT_ALERTS;
|
||||
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;
|
||||
|
||||
unsigned int expiryDelta = DEFAULT_TX_EXPIRY_DELTA;
|
||||
extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN];
|
||||
extern uint64_t ASSETCHAINS_ENDSUBSIDY[ASSETCHAINS_MAX_ERAS+1], ASSETCHAINS_REWARD[ASSETCHAINS_MAX_ERAS+1], ASSETCHAINS_HALVING[ASSETCHAINS_MAX_ERAS+1];
|
||||
extern uint32_t ASSETCHAINS_MAGIC;
|
||||
extern uint64_t ASSETCHAINS_LINEAR,ASSETCHAINS_COMMISSION,ASSETCHAINS_SUPPLY;
|
||||
extern uint8_t ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE;
|
||||
extern int32_t ASSETCHAINS_STAKED;
|
||||
extern uint64_t ASSETCHAINS_CBOPRET;
|
||||
|
||||
/** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */
|
||||
CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE);
|
||||
@@ -2383,12 +2390,6 @@ bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex,bool checkPOW)
|
||||
}
|
||||
|
||||
//uint64_t komodo_moneysupply(int32_t height);
|
||||
extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN];
|
||||
extern uint64_t ASSETCHAINS_ENDSUBSIDY[ASSETCHAINS_MAX_ERAS+1], ASSETCHAINS_REWARD[ASSETCHAINS_MAX_ERAS+1], ASSETCHAINS_HALVING[ASSETCHAINS_MAX_ERAS+1];
|
||||
extern uint32_t ASSETCHAINS_MAGIC;
|
||||
extern uint64_t ASSETCHAINS_LINEAR,ASSETCHAINS_COMMISSION,ASSETCHAINS_SUPPLY;
|
||||
extern uint8_t ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE;
|
||||
extern int32_t ASSETCHAINS_STAKED;
|
||||
|
||||
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
|
||||
{
|
||||
@@ -5083,7 +5084,7 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C
|
||||
fprintf(stderr," failed hash ht.%d\n",height);
|
||||
return state.DoS(50, error("CheckBlock: proof of work failed"),REJECT_INVALID, "high-hash");
|
||||
}
|
||||
if ( ASSETCHAINS_STAKED == 0 && komodo_checkPOW(0,1,(CBlock *)&block,height) < 0 ) // checks Equihash
|
||||
if ( ASSETCHAINS_STAKED == 0 && komodo_checkPOW(1,(CBlock *)&block,height) < 0 ) // checks Equihash
|
||||
return state.DoS(100, error("CheckBlock: failed slow_checkPOW"),REJECT_INVALID, "failed-slow_checkPOW");
|
||||
}
|
||||
if ( height > nDecemberHardforkHeight && ASSETCHAINS_SYMBOL[0] == 0 ) // December 2019 hardfork
|
||||
@@ -5732,7 +5733,7 @@ bool ProcessNewBlock(bool from_miner,int32_t height,CValidationState &state, CNo
|
||||
}
|
||||
}
|
||||
fRequested |= fForceProcessing;
|
||||
if ( checked != 0 && komodo_checkPOW(0,0,pblock,height) < 0 ) //from_miner && ASSETCHAINS_STAKED == 0
|
||||
if ( checked != 0 && komodo_checkPOW(0,pblock,height) < 0 ) //from_miner && ASSETCHAINS_STAKED == 0
|
||||
{
|
||||
checked = 0;
|
||||
//fprintf(stderr,"passed checkblock but failed checkPOW.%d\n",from_miner && ASSETCHAINS_STAKED == 0);
|
||||
|
||||
@@ -121,6 +121,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
extern int8_t ASSETCHAINS_ADAPTIVEPOW;
|
||||
|
||||
void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)
|
||||
{
|
||||
if ( ASSETCHAINS_ADAPTIVEPOW <= 0 )
|
||||
|
||||
@@ -39,20 +39,7 @@ NotarisationsInBlock ScanBlockNotarisations(const CBlock &block, int nHeight)
|
||||
continue;
|
||||
//printf("Authorised notarisation data for %s \n",data.symbol);
|
||||
} else if (authority == CROSSCHAIN_STAKED) {
|
||||
// We need to create auth_STAKED dynamically here based on timestamp
|
||||
int32_t staked_era = STAKED_era(timestamp);
|
||||
if (staked_era == 0) {
|
||||
// this is an ERA GAP, so we will ignore this notarization
|
||||
continue;
|
||||
if ( is_STAKED(data.symbol) == 255 )
|
||||
// this chain is banned... we will discard its notarisation.
|
||||
continue;
|
||||
} else {
|
||||
// pass era slection off to notaries_staked.cpp file
|
||||
auth_STAKED = Choose_auth_STAKED(staked_era);
|
||||
}
|
||||
if (!CheckTxAuthority(tx, auth_STAKED))
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (parsed) {
|
||||
|
||||
Reference in New Issue
Block a user