Browse Source

enable miner only for notary pay, and fix magic values for non notary pay chains.

pull/27/head
blackjok3r 5 years ago
parent
commit
61d7ede6b4
  1. 8
      src/komodo_utils.h
  2. 6
      src/miner.cpp

8
src/komodo_utils.h

@ -1778,11 +1778,6 @@ void komodo_args(char *argv0)
ASSETCHAINS_DECAY[i] = 0;
printf("ERA%u: ASSETCHAINS_DECAY cant be more than 100000000\n", i);
}
if ( ASSETCHAINS_NOTARY_PAY[i] < 64 )
{
ASSETCHAINS_NOTARY_PAY[i] = 64;
printf("ERA%u: ASSETCHAINS_NOTARY_PAY cant be less than 64. Set to 64.\n", i);
}
}
MAX_BLOCK_SIGOPS = 60000;
@ -1942,7 +1937,8 @@ void komodo_args(char *argv0)
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_REWARD[i]),(void *)&ASSETCHAINS_REWARD[i]);
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_HALVING[i]),(void *)&ASSETCHAINS_HALVING[i]);
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_DECAY[i]),(void *)&ASSETCHAINS_DECAY[i]);
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_NOTARY_PAY[i]),(void *)&ASSETCHAINS_NOTARY_PAY[i]);
if ( ASSETCHAINS_NOTARY_PAY[0] != 0 )
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_NOTARY_PAY[i]),(void *)&ASSETCHAINS_NOTARY_PAY[i]);
}
if (ASSETCHAINS_LASTERA > 0)

6
src/miner.cpp

@ -251,8 +251,10 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
// Now we have the block time, we can get the active notaries.
int32_t staked_era = 0; int8_t numSN = 0;
uint8_t staked_pubkeys[64][33] = {0};
if ( is_STAKED(ASSETCHAINS_SYMBOL) != 0 )
if ( is_STAKED(ASSETCHAINS_SYMBOL) < 3 )
{
// Only use speical miner for LABS chains in the actual cluster that use notarypay!
// It wouldnt hurt to use it on other chains, but serves little purpose.
staked_era = STAKED_era(pblock->nTime);
numSN = numStakedNotaries(staked_pubkeys,staked_era);
}
@ -393,7 +395,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
if ( fNotarisation )
{
// check if the notarization found is actually valid.
// Special miner for notary pay chains.
if ( tx.vout.size() == 2 && tx.vout[1].nValue == 0 )
{
// Get the OP_RETURN for the notarisation

Loading…
Cancel
Save