Compile fixes

This commit is contained in:
Duke Leto
2019-12-11 22:39:56 -05:00
parent 5477a673e1
commit bfc635106a
6 changed files with 12 additions and 47 deletions

View File

@@ -835,18 +835,6 @@ int32_t komodo_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
} }
//fprintf(stderr,"%s connect.%d\n",ASSETCHAINS_SYMBOL,pindex->nHeight); //fprintf(stderr,"%s connect.%d\n",ASSETCHAINS_SYMBOL,pindex->nHeight);
// Wallet Filter. Disabled here. Cant be activated by notaries or pools with some changes. // 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()); numnotaries = komodo_notaries(pubkeys,pindex->GetHeight(),pindex->GetBlockTime());
calc_rmd160_sha256(rmd160,pubkeys[0],33); calc_rmd160_sha256(rmd160,pubkeys[0],33);
if ( pindex->GetHeight() > hwmheight ) if ( pindex->GetHeight() > hwmheight )

View File

@@ -130,16 +130,6 @@ int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestam
return(NUM_KMD_NOTARIES); 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; htind = height / KOMODO_ELECTION_GAP;
if ( htind >= KOMODO_MAXBLOCKS / KOMODO_ELECTION_GAP ) if ( htind >= KOMODO_MAXBLOCKS / KOMODO_ELECTION_GAP )

View File

@@ -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); ASSETCHAINS_SAPLING = GetArg("-ac_sapling", -1);
if (ASSETCHAINS_SAPLING == -1) if (ASSETCHAINS_SAPLING == -1)
{ {

View File

@@ -116,6 +116,13 @@ bool fAlerts = DEFAULT_ALERTS;
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE; int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;
unsigned int expiryDelta = DEFAULT_TX_EXPIRY_DELTA; 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) */ /** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */
CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE); 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); //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) 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); fprintf(stderr," failed hash ht.%d\n",height);
return state.DoS(50, error("CheckBlock: proof of work failed"),REJECT_INVALID, "high-hash"); 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"); return state.DoS(100, error("CheckBlock: failed slow_checkPOW"),REJECT_INVALID, "failed-slow_checkPOW");
} }
if ( height > nDecemberHardforkHeight && ASSETCHAINS_SYMBOL[0] == 0 ) // December 2019 hardfork 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; 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; checked = 0;
//fprintf(stderr,"passed checkblock but failed checkPOW.%d\n",from_miner && ASSETCHAINS_STAKED == 0); //fprintf(stderr,"passed checkblock but failed checkPOW.%d\n",from_miner && ASSETCHAINS_STAKED == 0);

View File

@@ -121,6 +121,8 @@ public:
} }
}; };
extern int8_t ASSETCHAINS_ADAPTIVEPOW;
void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev) void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)
{ {
if ( ASSETCHAINS_ADAPTIVEPOW <= 0 ) if ( ASSETCHAINS_ADAPTIVEPOW <= 0 )

View File

@@ -39,20 +39,7 @@ NotarisationsInBlock ScanBlockNotarisations(const CBlock &block, int nHeight)
continue; continue;
//printf("Authorised notarisation data for %s \n",data.symbol); //printf("Authorised notarisation data for %s \n",data.symbol);
} else if (authority == CROSSCHAIN_STAKED) { } else if (authority == CROSSCHAIN_STAKED) {
// We need to create auth_STAKED dynamically here based on timestamp continue;
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;
} }
if (parsed) { if (parsed) {