Browse Source

Change name and off-by-one to make compatible with dry-run chain

pull/4/head
Michael Toutonghi 6 years ago
parent
commit
3c8a1c9d1f
  1. 2
      src/komodo_globals.h
  2. 6
      src/pow.cpp

2
src/komodo_globals.h

@ -82,7 +82,7 @@ uint32_t ASSETCHAINS_ALGO = _ASSETCHAINS_EQUIHASH;
int32_t ASSETCHAINS_LWMAPOS = 0; // percentage of blocks should be PoS
int32_t VERUS_BLOCK_POSUNITS = 1024; // one block is 1000 units
int32_t VERUS_MIN_STAKEAGE = 150; // 1/2 this should also be a cap on the POS averaging window, or startup could be too easy
int32_t VERUS_MAX_CONSECUTIVE_POS = 7;
int32_t VERUS_CONSECUTIVE_POS_THRESHOLD = 7;
int32_t VERUS_NOPOS_THRESHHOLD = 150; // if we have no POS blocks in this many blocks, set to default difficulty
uint64_t KOMODO_INTERESTSUM,KOMODO_WALLETBALANCE;

6
src/pow.cpp

@ -22,7 +22,7 @@
uint32_t komodo_chainactive_timestamp();
extern uint32_t ASSETCHAINS_ALGO, ASSETCHAINS_EQUIHASH;
extern int32_t VERUS_BLOCK_POSUNITS, VERUS_MAX_CONSECUTIVE_POS, VERUS_NOPOS_THRESHHOLD;
extern int32_t VERUS_BLOCK_POSUNITS, VERUS_CONSECUTIVE_POS_THRESHOLD, VERUS_NOPOS_THRESHHOLD;
unsigned int lwmaGetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params);
unsigned int lwmaCalculateNextWorkRequired(const CBlockIndex* pindexLast, const Consensus::Params& params);
@ -210,7 +210,7 @@ uint32_t lwmaGetNextPOSRequired(const CBlockIndex* pindexLast, const Consensus::
// we measure our solve time in passing of blocks, where one bock == VERUS_BLOCK_POSUNITS units
// consecutive blocks in either direction have their solve times exponentially multiplied or divided by power of 2
int x;
for (x = 0; x < VERUS_MAX_CONSECUTIVE_POS; x++)
for (x = 0; x < VERUS_CONSECUTIVE_POS_THRESHOLD; x++)
{
pindexFirst = pindexFirst->pprev;
@ -243,7 +243,7 @@ uint32_t lwmaGetNextPOSRequired(const CBlockIndex* pindexLast, const Consensus::
if (idx[j].consecutive == true)
{
idx[j].solveTime = st;
if (((j - i) + 1) >= VERUS_MAX_CONSECUTIVE_POS)
if ((j - i) >= VERUS_CONSECUTIVE_POS_THRESHOLD)
{
// if this is real time, return zero
if (i == (N - 1))

Loading…
Cancel
Save